mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-25 07:25:36 -04:00
Enable JSON conversion for RsGxsImage via MemBlockProxy
This commit is contained in:
parent
afeb408f7a
commit
afb92999d8
4 changed files with 50 additions and 16 deletions
|
@ -213,11 +213,14 @@ public:
|
|||
virtual bool getFileData( const RsFileHash& hash, uint64_t offset,
|
||||
uint32_t& requested_size, uint8_t* data ) = 0;
|
||||
|
||||
/***
|
||||
* Control of Downloads.
|
||||
***/
|
||||
|
||||
virtual bool alreadyHaveFile(const RsFileHash& hash, FileInfo &info) = 0;
|
||||
/**
|
||||
* @brief Check if we already have a file
|
||||
* @jsonapi{development}
|
||||
* @param[in] hash file identifier
|
||||
* @param[out] info storage for the possibly found file information
|
||||
* @return true if the file is already present, false otherwise
|
||||
*/
|
||||
virtual bool alreadyHaveFile(const RsFileHash& hash, FileInfo &info) = 0;
|
||||
|
||||
/**
|
||||
* @brief Initiate downloading of a file
|
||||
|
|
|
@ -56,7 +56,7 @@ struct RsGxsChannelGroup : RsSerializable
|
|||
{
|
||||
RS_SERIAL_PROCESS(mMeta);
|
||||
RS_SERIAL_PROCESS(mDescription);
|
||||
//RS_SERIAL_PROCESS(mImage);
|
||||
RS_SERIAL_PROCESS(mImage);
|
||||
RS_SERIAL_PROCESS(mAutoDownload);
|
||||
}
|
||||
};
|
||||
|
@ -90,7 +90,7 @@ struct RsGxsChannelPost : RsSerializable
|
|||
RS_SERIAL_PROCESS(mFiles);
|
||||
RS_SERIAL_PROCESS(mCount);
|
||||
RS_SERIAL_PROCESS(mSize);
|
||||
//RS_SERIAL_PROCESS(mThumbnail);
|
||||
RS_SERIAL_PROCESS(mThumbnail);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ struct RsGxsFile : RsSerializable
|
|||
}
|
||||
};
|
||||
|
||||
struct RsGxsImage
|
||||
struct RsGxsImage : RsSerializable
|
||||
{
|
||||
RsGxsImage();
|
||||
~RsGxsImage();
|
||||
|
@ -70,8 +70,16 @@ struct RsGxsImage
|
|||
void clear(); // Frees.
|
||||
void shallowClear(); // Clears Pointer.
|
||||
|
||||
uint8_t *mData;
|
||||
uint32_t mSize;
|
||||
uint8_t* mData;
|
||||
|
||||
/// @see RsSerializable
|
||||
virtual void serial_process( RsGenericSerializer::SerializeJob j,
|
||||
RsGenericSerializer::SerializeContext& ctx )
|
||||
{
|
||||
RsTypeSerializer::TlvMemBlock_proxy b(mData, mSize);
|
||||
RsTypeSerializer::serial_process(j, ctx, b, "mData");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue