并入zoost库。
This commit is contained in:
51
include/zoost/zt.utils.h
Normal file
51
include/zoost/zt.utils.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user