GoPxL SDK

- Home
- Files
- Namespace

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 {
20 class GoPxLSdkClass GoJsonPointer
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
GoPxLSdkClass
#define GoPxLSdkClass
Definition: Def.h:35
Def.h
Declares the general SDK definitions.
GoJsonError.h
GoPxLSdk
Definition: Def.h:46
GoPxLSdk::GoJsonPointer
Represents json pointer as described in Section 3 of RFC6901.
Definition: GoJsonPointer.h:20