void NormalizeDirPathPrefix(CSysString &dirPath) { if (dirPath.IsEmpty()) return; if (dirPath.ReverseFind(kDirDelimiter) != dirPath.Length() - 1) dirPath += kDirDelimiter; }
CSysString GetBaseFolderPrefix() { CSysString libPrefix = GetLibraryFolderPrefix(); CSysString temp = libPrefix; temp.Delete(temp.Length() - 1); int pos = temp.ReverseFind(TEXT(CHAR_PATH_SEPARATOR)); return temp.Left(pos + 1); }
static CSysString GetLibraryFolderPrefix() { #ifdef _WIN32 TCHAR fullPath[MAX_PATH + 1]; ::GetModuleFileName(g_hInstance, fullPath, MAX_PATH); CSysString path = fullPath; int pos = path.ReverseFind(TEXT(CHAR_PATH_SEPARATOR)); return path.Left(pos + 1); #else return CSysString(); // FIX IT #endif }
static CSysString GetLibraryFolderPrefix() { #ifdef _WIN32 TCHAR fullPath[MAX_PATH + 1]; ::GetModuleFileName(g_hInstance, fullPath, MAX_PATH); CSysString path = fullPath; int pos = path.ReverseFind(TEXT(CHAR_PATH_SEPARATOR)); return path.Left(pos + 1); #else const char *p7zip_home_dir = getenv("P7ZIP_HOME_DIR"); if (p7zip_home_dir == 0) p7zip_home_dir="./"; #ifdef _UNICODE return MultiByteToUnicodeString(p7zip_home_dir); #else return p7zip_home_dir; #endif #endif }
static CSysString GetLibraryFolderPrefix() { CSysString path = GetLibraryPath(); int pos = path.ReverseFind(TEXT(CHAR_PATH_SEPARATOR)); return path.Left(pos + 1); }