String AbstractFileManager::makeAbsolute(const String& relativePath, const String& referencePath) { if (::wxIsAbsolutePath(relativePath)) return relativePath; if (!::wxIsAbsolutePath(referencePath)) return ""; String folderPath = isDirectory(referencePath) ? referencePath : deleteLastPathComponent(referencePath); return resolvePath(appendPath(folderPath, relativePath)); }
String WinFileManager::appDirectory() { TCHAR uAppPathC[MAX_PATH] = L""; DWORD numChars = GetModuleFileName(0, uAppPathC, MAX_PATH - 1); char appPathC[MAX_PATH]; WideCharToMultiByte(CP_ACP, 0, uAppPathC, numChars, appPathC, numChars, NULL, NULL); appPathC[numChars] = 0; String appPath(appPathC); return deleteLastPathComponent(appPath); }