| 1 |
#ifndef CSCONFIG_H |
| 2 |
#define CSCONFIG_H |
| 3 |
|
| 4 |
#include <wx/string.h> |
| 5 |
|
| 6 |
class csConfig |
| 7 |
{ |
| 8 |
wxString m_command; |
| 9 |
wxString m_options; |
| 10 |
size_t m_flags; |
| 11 |
|
| 12 |
public: |
| 13 |
enum eConfigOption { |
| 14 |
kPrettyJSON = (1 << 0), |
| 15 |
}; |
| 16 |
|
| 17 |
protected: |
| 18 |
void EnableFlag(eConfigOption flag, bool b) |
| 19 |
{ |
| 20 |
if(b) { |
| 21 |
m_flags |= flag; |
| 22 |
} else { |
| 23 |
m_flags &= ~flag; |
| 24 |
} |
| 25 |
} |
| 26 |
bool HasFlag(eConfigOption flag) const { return m_flags & flag; } |
| 27 |
|
| 28 |
public: |
| 29 |
csConfig(); |
| 30 |
virtual ~csConfig(); |
| 31 |
void Load(); |
| 32 |
|
| 33 |
void SetCommand(const wxString& command) { this->m_command = command; } |
| 34 |
void SetOptions(const wxString& options) { this->m_options = options; } |
| 35 |
const wxString& GetCommand() const { return m_command; } |
| 36 |
const wxString& GetOptions() const { return m_options; } |
| 37 |
void SetPrettyJSON(bool b) { EnableFlag(kPrettyJSON, b); } |
| 38 |
bool IsPrettyJSON() const { return HasFlag(kPrettyJSON); } |
| 39 |
}; |
| 40 |
|
| 41 |
#endif // CSCONFIG_H |