mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Functions4U: Added GetCommonAppDataFolder()
git-svn-id: svn://ultimatepp.org/upp/trunk@10146 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
031b727317
commit
09e581ca46
2 changed files with 21 additions and 2 deletions
|
|
@ -698,6 +698,15 @@ String GetSystemFolder()
|
|||
return String(ret);
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
String GetCommonAppDataFolder() {
|
||||
wchar path[MAX_PATH];
|
||||
if(SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL, 0, path) == S_OK)
|
||||
return FromUnicodeBuffer(path);
|
||||
return Null;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool SetEnv(const char *id, const char *val)
|
||||
{
|
||||
// EnvMap().Put(WString(id), WString(val));
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ Vector<String> SearchFile(String dir, const Vector<String> &condFiles, const Vec
|
|||
const Vector<String> &extFiles, const Vector<String> &extFolders,
|
||||
const String text, Vector<String> &errorList);
|
||||
Vector<String> SearchFile(String dir, String condFile, String text, Vector<String> &errorList);//, int flags = 0);
|
||||
Vector<String> SearchFile(String dir, String condFile, String text = "");//, int flags = 0);
|
||||
Vector<String> SearchFile(String dir, String condFile = "*.*", String text = "");//, int flags = 0);
|
||||
///////////////////////////////
|
||||
|
||||
bool FileToTrashBin(const char *path);
|
||||
|
|
@ -98,6 +98,9 @@ String GetRootFolder();
|
|||
String GetTempFolder();
|
||||
String GetOsFolder();
|
||||
String GetSystemFolder();
|
||||
#ifdef PLATFORM_WIN32
|
||||
String GetCommonAppDataFolder();
|
||||
#endif
|
||||
bool SetEnv(const char *id, const char *val);
|
||||
|
||||
struct FileData : Moveable<FileData> {
|
||||
|
|
@ -243,6 +246,10 @@ template <class T>
|
|||
inline bool Between(const T& val, const T& min, const T& max) {
|
||||
return val >= min && val <= max;
|
||||
}
|
||||
template <class T>
|
||||
inline T BetweenVal(const T& val, const T& _min, const T& _max) {
|
||||
return max(_min, min(_max, val));
|
||||
}
|
||||
|
||||
#define IsNan(a) ((a) != (a))
|
||||
|
||||
|
|
@ -619,7 +626,10 @@ public:
|
|||
int GetStatus() {return status;}
|
||||
bool IsRunning() {return status > 0;}
|
||||
Gate4<double, String&, bool, bool&> WhenTimer;
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
DWORD GetPid() {return p.GetPid();}
|
||||
#endif
|
||||
|
||||
private:
|
||||
LocalProcess2 p;
|
||||
TimeStop timeElapsed, timeToTimeout;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue