icinga2/jsonrpc/jsonrpcmessage.h

57 lines
1.1 KiB
C
Raw Normal View History

2012-03-28 13:24:49 +02:00
#ifndef I2_JSONRPCMESSAGE_H
#define I2_JSONRPCMESSAGE_H
namespace icinga
{
class JsonRpcMessage : public Object
{
private:
cJSON *m_JSON;
void InitJson(void);
void SetFieldString(const char *field, const string& value);
2012-03-28 13:24:49 +02:00
string GetFieldString(const char *field);
void ClearField(const char *field);
void SetFieldObject(const char *field, cJSON *object);
cJSON *GetFieldObject(const char *field);
2012-03-28 13:24:49 +02:00
public:
typedef shared_ptr<JsonRpcMessage> RefType;
typedef weak_ptr<JsonRpcMessage> WeakRefType;
JsonRpcMessage(void);
~JsonRpcMessage(void);
2012-03-28 21:20:13 +02:00
void SetJSON(cJSON *object);
cJSON *GetJSON(void);
void SetVersion(const string& version);
string GetVersion(void);
void SetID(const string& id);
2012-03-28 13:24:49 +02:00
string GetID(void);
void SetMethod(const string& method);
2012-03-28 13:24:49 +02:00
string GetMethod(void);
void ClearParams(void);
cJSON *GetParams(void);
2012-03-28 13:24:49 +02:00
2012-03-31 16:01:31 +02:00
void SetParam(const string& name, const string& value);
cJSON *GetParam(const string& name);
bool GetParamString(const string name, string *value);
void ClearResult();
cJSON *GetResult(void);
2012-03-28 13:24:49 +02:00
void SetError(const string& error);
2012-03-28 13:24:49 +02:00
string GetError(void);
};
}
#endif /* I2_JSONRPCMESSAGE_H */