RetroArch
Classes | Typedefs | Functions | Variables
serialization.h File Reference
#include <stdint.h>
#include "rapidjson/document.h"
#include "rapidjson/stringbuffer.h"
#include "rapidjson/writer.h"
Include dependency graph for serialization.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  LinearAllocator
 
class  FixedLinearAllocator< Size >
 
class  DirectStringBuffer
 
class  JsonWriter
 
class  JsonDocument
 

Typedefs

using MallocAllocator = rapidjson::CrtAllocator
 
using PoolAllocator = rapidjson::MemoryPoolAllocator< MallocAllocator >
 
using UTF8 = rapidjson::UTF8< char >
 
using StackAllocator = FixedLinearAllocator< 2048 >
 
using JsonWriterBase = rapidjson::Writer< DirectStringBuffer, UTF8, UTF8, StackAllocator, rapidjson::kWriteNoFlags >
 
using JsonDocumentBase = rapidjson::GenericDocument< UTF8, PoolAllocator, StackAllocator >
 
using JsonValue = rapidjson::GenericValue< UTF8, PoolAllocator >
 

Functions

template<size_t Len>
size_t StringCopy (char(&dest)[Len], const char *src)
 
size_t JsonWriteHandshakeObj (char *dest, size_t maxLen, int version, const char *applicationId)
 
size_t JsonWriteRichPresenceObj (char *dest, size_t maxLen, int nonce, int pid, const DiscordRichPresence *presence)
 
size_t JsonWriteSubscribeCommand (char *dest, size_t maxLen, int nonce, const char *evtName)
 
size_t JsonWriteUnsubscribeCommand (char *dest, size_t maxLen, int nonce, const char *evtName)
 
size_t JsonWriteJoinReply (char *dest, size_t maxLen, const char *userId, int reply, int nonce)
 
JsonValueGetObjMember (JsonValue *obj, const char *name)
 
int GetIntMember (JsonValue *obj, const char *name, int notFoundDefault=0)
 
const char * GetStrMember (JsonValue *obj, const char *name, const char *notFoundDefault=nullptr)
 

Variables

constexpr size_t WriterNestingLevels = 2048 / (2 * sizeof(size_t))
 

Typedef Documentation

◆ JsonDocumentBase

using JsonDocumentBase = rapidjson::GenericDocument<UTF8, PoolAllocator, StackAllocator>

◆ JsonValue

using JsonValue = rapidjson::GenericValue<UTF8, PoolAllocator>

◆ JsonWriterBase

◆ MallocAllocator

using MallocAllocator = rapidjson::CrtAllocator

◆ PoolAllocator

using PoolAllocator = rapidjson::MemoryPoolAllocator<MallocAllocator>

◆ StackAllocator

◆ UTF8

using UTF8 = rapidjson::UTF8<char>

Function Documentation

◆ GetIntMember()

int GetIntMember ( JsonValue obj,
const char *  name,
int  notFoundDefault = 0 
)
inline
Here is the caller graph for this function:

◆ GetObjMember()

JsonValue* GetObjMember ( JsonValue obj,
const char *  name 
)
inline
Here is the caller graph for this function:

◆ GetStrMember()

const char* GetStrMember ( JsonValue obj,
const char *  name,
const char *  notFoundDefault = nullptr 
)
inline
Here is the caller graph for this function:

◆ JsonWriteHandshakeObj()

size_t JsonWriteHandshakeObj ( char *  dest,
size_t  maxLen,
int  version,
const char *  applicationId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ JsonWriteJoinReply()

size_t JsonWriteJoinReply ( char *  dest,
size_t  maxLen,
const char *  userId,
int  reply,
int  nonce 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ JsonWriteRichPresenceObj()

size_t JsonWriteRichPresenceObj ( char *  dest,
size_t  maxLen,
int  nonce,
int  pid,
const DiscordRichPresence presence 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ JsonWriteSubscribeCommand()

size_t JsonWriteSubscribeCommand ( char *  dest,
size_t  maxLen,
int  nonce,
const char *  evtName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ JsonWriteUnsubscribeCommand()

size_t JsonWriteUnsubscribeCommand ( char *  dest,
size_t  maxLen,
int  nonce,
const char *  evtName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StringCopy()

template<size_t Len>
size_t StringCopy ( char(&)  dest[Len],
const char *  src 
)
inline
Here is the caller graph for this function:

Variable Documentation

◆ WriterNestingLevels

constexpr size_t WriterNestingLevels = 2048 / (2 * sizeof(size_t))