| #pragma once |
| |
| #ifndef TENV_INCLUDED |
| #define TENV_INCLUDED |
| |
| |
| #include "tgeometry.h" |
| #include "tfilepath.h" |
| |
| |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TNZCORE_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| |
| namespace TEnv { |
| |
| |
| |
| class DVAPI Variable { |
| public: |
| class Imp; |
| Imp *m_imp; |
| |
| public: |
| Variable(std::string name, std::string defaultValue); |
| Variable(std::string name); |
| virtual ~Variable(); |
| |
| std::string getName() const; |
| std::string getValue() const; |
| |
| void assignValue(std::string str); |
| }; |
| |
| class DVAPI IntVar final : public Variable { |
| public: |
| IntVar(std::string name, int defValue); |
| IntVar(std::string name); |
| operator int() const; |
| void operator=(int v); |
| }; |
| |
| class DVAPI DoubleVar final : public Variable { |
| public: |
| DoubleVar(std::string name, double defValue); |
| DoubleVar(std::string name); |
| operator double() const; |
| void operator=(double v); |
| }; |
| |
| class DVAPI StringVar final : public Variable { |
| public: |
| StringVar(std::string name, const std::string &defValue); |
| StringVar(std::string name); |
| operator std::string() const; |
| void operator=(const std::string &v); |
| }; |
| |
| class DVAPI FilePathVar final : public Variable { |
| public: |
| FilePathVar(std::string name, const TFilePath &defValue); |
| FilePathVar(std::string name); |
| operator TFilePath() const; |
| void operator=(const TFilePath &v); |
| }; |
| |
| class DVAPI RectVar final : public Variable { |
| public: |
| RectVar(std::string name, const TRect &defValue); |
| RectVar(std::string name); |
| operator TRect() const; |
| void operator=(const TRect &v); |
| }; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| DVAPI std::string getApplicationName(); |
| DVAPI std::string getApplicationVersion(); |
| |
| DVAPI bool getIsPortable(); |
| |
| |
| |
| DVAPI void setApplicationFullName(std::string applicationFullName); |
| DVAPI std::string getApplicationFullName(); |
| |
| |
| |
| DVAPI void setModuleName(std::string moduleName); |
| DVAPI std::string getModuleName(); |
| |
| |
| |
| DVAPI std::string getRootVarName(); |
| DVAPI void setRootVarName(std::string varName); |
| |
| |
| |
| DVAPI void setSystemVarPrefix(std::string prefix); |
| DVAPI std::string getSystemVarPrefix(); |
| |
| |
| |
| |
| |
| DVAPI TFilePath getRootVarPath(); |
| |
| |
| |
| DVAPI std::string getSystemVarStringValue(std::string varName); |
| DVAPI TFilePath getSystemVarPathValue(std::string varName); |
| DVAPI TFilePathSet getSystemVarPathSetValue(std::string varName); |
| |
| DVAPI TFilePath getStuffDir(); |
| DVAPI TFilePath getConfigDir(); |
| |
| |
| |
| |
| DVAPI void setStuffDir(const TFilePath &stuffDir); |
| |
| DVAPI void saveAllEnvVariables(); |
| |
| |
| |
| DVAPI bool setArgPathValue(std::string key, std::string value); |
| |
| DVAPI const std::map<std::string, std::string> &getSystemPathMap(); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| } |
| |
| |
| |
| #endif |