1
0
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:
Darryl Pogue
2011-10-27 22:01:07 -07:00
parent 3133161711
commit 7ba977a480
2 changed files with 23 additions and 0 deletions

View File

@ -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 )

View File

@ -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