GoPxL SDK
GoJsonPointer.h
Go to the documentation of this file.
1 
9 #ifndef GO_PXL_SDK_JSON_POINTER_H
10 #define GO_PXL_SDK_JSON_POINTER_H
11 
12 #include <GoPxLSdk/Def.h>
13 #include <GoPxLSdk/GoJsonError.h>
14 
15 namespace GoPxLSdk
16 {
21 {
22 public:
29  GoJsonPointer() = default;
30 
39  explicit GoJsonPointer(const std::string& data);
40 
49  GoJsonPointer(const GoJsonPointer& data);
50 
58  std::shared_ptr<nlohmann::json_pointer<nlohmann::json>>& GetHandle();
59  const std::shared_ptr<nlohmann::json_pointer<nlohmann::json>>& GetHandle() const;
60 
68  void PushBack(const std::string& key);
69 
77  void PushBack(const GoJsonPointer& pointer);
78 
85  void PopBack();
86 
94  const std::string ToString() const;
95 
105  static GoJsonPointer Combine(const GoJsonPointer& target, const std::string& tail);
106 
116  static GoJsonPointer Combine(const GoJsonPointer& target, const GoJsonPointer& tail);
117 
127  static GoJsonPointer ParseString(const std::string& data);
128 
129 private:
130  mutable std::shared_ptr<nlohmann::json_pointer<nlohmann::json>> handle;
131 
141  static std::vector<std::string> Tokenize(const std::string& key, char delimiter);
142 };
143 
144 }
145 
146 #endif
#define GoPxLSdkClass
Definition: Def.h:35
Declares the general SDK definitions.
Definition: Def.h:46
Represents json pointer as described in Section 3 of RFC6901.
Definition: GoJsonPointer.h:20