1 #ifndef GDE_COMMAND_RESULT_TO_HPP
2 #define GDE_COMMAND_RESULT_TO_HPP
9 class CommandResultTO {
12 // WARNING: keep enum values synchronized to WEB API (CommandResultTO)
13 enum { OK = 1, ERROR = 2};
16 CommandResultTO(int code = -1,
17 std::string message = std::string(),
18 std::string data = std::string())
19 : _code(code), _message(message), _data(data) {}
20 CommandResultTO(const CommandResultTO&);
23 inline std::string getMessage() const { return _message; }
24 inline void setMessage(std::string message) { this->_message = message; }
26 inline std::string getData() const { return _data; }
27 inline void setData(std::string data) { this->_data = data; }
29 inline int getCode() const { return _code; }
30 inline void setCode(int code) { this->_code = code; }
32 static CommandResultTO fromJson(std::string json);
37 std::string _message; // JSON format
38 std::string _data; // JSON format