cphot 0.1
A C++ tool for computing photometry from spectra.
pointer.h File Reference
#include "document.h"
#include "internal/itoa.h"

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...
 

Typedefs

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

Enumerations

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

Variables

static const RAPIDJSON_NAMESPACE_BEGIN SizeType kPointerInvalidIndex = ~SizeType(0)
 Represents an invalid index in GenericPointer::Token. 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

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

Definition at line 1049 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 1074 of file pointer.h.

◆ CreateValueByPointer() [2/4]

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

Definition at line 1069 of file pointer.h.

◆ 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 1062 of file pointer.h.

◆ CreateValueByPointer() [4/4]

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

Definition at line 1057 of file pointer.h.

◆ EraseValueByPointer() [1/2]

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

Definition at line 1342 of file pointer.h.

◆ EraseValueByPointer() [2/2]

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

Definition at line 1337 of file pointer.h.

◆ 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 1096 of file pointer.h.

◆ 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 1086 of file pointer.h.

◆ 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 1091 of file pointer.h.

◆ GetValueByPointer() [4/4]

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

Definition at line 1081 of file pointer.h.

◆ 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 1179 of file pointer.h.

◆ 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 1174 of file pointer.h.

◆ 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 1156 of file pointer.h.

◆ 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 1151 of file pointer.h.

◆ 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 1131 of file pointer.h.

◆ 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 1126 of file pointer.h.

◆ 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 1108 of file pointer.h.

◆ 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 1103 of file pointer.h.

◆ 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 1295 of file pointer.h.

◆ 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 1290 of file pointer.h.

◆ 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 1285 of file pointer.h.

◆ 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 1267 of file pointer.h.

◆ 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 1262 of file pointer.h.

◆ SetValueByPointer() [6/12]

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

Definition at line 1257 of file pointer.h.

◆ 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 1237 of file pointer.h.

◆ 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 1232 of file pointer.h.

◆ 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 1227 of file pointer.h.

◆ 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 1209 of file pointer.h.

◆ 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 1204 of file pointer.h.

◆ 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 1199 of file pointer.h.

◆ 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 1330 of file pointer.h.

◆ SwapValueByPointer() [2/4]

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

Definition at line 1325 of file pointer.h.

◆ 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 1320 of file pointer.h.

◆ 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 1315 of file pointer.h.

Variable Documentation

◆ a

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

Definition at line 1121 of file pointer.h.

◆ defaultValue

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

Definition at line 1121 of file pointer.h.

◆ kPointerInvalidIndex

const RAPIDJSON_NAMESPACE_BEGIN SizeType kPointerInvalidIndex = ~SizeType(0)
static

Represents an invalid index in GenericPointer::Token.

Definition at line 33 of file pointer.h.

◆ pointer

const GenericPointer< typename DocumentType::ValueType > & pointer

Definition at line 1121 of file pointer.h.

◆ source

const CharType(& source

Definition at line 1144 of file pointer.h.

◆ value

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

Definition at line 1222 of file pointer.h.

a
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1121
defaultValue
const GenericPointer< typename T::ValueType > T2 defaultValue
Definition: pointer.h:1121
pointer
const GenericPointer< typename T::ValueType > & pointer
Definition: pointer.h:1121
value
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1222