Electroneum
Loading...
Searching...
No Matches
GenericValue< Encoding, Allocator >::ShortString Struct Reference

#include <document.h>

Public Types

enum  { MaxChars = sizeof(static_cast<Flag*>(0)->payload) / sizeof(Ch) , MaxSize = MaxChars - 1 , LenPos = MaxSize }

Public Member Functions

void SetLength (SizeType len)
SizeType GetLength () const

Static Public Member Functions

static bool Usable (SizeType len)

Public Attributes

Ch str [MaxChars]

Detailed Description

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
struct GenericValue< Encoding, Allocator >::ShortString

Definition at line 1966 of file document.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
anonymous enum
Enumerator
MaxChars 
MaxSize 
LenPos 

Definition at line 1967 of file document.h.

1967{ MaxChars = sizeof(static_cast<Flag*>(0)->payload) / sizeof(Ch), MaxSize = MaxChars - 1, LenPos = MaxSize };
Represents a JSON value. Use Value for UTF8 encoding and default allocator.
Definition document.h:575

Member Function Documentation

◆ GetLength()

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
SizeType GenericValue< Encoding, Allocator >::ShortString::GetLength ( ) const
inline

Definition at line 1972 of file document.h.

1972{ return static_cast<SizeType>(MaxSize - str[LenPos]); }

◆ SetLength()

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
void GenericValue< Encoding, Allocator >::ShortString::SetLength ( SizeType len)
inline

Definition at line 1971 of file document.h.

1971{ str[LenPos] = static_cast<Ch>(MaxSize - len); }

◆ Usable()

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
bool GenericValue< Encoding, Allocator >::ShortString::Usable ( SizeType len)
inlinestatic

Definition at line 1970 of file document.h.

1970{ return (MaxSize >= len); }

Member Data Documentation

◆ str

template<typename Encoding, typename Allocator = MemoryPoolAllocator<>>
Ch GenericValue< Encoding, Allocator >::ShortString::str[MaxChars]

Definition at line 1968 of file document.h.


The documentation for this struct was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/external/rapidjson/include/rapidjson/document.h