Subversion Repositories tpanel

Rev

Rev 23 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23 Rev 24
Line 31... Line 31...
31
 * @def TPANEL_VERSION
31
 * @def TPANEL_VERSION
32
 * Defines the version of this application.
32
 * Defines the version of this application.
33
 */
33
 */
34
#define TPANEL_VERSION		((V_MAJOR * 0x10000) + (V_MINOR * 0x100) + V_PATCH)
34
#define TPANEL_VERSION		((V_MAJOR * 0x10000) + (V_MINOR * 0x100) + V_PATCH)
35
 
35
 
-
 
36
#define VERSION_STRING() _GET_X_VERSION(V_MAJOR, V_MINOR, V_PATCH)
-
 
37
#define _GET_X_VERSION(a, b, c) _GET_VERSION(a, b, c)
-
 
38
#define _GET_VERSION(a, b, c) ( #a "." #b "." #c)
-
 
39
 
36
/**
40
/**
37
 * @brief The TConfig class manages the configurations.
41
 * @brief The TConfig class manages the configurations.
38
 *
42
 *
39
 * The class contains methods to read a config file, parse it's content and
43
 * The class contains methods to read a config file, parse it's content and
40
 * hold the configuration options in the class. All public methods are static.
44
 * hold the configuration options in the class. All public methods are static.
Line 52... Line 56...
52
		static std::string& getProjectPath();
56
		static std::string& getProjectPath();
53
		static std::string& getLogFile();
57
		static std::string& getLogFile();
54
		static std::string& getLogLevel();
58
		static std::string& getLogLevel();
55
		static bool isLongFormat();
59
		static bool isLongFormat();
56
		static bool showBanner();
60
		static bool showBanner();
-
 
61
        static bool getScale();
57
 
62
 
58
		static std::string& getController();
63
		static std::string& getController();
59
        static int getSystem();
64
        static int getSystem();
60
		static int getPort();
65
		static int getPort();
61
		static int getChannel();
66
		static int getChannel();
Line 70... Line 75...
70
        static bool savePort(int port);
75
        static bool savePort(int port);
71
        static bool saveChannel(int channel);
76
        static bool saveChannel(int channel);
72
        static bool savePanelType(const std::string& pt);
77
        static bool savePanelType(const std::string& pt);
73
        static bool saveSettings();
78
        static bool saveSettings();
74
        static void saveFormat(bool format);
79
        static void saveFormat(bool format);
-
 
80
        static void saveScale(bool scale);
75
 
81
 
76
	protected:
82
	protected:
77
		static inline std::string &ltrim(std::string &s) {
83
		static inline std::string &ltrim(std::string &s) {
78
            s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int c) {return !std::isspace(c);}));
84
            s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int c) {return !std::isspace(c);}));
79
			return s;
85
			return s;