Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
pointer.h File Reference
#include "document.h"
#include "internal/itoa.h"
Include dependency graph for pointer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  GenericPointer< ValueType, Allocator >
 Represents a JSON Pointer. Use Pointer for UTF8 encoding and default allocator. More...
 
struct  GenericPointer< ValueType, Allocator >::Token
 A token is the basic units of internal representation. More...
 
class  GenericPointer< ValueType, Allocator >::PercentEncodeStream< OutputStream >
 A helper stream to encode character (UTF-8 code unit) into percent-encoded sequence. More...
 

Typedefs

typedef GenericPointer< ValuePointer
 GenericPointer for Value (UTF-8, default allocator).
 

Enumerations

enum  PointerParseErrorCode {
  kPointerParseErrorNone = 0 , kPointerParseErrorTokenMustBeginWithSolidus , kPointerParseErrorInvalidEscape , kPointerParseErrorInvalidPercentEncoding ,
  kPointerParseErrorCharacterMustPercentEncode
}
 Error code of parsing. More...
 

Helper functions for GenericPointer

const GenericPointer< typename T::ValueType > & pointer
 
const GenericPointer< typename T::ValueType > T2 defaultValue
 
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
 
const CharType(& source )[N]
 
const GenericPointer< typename T::ValueType > T2 value
 
template<typename T >
T::ValueType & CreateValueByPointer (T &root, const GenericPointer< typename T::ValueType > &pointer, typename T::AllocatorType &a)
 
template<typename T , typename CharType , size_t N>
T::ValueType & CreateValueByPointer (T &root, const CharType(&source)[N], typename T::AllocatorType &a)
 
template<typename DocumentType >
DocumentType::ValueType & CreateValueByPointer (DocumentType &document, const GenericPointer< typename DocumentType::ValueType > &pointer)
 
template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & CreateValueByPointer (DocumentType &document, const CharType(&source)[N])
 
template<typename T >
T::ValueType * GetValueByPointer (T &root, const GenericPointer< typename T::ValueType > &pointer, size_t *unresolvedTokenIndex=0)
 
template<typename T >
const T::ValueType * GetValueByPointer (const T &root, const GenericPointer< typename T::ValueType > &pointer, size_t *unresolvedTokenIndex=0)
 
template<typename T , typename CharType , size_t N>
T::ValueType * GetValueByPointer (T &root, const CharType(&source)[N], size_t *unresolvedTokenIndex=0)
 
template<typename T , typename CharType , size_t N>
const T::ValueType * GetValueByPointer (const T &root, const CharType(&source)[N], size_t *unresolvedTokenIndex=0)
 
template<typename T >
T::ValueType & GetValueByPointerWithDefault (T &root, const GenericPointer< typename T::ValueType > &pointer, const typename T::ValueType &defaultValue, typename T::AllocatorType &a)
 
template<typename T >
T::ValueType & GetValueByPointerWithDefault (T &root, const GenericPointer< typename T::ValueType > &pointer, const typename T::Ch *defaultValue, typename T::AllocatorType &a)
 
template<typename T , typename T2 >
 RAPIDJSON_DISABLEIF_RETURN ((internal::OrExpr< internal::IsPointer< T2 >, internal::IsGenericValue< T2 > >),(typename T::ValueType &)) GetValueByPointerWithDefault(T &root
 
template<typename T , typename CharType , size_t N>
T::ValueType & GetValueByPointerWithDefault (T &root, const CharType(&source)[N], const typename T::ValueType &defaultValue, typename T::AllocatorType &a)
 
template<typename T , typename CharType , size_t N>
T::ValueType & GetValueByPointerWithDefault (T &root, const CharType(&source)[N], const typename T::Ch *defaultValue, typename T::AllocatorType &a)
 
template<typename T , typename CharType , size_t N, typename T2 >
 RAPIDJSON_DISABLEIF_RETURN ((internal::OrExpr< internal::IsPointer< T2 >, internal::IsGenericValue< T2 > >),(typename T::ValueType &)) GetValueByPointerWithDefault(T &root
 
template<typename DocumentType >
DocumentType::ValueType & GetValueByPointerWithDefault (DocumentType &document, const GenericPointer< typename DocumentType::ValueType > &pointer, const typename DocumentType::ValueType &defaultValue)
 
template<typename DocumentType >
DocumentType::ValueType & GetValueByPointerWithDefault (DocumentType &document, const GenericPointer< typename DocumentType::ValueType > &pointer, const typename DocumentType::Ch *defaultValue)
 
template<typename DocumentType , typename T2 >
 RAPIDJSON_DISABLEIF_RETURN ((internal::OrExpr< internal::IsPointer< T2 >, internal::IsGenericValue< T2 > >),(typename DocumentType::ValueType &)) GetValueByPointerWithDefault(DocumentType &document
 
template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & GetValueByPointerWithDefault (DocumentType &document, const CharType(&source)[N], const typename DocumentType::ValueType &defaultValue)
 
template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & GetValueByPointerWithDefault (DocumentType &document, const CharType(&source)[N], const typename DocumentType::Ch *defaultValue)
 
template<typename DocumentType , typename CharType , size_t N, typename T2 >
 RAPIDJSON_DISABLEIF_RETURN ((internal::OrExpr< internal::IsPointer< T2 >, internal::IsGenericValue< T2 > >),(typename DocumentType::ValueType &)) GetValueByPointerWithDefault(DocumentType &document
 
template<typename T >
T::ValueType & SetValueByPointer (T &root, const GenericPointer< typename T::ValueType > &pointer, typename T::ValueType &value, typename T::AllocatorType &a)
 
template<typename T >
T::ValueType & SetValueByPointer (T &root, const GenericPointer< typename T::ValueType > &pointer, const typename T::ValueType &value, typename T::AllocatorType &a)
 
template<typename T >
T::ValueType & SetValueByPointer (T &root, const GenericPointer< typename T::ValueType > &pointer, const typename T::Ch *value, typename T::AllocatorType &a)
 
template<typename T , typename CharType , size_t N>
T::ValueType & SetValueByPointer (T &root, const CharType(&source)[N], typename T::ValueType &value, typename T::AllocatorType &a)
 
template<typename T , typename CharType , size_t N>
T::ValueType & SetValueByPointer (T &root, const CharType(&source)[N], const typename T::ValueType &value, typename T::AllocatorType &a)
 
template<typename T , typename CharType , size_t N>
T::ValueType & SetValueByPointer (T &root, const CharType(&source)[N], const typename T::Ch *value, typename T::AllocatorType &a)
 
template<typename DocumentType >
DocumentType::ValueType & SetValueByPointer (DocumentType &document, const GenericPointer< typename DocumentType::ValueType > &pointer, typename DocumentType::ValueType &value)
 
template<typename DocumentType >
DocumentType::ValueType & SetValueByPointer (DocumentType &document, const GenericPointer< typename DocumentType::ValueType > &pointer, const typename DocumentType::ValueType &value)
 
template<typename DocumentType >
DocumentType::ValueType & SetValueByPointer (DocumentType &document, const GenericPointer< typename DocumentType::ValueType > &pointer, const typename DocumentType::Ch *value)
 
template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & SetValueByPointer (DocumentType &document, const CharType(&source)[N], typename DocumentType::ValueType &value)
 
template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & SetValueByPointer (DocumentType &document, const CharType(&source)[N], const typename DocumentType::ValueType &value)
 
template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & SetValueByPointer (DocumentType &document, const CharType(&source)[N], const typename DocumentType::Ch *value)
 
template<typename T >
T::ValueType & SwapValueByPointer (T &root, const GenericPointer< typename T::ValueType > &pointer, typename T::ValueType &value, typename T::AllocatorType &a)
 
template<typename T , typename CharType , size_t N>
T::ValueType & SwapValueByPointer (T &root, const CharType(&source)[N], typename T::ValueType &value, typename T::AllocatorType &a)
 
template<typename DocumentType >
DocumentType::ValueType & SwapValueByPointer (DocumentType &document, const GenericPointer< typename DocumentType::ValueType > &pointer, typename DocumentType::ValueType &value)
 
template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & SwapValueByPointer (DocumentType &document, const CharType(&source)[N], typename DocumentType::ValueType &value)
 
template<typename T >
bool EraseValueByPointer (T &root, const GenericPointer< typename T::ValueType > &pointer)
 
template<typename T , typename CharType , size_t N>
bool EraseValueByPointer (T &root, const CharType(&source)[N])
 

Typedef Documentation

◆ Pointer

Definition at line 1109 of file pointer.h.

Function Documentation

◆ CreateValueByPointer() [1/4]

template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & CreateValueByPointer ( DocumentType & document,
const CharType(&) source[N] )

Definition at line 1134 of file pointer.h.

1134 {
1135 return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Create(document);
1136}
Represents a JSON Pointer. Use Pointer for UTF8 encoding and default allocator.
Definition pointer.h:79
const CharType(& source)[N]
Definition pointer.h:1204
const int N
Definition quantize.cpp:54

◆ CreateValueByPointer() [2/4]

template<typename DocumentType >
DocumentType::ValueType & CreateValueByPointer ( DocumentType & document,
const GenericPointer< typename DocumentType::ValueType > & pointer )

Definition at line 1129 of file pointer.h.

1129 {
1130 return pointer.Create(document);
1131}
const GenericPointer< typename T::ValueType > & pointer
Definition pointer.h:1181

◆ CreateValueByPointer() [3/4]

template<typename T , typename CharType , size_t N>
T::ValueType & CreateValueByPointer ( T & root,
const CharType(&) source[N],
typename T::AllocatorType & a )

Definition at line 1122 of file pointer.h.

1122 {
1123 return GenericPointer<typename T::ValueType>(source, N - 1).Create(root, a);
1124}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181

◆ CreateValueByPointer() [4/4]

template<typename T >
T::ValueType & CreateValueByPointer ( T & root,
const GenericPointer< typename T::ValueType > & pointer,
typename T::AllocatorType & a )

Definition at line 1117 of file pointer.h.

1117 {
1118 return pointer.Create(root, a);
1119}
Here is the caller graph for this function:

◆ EraseValueByPointer() [1/2]

template<typename T , typename CharType , size_t N>
bool EraseValueByPointer ( T & root,
const CharType(&) source[N] )

Definition at line 1402 of file pointer.h.

1402 {
1403 return GenericPointer<typename T::ValueType>(source, N - 1).Erase(root);
1404}

◆ EraseValueByPointer() [2/2]

template<typename T >
bool EraseValueByPointer ( T & root,
const GenericPointer< typename T::ValueType > & pointer )

Definition at line 1397 of file pointer.h.

1397 {
1398 return pointer.Erase(root);
1399}
Here is the caller graph for this function:

◆ GetValueByPointer() [1/4]

template<typename T , typename CharType , size_t N>
const T::ValueType * GetValueByPointer ( const T & root,
const CharType(&) source[N],
size_t * unresolvedTokenIndex = 0 )

Definition at line 1156 of file pointer.h.

1156 {
1157 return GenericPointer<typename T::ValueType>(source, N - 1).Get(root, unresolvedTokenIndex);
1158}

◆ GetValueByPointer() [2/4]

template<typename T >
const T::ValueType * GetValueByPointer ( const T & root,
const GenericPointer< typename T::ValueType > & pointer,
size_t * unresolvedTokenIndex = 0 )

Definition at line 1146 of file pointer.h.

1146 {
1147 return pointer.Get(root, unresolvedTokenIndex);
1148}

◆ GetValueByPointer() [3/4]

template<typename T , typename CharType , size_t N>
T::ValueType * GetValueByPointer ( T & root,
const CharType(&) source[N],
size_t * unresolvedTokenIndex = 0 )

Definition at line 1151 of file pointer.h.

1151 {
1152 return GenericPointer<typename T::ValueType>(source, N - 1).Get(root, unresolvedTokenIndex);
1153}

◆ GetValueByPointer() [4/4]

template<typename T >
T::ValueType * GetValueByPointer ( T & root,
const GenericPointer< typename T::ValueType > & pointer,
size_t * unresolvedTokenIndex = 0 )

Definition at line 1141 of file pointer.h.

1141 {
1142 return pointer.Get(root, unresolvedTokenIndex);
1143}
Here is the caller graph for this function:

◆ GetValueByPointerWithDefault() [1/8]

template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & GetValueByPointerWithDefault ( DocumentType & document,
const CharType(&) source[N],
const typename DocumentType::Ch * defaultValue )

Definition at line 1239 of file pointer.h.

1239 {
1240 return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
1241}
const GenericPointer< typename T::ValueType > T2 defaultValue
Definition pointer.h:1181

◆ GetValueByPointerWithDefault() [2/8]

template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & GetValueByPointerWithDefault ( DocumentType & document,
const CharType(&) source[N],
const typename DocumentType::ValueType & defaultValue )

Definition at line 1234 of file pointer.h.

1234 {
1235 return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
1236}

◆ GetValueByPointerWithDefault() [3/8]

template<typename DocumentType >
DocumentType::ValueType & GetValueByPointerWithDefault ( DocumentType & document,
const GenericPointer< typename DocumentType::ValueType > & pointer,
const typename DocumentType::Ch * defaultValue )

Definition at line 1216 of file pointer.h.

1216 {
1217 return pointer.GetWithDefault(document, defaultValue);
1218}

◆ GetValueByPointerWithDefault() [4/8]

template<typename DocumentType >
DocumentType::ValueType & GetValueByPointerWithDefault ( DocumentType & document,
const GenericPointer< typename DocumentType::ValueType > & pointer,
const typename DocumentType::ValueType & defaultValue )

Definition at line 1211 of file pointer.h.

1211 {
1212 return pointer.GetWithDefault(document, defaultValue);
1213}

◆ GetValueByPointerWithDefault() [5/8]

template<typename T , typename CharType , size_t N>
T::ValueType & GetValueByPointerWithDefault ( T & root,
const CharType(&) source[N],
const typename T::Ch * defaultValue,
typename T::AllocatorType & a )

Definition at line 1191 of file pointer.h.

1191 {
1192 return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
1193}

◆ GetValueByPointerWithDefault() [6/8]

template<typename T , typename CharType , size_t N>
T::ValueType & GetValueByPointerWithDefault ( T & root,
const CharType(&) source[N],
const typename T::ValueType & defaultValue,
typename T::AllocatorType & a )

Definition at line 1186 of file pointer.h.

1186 {
1187 return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
1188}

◆ GetValueByPointerWithDefault() [7/8]

template<typename T >
T::ValueType & GetValueByPointerWithDefault ( T & root,
const GenericPointer< typename T::ValueType > & pointer,
const typename T::Ch * defaultValue,
typename T::AllocatorType & a )

Definition at line 1168 of file pointer.h.

1168 {
1169 return pointer.GetWithDefault(root, defaultValue, a);
1170}

◆ GetValueByPointerWithDefault() [8/8]

template<typename T >
T::ValueType & GetValueByPointerWithDefault ( T & root,
const GenericPointer< typename T::ValueType > & pointer,
const typename T::ValueType & defaultValue,
typename T::AllocatorType & a )

Definition at line 1163 of file pointer.h.

1163 {
1164 return pointer.GetWithDefault(root, defaultValue, a);
1165}
Here is the caller graph for this function:

◆ RAPIDJSON_DISABLEIF_RETURN() [1/4]

template<typename DocumentType , typename T2 >
RAPIDJSON_DISABLEIF_RETURN ( (internal::OrExpr< internal::IsPointer< T2 >, internal::IsGenericValue< T2 > >) ,
(typename DocumentType::ValueType &)  ) &

◆ RAPIDJSON_DISABLEIF_RETURN() [2/4]

template<typename DocumentType , typename CharType , size_t N, typename T2 >
RAPIDJSON_DISABLEIF_RETURN ( (internal::OrExpr< internal::IsPointer< T2 >, internal::IsGenericValue< T2 > >) ,
(typename DocumentType::ValueType &)  ) &

◆ RAPIDJSON_DISABLEIF_RETURN() [3/4]

template<typename T , typename T2 >
RAPIDJSON_DISABLEIF_RETURN ( (internal::OrExpr< internal::IsPointer< T2 >, internal::IsGenericValue< T2 > >) ,
(typename T::ValueType &)  ) &

◆ RAPIDJSON_DISABLEIF_RETURN() [4/4]

template<typename T , typename CharType , size_t N, typename T2 >
RAPIDJSON_DISABLEIF_RETURN ( (internal::OrExpr< internal::IsPointer< T2 >, internal::IsGenericValue< T2 > >) ,
(typename T::ValueType &)  ) &

◆ SetValueByPointer() [1/12]

template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & SetValueByPointer ( DocumentType & document,
const CharType(&) source[N],
const typename DocumentType::Ch * value )

Definition at line 1355 of file pointer.h.

1355 {
1357}
const GenericPointer< typename T::ValueType > T2 value
Definition pointer.h:1282

◆ SetValueByPointer() [2/12]

template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & SetValueByPointer ( DocumentType & document,
const CharType(&) source[N],
const typename DocumentType::ValueType & value )

Definition at line 1350 of file pointer.h.

1350 {
1352}

◆ SetValueByPointer() [3/12]

template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & SetValueByPointer ( DocumentType & document,
const CharType(&) source[N],
typename DocumentType::ValueType & value )

Definition at line 1345 of file pointer.h.

1345 {
1347}

◆ SetValueByPointer() [4/12]

template<typename DocumentType >
DocumentType::ValueType & SetValueByPointer ( DocumentType & document,
const GenericPointer< typename DocumentType::ValueType > & pointer,
const typename DocumentType::Ch * value )

Definition at line 1327 of file pointer.h.

1327 {
1328 return pointer.Set(document, value);
1329}

◆ SetValueByPointer() [5/12]

template<typename DocumentType >
DocumentType::ValueType & SetValueByPointer ( DocumentType & document,
const GenericPointer< typename DocumentType::ValueType > & pointer,
const typename DocumentType::ValueType & value )

Definition at line 1322 of file pointer.h.

1322 {
1323 return pointer.Set(document, value);
1324}

◆ SetValueByPointer() [6/12]

template<typename DocumentType >
DocumentType::ValueType & SetValueByPointer ( DocumentType & document,
const GenericPointer< typename DocumentType::ValueType > & pointer,
typename DocumentType::ValueType & value )

Definition at line 1317 of file pointer.h.

1317 {
1318 return pointer.Set(document, value);
1319}

◆ SetValueByPointer() [7/12]

template<typename T , typename CharType , size_t N>
T::ValueType & SetValueByPointer ( T & root,
const CharType(&) source[N],
const typename T::Ch * value,
typename T::AllocatorType & a )

Definition at line 1297 of file pointer.h.

1297 {
1298 return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
1299}

◆ SetValueByPointer() [8/12]

template<typename T , typename CharType , size_t N>
T::ValueType & SetValueByPointer ( T & root,
const CharType(&) source[N],
const typename T::ValueType & value,
typename T::AllocatorType & a )

Definition at line 1292 of file pointer.h.

1292 {
1293 return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
1294}

◆ SetValueByPointer() [9/12]

template<typename T , typename CharType , size_t N>
T::ValueType & SetValueByPointer ( T & root,
const CharType(&) source[N],
typename T::ValueType & value,
typename T::AllocatorType & a )

Definition at line 1287 of file pointer.h.

1287 {
1288 return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
1289}

◆ SetValueByPointer() [10/12]

template<typename T >
T::ValueType & SetValueByPointer ( T & root,
const GenericPointer< typename T::ValueType > & pointer,
const typename T::Ch * value,
typename T::AllocatorType & a )

Definition at line 1269 of file pointer.h.

1269 {
1270 return pointer.Set(root, value, a);
1271}

◆ SetValueByPointer() [11/12]

template<typename T >
T::ValueType & SetValueByPointer ( T & root,
const GenericPointer< typename T::ValueType > & pointer,
const typename T::ValueType & value,
typename T::AllocatorType & a )

Definition at line 1264 of file pointer.h.

1264 {
1265 return pointer.Set(root, value, a);
1266}

◆ SetValueByPointer() [12/12]

template<typename T >
T::ValueType & SetValueByPointer ( T & root,
const GenericPointer< typename T::ValueType > & pointer,
typename T::ValueType & value,
typename T::AllocatorType & a )

Definition at line 1259 of file pointer.h.

1259 {
1260 return pointer.Set(root, value, a);
1261}
Here is the caller graph for this function:

◆ SwapValueByPointer() [1/4]

template<typename DocumentType , typename CharType , size_t N>
DocumentType::ValueType & SwapValueByPointer ( DocumentType & document,
const CharType(&) source[N],
typename DocumentType::ValueType & value )

Definition at line 1390 of file pointer.h.

1390 {
1392}
GenericPointer & Swap(GenericPointer &other) RAPIDJSON_NOEXCEPT
Swap the content of this pointer with an other.
Definition pointer.h:208
Here is the call graph for this function:

◆ SwapValueByPointer() [2/4]

template<typename DocumentType >
DocumentType::ValueType & SwapValueByPointer ( DocumentType & document,
const GenericPointer< typename DocumentType::ValueType > & pointer,
typename DocumentType::ValueType & value )

Definition at line 1385 of file pointer.h.

1385 {
1386 return pointer.Swap(document, value);
1387}
Here is the call graph for this function:

◆ SwapValueByPointer() [3/4]

template<typename T , typename CharType , size_t N>
T::ValueType & SwapValueByPointer ( T & root,
const CharType(&) source[N],
typename T::ValueType & value,
typename T::AllocatorType & a )

Definition at line 1380 of file pointer.h.

1380 {
1382}
Here is the call graph for this function:

◆ SwapValueByPointer() [4/4]

template<typename T >
T::ValueType & SwapValueByPointer ( T & root,
const GenericPointer< typename T::ValueType > & pointer,
typename T::ValueType & value,
typename T::AllocatorType & a )

Definition at line 1375 of file pointer.h.

1375 {
1376 return pointer.Swap(root, value, a);
1377}
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ a

const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Initial value:
{
return pointer.GetWithDefault(root, defaultValue, a)

Definition at line 1181 of file pointer.h.

◆ defaultValue

const GenericPointer< typename DocumentType::ValueType > T2 defaultValue
Initial value:
{
return pointer.GetWithDefault(document, defaultValue)

Definition at line 1181 of file pointer.h.

◆ pointer

const GenericPointer< typename DocumentType::ValueType > & pointer

Definition at line 1181 of file pointer.h.

◆ source

const CharType(& source

Definition at line 1204 of file pointer.h.

◆ value

const CharType( T2 value
Initial value:
{
return pointer.Set(document, value)

Definition at line 1282 of file pointer.h.