mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Add wchar* versions of some plFile utils.
This commit is contained in:
@ -439,7 +439,22 @@ void plFileUtils::AddSlash(char* path)
|
||||
{
|
||||
char lastChar = path[strlen(path)-1];
|
||||
if (lastChar != '\\' && lastChar != '/')
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
strcat(path, "\\");
|
||||
#else
|
||||
strcat(path, "/");
|
||||
#endif
|
||||
}
|
||||
|
||||
void plFileUtils::AddSlash(wchar* path)
|
||||
{
|
||||
wchar lastChar = path[wcslen(path)-1];
|
||||
if (lastChar != L'\\' && lastChar != L'/')
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
wcscat(path, L"\\");
|
||||
#else
|
||||
wcscat(path, L"/");
|
||||
#endif
|
||||
}
|
||||
|
||||
void plFileUtils::ConcatFileName(char* path, const char* fileName)
|
||||
@ -448,6 +463,12 @@ void plFileUtils::ConcatFileName(char* path, const char* fileName)
|
||||
strcat(path, fileName);
|
||||
}
|
||||
|
||||
void plFileUtils::ConcatFileName(wchar* path, const wchar* fileName)
|
||||
{
|
||||
AddSlash(path);
|
||||
wcscat(path, fileName);
|
||||
}
|
||||
|
||||
//// GetFileSize /////////////////////////////////////////////////////////////
|
||||
|
||||
UInt32 plFileUtils::GetFileSize( const char *path )
|
||||
|
@ -107,9 +107,11 @@ namespace plFileUtils
|
||||
|
||||
// Adds a slash to the end of a filename (or does nothing if it's already there)
|
||||
void AddSlash(char* path);
|
||||
void AddSlash(wchar* path);
|
||||
|
||||
// Concatenates fileName onto path, making sure to add a slash if necessary
|
||||
void ConcatFileName(char* path, const char* fileName);
|
||||
void ConcatFileName(wchar* path, const wchar* fileName);
|
||||
|
||||
// searches the parent directory of filename for the encryption key file, and reads it
|
||||
// into the key passed in. Returns false if the key file didn't exist (and sets key to
|
||||
|
Reference in New Issue
Block a user