GoPxL SDK
GoJsonPointer.h
Go to the documentation of this file.
1 
10 #ifndef GO_PXL_SDK_JSON_POINTER_H
11 #define GO_PXL_SDK_JSON_POINTER_H
12 
13 #include <GoPxLSdk/Def.h>
14 #include <GoPxLSdk/GoJsonError.h>
15 
16 namespace GoPxLSdk
17 {
22 {
23 public:
30  GoJsonPointer() = default;
31 
40  explicit GoJsonPointer(const std::string& data);
41 
50  GoJsonPointer(const GoJsonPointer& data);
51 
59  std::shared_ptr<nlohmann::json_pointer<nlohmann::json>>& GetHandle();
60  const std::shared_ptr<nlohmann::json_pointer<nlohmann::json>>& GetHandle() const;
61 
69  void PushBack(const std::string& key);
70 
78  void PushBack(const GoJsonPointer& pointer);
79 
86  void PopBack();
87 
95  const std::string ToString() const;
96 
106  static GoJsonPointer Combine(const GoJsonPointer& target, const std::string& tail);
107 
117  static GoJsonPointer Combine(const GoJsonPointer& target, const GoJsonPointer& tail);
118 
128  static GoJsonPointer ParseString(const std::string& data);
129 
130 private:
131  mutable std::shared_ptr<nlohmann::json_pointer<nlohmann::json>> handle;
132 
142  static std::vector<std::string> Tokenize(const std::string& key, char delimiter);
143 };
144 
145 }
146 
147 #endif
#define GoPxLSdkClass
Definition: Def.h:35
Declares the general SDK definitions.
Declares the GoPxLSdk.GoJsonError class.
Definition: Def.h:46
Represents json pointer as described in Section 3 of RFC6901.
Definition: GoJsonPointer.h:21