JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
RJPathsReader.h
Go to the documentation of this file.
1 //
2 // Created by Nico on 11/09/2018.
3 //
4 
5 #ifndef JODA_RJPATHSREADER_H
6 #define JODA_RJPATHSREADER_H
7 
8 #include <rapidjson/reader.h>
9 #include <string>
10 #include <vector>
11 #define JODA_DEFAULT_PATH_DEPTH 50
12 
14  : public rapidjson::BaseReaderHandler<rapidjson::UTF8<>, RJPathsReader> {
15  public:
16  RJPathsReader();
17  bool Default();
18  bool Null();
19  bool Bool(bool b);
20  bool Int(int i);
21  bool Uint(unsigned int i);
22  bool Int64(int64_t int64);
23  bool Uint64(uint64_t uint64);
24  bool Double(double d);
25  bool RawNumber(const Ch *str, rapidjson::SizeType len, bool copy);
26  bool String(const Ch *ch, rapidjson::SizeType type, bool b);
27  bool StartObject();
28  bool Key(const Ch *str, rapidjson::SizeType len, bool copy);
29  bool EndObject(rapidjson::SizeType type);
30  bool StartArray();
31  bool EndArray(rapidjson::SizeType type);
32  const std::vector<std::string> &getPaths() const;
33  void clear();
34 
35  private:
36  std::vector<std::string> stack;
37  std::vector<std::string> paths;
38  std::vector<long> arrStack;
39  void addPath();
40  void addArray();
41  void incArray();
42  void stopArray();
43  void addStack(const Ch *str, rapidjson::SizeType len);
44  void popStack();
45 };
46 
47 #endif // JODA_RJPATHSREADER_H
Definition: RJPathsReader.h:14
const std::vector< std::string > & getPaths() const
Definition: RJPathsReader.cpp:114
bool EndArray(rapidjson::SizeType type)
Definition: RJPathsReader.cpp:90
bool Uint64(uint64_t uint64)
Definition: RJPathsReader.cpp:40
bool StartArray()
Definition: RJPathsReader.cpp:85
bool Int64(int64_t int64)
Definition: RJPathsReader.cpp:34
bool Key(const Ch *str, rapidjson::SizeType len, bool copy)
Definition: RJPathsReader.cpp:71
bool EndObject(rapidjson::SizeType type)
Definition: RJPathsReader.cpp:78
bool String(const Ch *ch, rapidjson::SizeType type, bool b)
Definition: RJPathsReader.cpp:59
RJPathsReader()
Definition: RJPathsReader.cpp:98
void clear()
Definition: RJPathsReader.cpp:134
bool Default()
Definition: RJPathsReader.cpp:8
bool Null()
Definition: RJPathsReader.cpp:10
bool StartObject()
Definition: RJPathsReader.cpp:66
bool Int(int i)
Definition: RJPathsReader.cpp:22
bool Bool(bool b)
Definition: RJPathsReader.cpp:16
bool Double(double d)
Definition: RJPathsReader.cpp:46
bool RawNumber(const Ch *str, rapidjson::SizeType len, bool copy)
Definition: RJPathsReader.cpp:52
bool Uint(unsigned int i)
Definition: RJPathsReader.cpp:28