2012-10-17 17:20:57 -04:00
|
|
|
#ifndef RSPOSTEDITEMS_H
|
|
|
|
#define RSPOSTEDITEMS_H
|
|
|
|
|
|
|
|
#include "serialiser/rsserviceids.h"
|
|
|
|
#include "serialiser/rsserial.h"
|
2014-03-29 11:34:37 -04:00
|
|
|
//#include "serialiser/rstlvtypes.h"
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
#include "serialiser/rsgxscommentitems.h"
|
|
|
|
|
2012-10-17 17:20:57 -04:00
|
|
|
#include "rsgxsitems.h"
|
|
|
|
#include "retroshare/rsposted.h"
|
|
|
|
|
|
|
|
const uint8_t RS_PKT_SUBTYPE_POSTED_GRP_ITEM = 0x02;
|
|
|
|
const uint8_t RS_PKT_SUBTYPE_POSTED_POST_ITEM = 0x03;
|
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
class RsGxsPostedGroupItem : public RsGxsGrpItem
|
2012-10-17 17:20:57 -04:00
|
|
|
{
|
|
|
|
public:
|
2014-03-29 11:34:37 -04:00
|
|
|
RsGxsPostedGroupItem() : RsGxsGrpItem(RS_SERVICE_GXS_TYPE_POSTED,
|
2013-03-11 16:40:28 -04:00
|
|
|
RS_PKT_SUBTYPE_POSTED_GRP_ITEM) { return; }
|
|
|
|
virtual ~RsGxsPostedGroupItem() { return; }
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
void clear();
|
|
|
|
std::ostream &print(std::ostream &out, uint16_t indent = 0);
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
RsPostedGroup mGroup;
|
2012-10-17 17:20:57 -04:00
|
|
|
};
|
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
class RsGxsPostedPostItem : public RsGxsMsgItem
|
2012-10-17 17:20:57 -04:00
|
|
|
{
|
|
|
|
public:
|
2014-03-29 11:34:37 -04:00
|
|
|
RsGxsPostedPostItem() : RsGxsMsgItem(RS_SERVICE_GXS_TYPE_POSTED,
|
2013-03-11 16:40:28 -04:00
|
|
|
RS_PKT_SUBTYPE_POSTED_POST_ITEM) {return ; }
|
|
|
|
virtual ~RsGxsPostedPostItem() { return; }
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
void clear();
|
|
|
|
std::ostream &print(std::ostream &out, uint16_t indent = 0);
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
RsPostedPost mPost;
|
2012-10-17 17:20:57 -04:00
|
|
|
};
|
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
class RsGxsPostedSerialiser : public RsGxsCommentSerialiser
|
2012-10-17 17:20:57 -04:00
|
|
|
{
|
|
|
|
|
2012-10-29 18:41:41 -04:00
|
|
|
public:
|
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
RsGxsPostedSerialiser()
|
2014-03-29 11:34:37 -04:00
|
|
|
:RsGxsCommentSerialiser(RS_SERVICE_GXS_TYPE_POSTED)
|
2013-03-11 16:40:28 -04:00
|
|
|
{ return; }
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
virtual ~RsGxsPostedSerialiser() { return; }
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
uint32_t size(RsItem *item);
|
|
|
|
bool serialise(RsItem *item, void *data, uint32_t *size);
|
|
|
|
RsItem* deserialise(void *data, uint32_t *size);
|
2012-10-17 17:20:57 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
uint32_t sizeGxsPostedGroupItem(RsGxsPostedGroupItem* item);
|
|
|
|
bool serialiseGxsPostedGroupItem(RsGxsPostedGroupItem* item, void* data, uint32_t *size);
|
|
|
|
RsGxsPostedGroupItem* deserialiseGxsPostedGroupItem(void *data, uint32_t *size);
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
uint32_t sizeGxsPostedPostItem(RsGxsPostedPostItem* item);
|
|
|
|
bool serialiseGxsPostedPostItem(RsGxsPostedPostItem* item, void* data, uint32_t *size);
|
|
|
|
RsGxsPostedPostItem* deserialiseGxsPostedPostItem(void *data, uint32_t *size);
|
2012-10-17 17:20:57 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // RSPOSTEDITEMS_H
|