51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
#ifndef ZOOST_UTILS_H
|
|
#define ZOOST_UTILS_H
|
|
|
|
#include <string>
|
|
|
|
struct zoostDateTime {
|
|
int year{};
|
|
int mon{};
|
|
int day{};
|
|
int hour{};
|
|
int min{};
|
|
int sec{};
|
|
int msec{};
|
|
};
|
|
|
|
class zoostPath
|
|
{
|
|
public:
|
|
zoostPath();
|
|
|
|
public:
|
|
bool CreateConfigDir(const std::string& appName);
|
|
bool GetConfigDir(const std::string& appName, std::string& dir);
|
|
bool GetBinaryPath(std::string& path);
|
|
bool GetBinaryDir(std::string& dir);
|
|
bool GetHome(std::string& path);
|
|
bool GetConfigFile(const std::string& appName, const std::string& fileName, std::string& path);
|
|
|
|
void SetConfigDirName(const std::string& name);
|
|
void SetConfigDir(const std::string& path);
|
|
std::string GetParentPath(const std::string& path);
|
|
|
|
std::string GetErrorMsg() const;
|
|
|
|
private:
|
|
std::string configDir_{};
|
|
std::string configDirName_{".config"};
|
|
std::string errMsg_;
|
|
};
|
|
|
|
class zoostUtils
|
|
{
|
|
public:
|
|
static zoostDateTime CurrentTime();
|
|
static void SetConfigDir(const std::string& path);
|
|
|
|
public:
|
|
static std::string gConfigDir;
|
|
};
|
|
|
|
#endif // ZOOST_UTILS_H
|