mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-11 00:41:12 +00:00
Update ttvfs to new version
This commit is contained in:
parent
209ad526c6
commit
8026cdd905
43 changed files with 2124 additions and 2427 deletions
|
@ -1,36 +1,39 @@
|
|||
#include "VFSInternal.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <shlobj.h>
|
||||
#endif
|
||||
|
||||
#include "VFSSystemPaths.h"
|
||||
#include "VFSTools.h"
|
||||
#include "VFSInternal.h"
|
||||
|
||||
|
||||
VFS_NAMESPACE_START
|
||||
|
||||
|
||||
std::string GetUserDir()
|
||||
{
|
||||
const char *user;
|
||||
#ifdef _WIN32
|
||||
TCHAR szPath[MAX_PATH];
|
||||
if(SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PROFILE, NULL, 0, szPath)))
|
||||
if(SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PROFILE, NULL, 0, szPath)))
|
||||
{
|
||||
return szPath;
|
||||
}
|
||||
|
||||
// Fallback
|
||||
const char *user = getenv("USERPROFILE");
|
||||
user = getenv("USERPROFILE");
|
||||
if(user)
|
||||
return user;
|
||||
|
||||
// Sorry, windoze :(
|
||||
return "";
|
||||
|
||||
#else // Assume POSIX compliance
|
||||
const char *user = getenv("HOME");
|
||||
if(user)
|
||||
return user;
|
||||
#endif
|
||||
|
||||
// Assume POSIX compliance
|
||||
user = getenv("HOME");
|
||||
if(user)
|
||||
return user;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string GetAppDir(const char *appname)
|
||||
|
@ -55,7 +58,7 @@ std::string GetAppDir(const char *appname)
|
|||
ret = "."; // Seems we have no other choice
|
||||
}
|
||||
|
||||
return FixPath(ret + '/' + appname);
|
||||
ret += '/';
|
||||
|
||||
#else // Assume POSIX compliance
|
||||
|
||||
|
@ -65,9 +68,14 @@ std::string GetAppDir(const char *appname)
|
|||
else
|
||||
ret = ".";
|
||||
|
||||
return FixPath(ret + "/." + appname); // just in case
|
||||
ret += "/.";
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
ret += appname;
|
||||
FixPath(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue