Electroneum
FilterKeyHandler< OutputHandler > Class Template Reference

Public Types

typedef char Ch
 
typedef char Ch
 

Public Member Functions

 FilterKeyHandler (OutputHandler &outputHandler, const Ch *keyString, SizeType keyLength)
 
bool Null ()
 
bool Bool (bool b)
 
bool Int (int i)
 
bool Uint (unsigned u)
 
bool Int64 (int64_t i)
 
bool Uint64 (uint64_t u)
 
bool Double (double d)
 
bool RawNumber (const Ch *str, SizeType len, bool copy)
 
bool String (const Ch *str, SizeType len, bool copy)
 
bool StartObject ()
 
bool Key (const Ch *str, SizeType len, bool copy)
 
bool EndObject (SizeType)
 
bool StartArray ()
 
bool EndArray (SizeType elementCount)
 
 FilterKeyHandler (OutputHandler &outputHandler, const Ch *keyString, SizeType keyLength)
 
bool Null ()
 
bool Bool (bool b)
 
bool Int (int i)
 
bool Uint (unsigned u)
 
bool Int64 (int64_t i)
 
bool Uint64 (uint64_t u)
 
bool Double (double d)
 
bool RawNumber (const Ch *str, SizeType len, bool copy)
 
bool String (const Ch *str, SizeType len, bool copy)
 
bool StartObject ()
 
bool Key (const Ch *str, SizeType len, bool copy)
 
bool EndObject (SizeType)
 
bool StartArray ()
 
bool EndArray (SizeType elementCount)
 

Detailed Description

template<typename OutputHandler>
class FilterKeyHandler< OutputHandler >

Definition at line 18 of file filterkey.cpp.

Member Typedef Documentation

◆ Ch [1/2]

template<typename OutputHandler>
typedef char FilterKeyHandler< OutputHandler >::Ch

Definition at line 20 of file filterkey.cpp.

◆ Ch [2/2]

template<typename OutputHandler>
typedef char FilterKeyHandler< OutputHandler >::Ch

Definition at line 21 of file filterkeydom.cpp.

Constructor & Destructor Documentation

◆ FilterKeyHandler() [1/2]

template<typename OutputHandler>
FilterKeyHandler< OutputHandler >::FilterKeyHandler ( OutputHandler &  outputHandler,
const Ch keyString,
SizeType  keyLength 
)
inline

Definition at line 22 of file filterkey.cpp.

22  :
23  outputHandler_(outputHandler), keyString_(keyString), keyLength_(keyLength), filterValueDepth_(), filteredKeyCount_()
24  {}

◆ FilterKeyHandler() [2/2]

template<typename OutputHandler>
FilterKeyHandler< OutputHandler >::FilterKeyHandler ( OutputHandler &  outputHandler,
const Ch keyString,
SizeType  keyLength 
)
inline

Definition at line 23 of file filterkeydom.cpp.

23  :
24  outputHandler_(outputHandler), keyString_(keyString), keyLength_(keyLength), filterValueDepth_(), filteredKeyCount_()
25  {}

Member Function Documentation

◆ Bool() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Bool ( bool  b)
inline

Definition at line 27 of file filterkey.cpp.

27 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Bool(b) && EndValue(); }
bool Bool(bool b)
Definition: filterkey.cpp:27

◆ Bool() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Bool ( bool  b)
inline

Definition at line 28 of file filterkeydom.cpp.

28 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Bool(b) && EndValue(); }
bool Bool(bool b)
Definition: filterkey.cpp:27

◆ Double() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Double ( double  d)
inline

Definition at line 32 of file filterkey.cpp.

32 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Double(d) && EndValue(); }
bool Double(double d)
Definition: filterkey.cpp:32

◆ Double() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Double ( double  d)
inline

Definition at line 33 of file filterkeydom.cpp.

33 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Double(d) && EndValue(); }
bool Double(double d)
Definition: filterkey.cpp:32

◆ EndArray() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::EndArray ( SizeType  elementCount)
inline

Definition at line 82 of file filterkey.cpp.

82  {
83  if (filterValueDepth_ > 0) {
84  filterValueDepth_--;
85  return EndValue();
86  }
87  else
88  return outputHandler_.EndArray(elementCount) && EndValue();
89  }

◆ EndArray() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::EndArray ( SizeType  elementCount)
inline

Definition at line 83 of file filterkeydom.cpp.

83  {
84  if (filterValueDepth_ > 0) {
85  filterValueDepth_--;
86  return EndValue();
87  }
88  else
89  return outputHandler_.EndArray(elementCount) && EndValue();
90  }

◆ EndObject() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::EndObject ( SizeType  )
inline

Definition at line 60 of file filterkey.cpp.

60  {
61  if (filterValueDepth_ > 0) {
62  filterValueDepth_--;
63  return EndValue();
64  }
65  else {
66  // Use our own filtered memberCount
67  SizeType memberCount = filteredKeyCount_.top();
68  filteredKeyCount_.pop();
69  return outputHandler_.EndObject(memberCount) && EndValue();
70  }
71  }
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
Definition: rapidjson.h:389

◆ EndObject() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::EndObject ( SizeType  )
inline

Definition at line 61 of file filterkeydom.cpp.

61  {
62  if (filterValueDepth_ > 0) {
63  filterValueDepth_--;
64  return EndValue();
65  }
66  else {
67  // Use our own filtered memberCount
68  SizeType memberCount = filteredKeyCount_.top();
69  filteredKeyCount_.pop();
70  return outputHandler_.EndObject(memberCount) && EndValue();
71  }
72  }
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
Definition: rapidjson.h:389

◆ Int() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Int ( int  i)
inline

Definition at line 28 of file filterkey.cpp.

28 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Int(i) && EndValue(); }
bool Int(int i)
Definition: filterkey.cpp:28

◆ Int() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Int ( int  i)
inline

Definition at line 29 of file filterkeydom.cpp.

29 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Int(i) && EndValue(); }
bool Int(int i)
Definition: filterkey.cpp:28

◆ Int64() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Int64 ( int64_t  i)
inline

Definition at line 30 of file filterkey.cpp.

30 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Int64(i) && EndValue(); }
bool Int64(int64_t i)
Definition: filterkey.cpp:30

◆ Int64() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Int64 ( int64_t  i)
inline

Definition at line 31 of file filterkeydom.cpp.

31 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Int64(i) && EndValue(); }
bool Int64(int64_t i)
Definition: filterkey.cpp:30

◆ Key() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Key ( const Ch str,
SizeType  len,
bool  copy 
)
inline

Definition at line 47 of file filterkey.cpp.

47  {
48  if (filterValueDepth_ > 0)
49  return true;
50  else if (len == keyLength_ && std::memcmp(str, keyString_, len) == 0) {
51  filterValueDepth_ = 1;
52  return true;
53  }
54  else {
55  ++filteredKeyCount_.top();
56  return outputHandler_.Key(str, len, copy);
57  }
58  }
void copy(key &AA, const key &A)
Definition: rctOps.h:79
Here is the call graph for this function:

◆ Key() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Key ( const Ch str,
SizeType  len,
bool  copy 
)
inline

Definition at line 48 of file filterkeydom.cpp.

48  {
49  if (filterValueDepth_ > 0)
50  return true;
51  else if (len == keyLength_ && std::memcmp(str, keyString_, len) == 0) {
52  filterValueDepth_ = 1;
53  return true;
54  }
55  else {
56  ++filteredKeyCount_.top();
57  return outputHandler_.Key(str, len, copy);
58  }
59  }
void copy(key &AA, const key &A)
Definition: rctOps.h:79
Here is the call graph for this function:

◆ Null() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Null ( )
inline

Definition at line 26 of file filterkey.cpp.

26 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Null() && EndValue(); }

◆ Null() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Null ( )
inline

Definition at line 27 of file filterkeydom.cpp.

27 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Null() && EndValue(); }

◆ RawNumber() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::RawNumber ( const Ch str,
SizeType  len,
bool  copy 
)
inline

Definition at line 33 of file filterkey.cpp.

33 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.RawNumber(str, len, copy) && EndValue(); }
void copy(key &AA, const key &A)
Definition: rctOps.h:79
bool RawNumber(const Ch *str, SizeType len, bool copy)
Definition: filterkey.cpp:33
Here is the call graph for this function:

◆ RawNumber() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::RawNumber ( const Ch str,
SizeType  len,
bool  copy 
)
inline

Definition at line 34 of file filterkeydom.cpp.

34 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.RawNumber(str, len, copy) && EndValue(); }
void copy(key &AA, const key &A)
Definition: rctOps.h:79
bool RawNumber(const Ch *str, SizeType len, bool copy)
Definition: filterkey.cpp:33
Here is the call graph for this function:

◆ StartArray() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::StartArray ( )
inline

Definition at line 73 of file filterkey.cpp.

73  {
74  if (filterValueDepth_ > 0) {
75  filterValueDepth_++;
76  return true;
77  }
78  else
79  return outputHandler_.StartArray();
80  }

◆ StartArray() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::StartArray ( )
inline

Definition at line 74 of file filterkeydom.cpp.

74  {
75  if (filterValueDepth_ > 0) {
76  filterValueDepth_++;
77  return true;
78  }
79  else
80  return outputHandler_.StartArray();
81  }

◆ StartObject() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::StartObject ( )
inline

Definition at line 36 of file filterkey.cpp.

36  {
37  if (filterValueDepth_ > 0) {
38  filterValueDepth_++;
39  return true;
40  }
41  else {
42  filteredKeyCount_.push(0);
43  return outputHandler_.StartObject();
44  }
45  }

◆ StartObject() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::StartObject ( )
inline

Definition at line 37 of file filterkeydom.cpp.

37  {
38  if (filterValueDepth_ > 0) {
39  filterValueDepth_++;
40  return true;
41  }
42  else {
43  filteredKeyCount_.push(0);
44  return outputHandler_.StartObject();
45  }
46  }

◆ String() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::String ( const Ch str,
SizeType  len,
bool  copy 
)
inline

Definition at line 34 of file filterkey.cpp.

34 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.String (str, len, copy) && EndValue(); }
bool String(const Ch *str, SizeType len, bool copy)
Definition: filterkey.cpp:34
void copy(key &AA, const key &A)
Definition: rctOps.h:79
Here is the call graph for this function:

◆ String() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::String ( const Ch str,
SizeType  len,
bool  copy 
)
inline

Definition at line 35 of file filterkeydom.cpp.

35 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.String (str, len, copy) && EndValue(); }
bool String(const Ch *str, SizeType len, bool copy)
Definition: filterkey.cpp:34
void copy(key &AA, const key &A)
Definition: rctOps.h:79
Here is the call graph for this function:

◆ Uint() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Uint ( unsigned  u)
inline

Definition at line 29 of file filterkey.cpp.

29 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Uint(u) && EndValue(); }
bool Uint(unsigned u)
Definition: filterkey.cpp:29

◆ Uint() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Uint ( unsigned  u)
inline

Definition at line 30 of file filterkeydom.cpp.

30 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Uint(u) && EndValue(); }
bool Uint(unsigned u)
Definition: filterkey.cpp:29

◆ Uint64() [1/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Uint64 ( uint64_t  u)
inline

Definition at line 31 of file filterkey.cpp.

31 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Uint64(u) && EndValue(); }
bool Uint64(uint64_t u)
Definition: filterkey.cpp:31

◆ Uint64() [2/2]

template<typename OutputHandler>
bool FilterKeyHandler< OutputHandler >::Uint64 ( uint64_t  u)
inline

Definition at line 32 of file filterkeydom.cpp.

32 { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Uint64(u) && EndValue(); }
bool Uint64(uint64_t u)
Definition: filterkey.cpp:31

The documentation for this class was generated from the following files: