icinga2/jsonrpc/netstring.h

31 lines
585 B
C
Raw Normal View History

#ifndef NETSTRING_H
#define NETSTRING_H
2012-03-28 13:24:49 +02:00
struct cJSON;
2012-03-28 13:24:49 +02:00
namespace icinga
{
typedef ::cJSON json_t;
class I2_JSONRPC_API Netstring : public Object
2012-03-28 13:24:49 +02:00
{
private:
size_t m_Length;
void *m_Data;
static Dictionary::Ptr GetDictionaryFromJson(json_t *json);
static json_t *GetJsonFromDictionary(const Dictionary::Ptr& dictionary);
2012-04-18 15:22:25 +02:00
2012-03-28 13:24:49 +02:00
public:
typedef shared_ptr<Netstring> Ptr;
typedef weak_ptr<Netstring> WeakPtr;
2012-03-28 13:24:49 +02:00
2012-04-18 15:22:25 +02:00
static bool ReadMessageFromFIFO(FIFO::Ptr fifo, Message *message);
static void WriteMessageToFIFO(FIFO::Ptr fifo, const Message& message);
2012-03-28 13:24:49 +02:00
};
}
#endif /* NETSTRING_H */