mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 02:25:34 -04:00
rsPeers add few JSON API calls
This commit is contained in:
parent
cfe95a57a0
commit
7a1375ff6f
3 changed files with 65 additions and 6 deletions
|
@ -18,6 +18,7 @@
|
|||
|
||||
|
||||
#include "rsurl.h"
|
||||
#include "serialiser/rstypeserializer.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <algorithm>
|
||||
|
@ -254,6 +255,14 @@ RsUrl& RsUrl::setFragment(const std::string& fragment)
|
|||
return decoded.str();
|
||||
}
|
||||
|
||||
void RsUrl::serial_process( RsGenericSerializer::SerializeJob j,
|
||||
RsGenericSerializer::SerializeContext& ctx )
|
||||
{
|
||||
std::string urlString = toString();
|
||||
RS_SERIAL_PROCESS(urlString);
|
||||
fromString(urlString);
|
||||
}
|
||||
|
||||
/*static*/ const std::string RsUrl::schemeSeparator("://");
|
||||
/*static*/ const std::string RsUrl::ipv6WrapOpen("[");
|
||||
/*static*/ const std::string RsUrl::ipv6Separator(":");
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
#include <string>
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserializable.h"
|
||||
|
||||
/**
|
||||
* Very simplistic and minimal URL helper class for RetroShare, after looking
|
||||
* for a small and self-contained C/C++ URL parsing and manipulation library,
|
||||
|
@ -31,7 +33,7 @@
|
|||
* Anyway this should support most common URLs of the form
|
||||
* scheme://host[:port][/path][?query][#fragment]
|
||||
*/
|
||||
struct RsUrl
|
||||
struct RsUrl : RsSerializable
|
||||
{
|
||||
RsUrl();
|
||||
RsUrl(const std::string& urlStr);
|
||||
|
@ -78,6 +80,10 @@ struct RsUrl
|
|||
inline bool operator!=(const RsUrl& rhs) const
|
||||
{ return toString() != rhs.toString(); }
|
||||
|
||||
/// @see RsSerializable
|
||||
virtual void serial_process(RsGenericSerializer::SerializeJob j,
|
||||
RsGenericSerializer::SerializeContext& ctx);
|
||||
|
||||
static const std::string schemeSeparator;
|
||||
static const std::string ipv6WrapOpen;
|
||||
static const std::string ipv6Separator;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue