String GetTempPath() { if(IsWinNT()) { wchar h[MAX_PATH]; UnicodeWin32().GetTempPathW(MAX_PATH, h); return FromSystemCharsetW(h); } else { char h[MAX_PATH]; ::GetTempPath(MAX_PATH, h); return FromSystemCharset(h); } }
String GetLocaleInfoA(LCID lcid, LCTYPE lctype) { if(IsWinNT()) { wchar cbuf[1000]; UnicodeWin32().GetLocaleInfoW(lcid, lctype, cbuf, __countof(cbuf)); return FromSystemCharsetW(cbuf); } else { char cbuf[1000]; ::GetLocaleInfoA(lcid, lctype, cbuf, __countof(cbuf)); return FromSystemCharset(cbuf); } }
String GetWindowsDirectory() { if(IsWinNT()) { wchar temp[MAX_PATH]; *temp = 0; UnicodeWin32().GetWindowsDirectoryW(temp, sizeof(temp)); return FromSystemCharsetW(temp); } else { char temp[MAX_PATH]; *temp = 0; ::GetWindowsDirectory(temp, sizeof(temp)); return FromSystemCharset(temp); } }
String GetModuleFileName(HINSTANCE instance) { #ifdef PLATFORM_WINCE wchar h[_MAX_PATH]; GetModuleFileName(instance, h, _MAX_PATH); return FromSystemCharset(h); #else if(IsWinNT()) { wchar h[_MAX_PATH]; UnicodeWin32().GetModuleFileNameW(instance, h, _MAX_PATH); return FromSystemCharsetW(h); } else { char h[_MAX_PATH]; GetModuleFileName(instance, h, _MAX_PATH); return FromSystemCharset(h); } #endif }
String GetFullPath(const char *file) { #ifdef PLATFORM_WIN32 if(IsWinNT()) { String ufn = FromUnixName(file); wchar h[MAX_PATH]; UnicodeWin32().GetFullPathNameW(ToSystemCharsetW(ufn), MAX_PATH, h, 0); return FromSystemCharsetW(h); } else { String ufn = FromUnixName(file); char h[MAX_PATH]; GetFullPathName(ToSystemCharset(ufn), MAX_PATH, h, 0); return FromSystemCharset(h); } #else return NormalizePath(file); #endif }
String GetCurrentDirectory() { #if defined(PLATFORM_WIN32) if(IsWinNT()) { wchar h[MAX_PATH]; UnicodeWin32().GetCurrentDirectoryW(MAX_PATH, h); return FromSystemCharsetW(h); } else { char h[MAX_PATH]; ::GetCurrentDirectory(MAX_PATH, h); return FromSystemCharset(h); } #elif defined(PLATFORM_POSIX) char h[1024]; return getcwd(h, 1024) ? FromSystemCharset(h) : String(); #else #error GetCurrentDirectory not implemented for this platform, comment this line to get Null return Null; #endif//PLATFORM }
String FindFile::GetName() const { return w ? FromSystemCharsetW(w->cFileName) : FromSystemCharset(a->cFileName); }