-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMessage.h
41 lines (35 loc) · 866 Bytes
/
Message.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Message.h
*
* Created on: Feb 4, 2015
* Author: rmin
*/
#ifndef MESSAGE_H_
#define MESSAGE_H_
#include <iostream>
#include <json/json.h>
#include <map>
#include <vector>
#include <string>
#include <sstream>
class Message {
private:
Json::Value root;
Json::Reader reader;
Json::StyledWriter writer;
public:
Message();
virtual ~Message();
void setJson(std::string &str);
std::string getJson();
void addNode(std::string name,std::string value);
void addNode(std::string name,int value);
void addArray(std::string name,std::vector<int> value);
void addArray(std::string name,std::vector<std::string> value);
void addArray(std::string name, std::vector<Message> value);
std::string getName();
Json::Value& getRoot();
void setJson(Json::Value value);
Json::Value& getArray(std::string str,bool isTurn = 0);
};
#endif /* MESSAGE_H_ */