28 #ifndef INCLUDE_OLA_WEB_JSONPOINTER_H_
29 #define INCLUDE_OLA_WEB_JSONPOINTER_H_
118 return m_pointer->
TokenAt(m_index);
123 unsigned int m_index;
163 return m_tokens.size() + 1;
172 if (i >= m_tokens.size()) {
183 void Push(
const std::string &token);
203 typedef std::vector<std::string> Tokens;
208 static std::string EscapeString(
const std::string &input);
209 static std::string UnEscapeString(
const std::string &input);
216 #endif // INCLUDE_OLA_WEB_JSONPOINTER_H_
unsigned int TokenCount() const
The number of tokens in the Json Pointer.
Definition: JsonPointer.h:162
Iterator begin() const
Return an iterator pointing to the first token in the JsonPointer.
Definition: JsonPointer.h:152
void Push(const std::string &token)
Append a token to the pointer path.
Definition: JsonPointer.cpp:64
An iterator for traversing a JsonPointer.
Definition: JsonPointer.h:74
bool IsValid() const
Returns true if this pointer is valid.
Definition: JsonPointer.h:147
void Pop()
Pop the last token from the pointer.
Definition: JsonPointer.cpp:68
bool AtEnd() const
Check if the iterator is pointing to the last token.
Definition: JsonPointer.h:94
Iterator & operator++()
Move the iterator to the next token in the pointer.
Definition: JsonPointer.h:101
A JSON pointer (RFC 6901) refers to a possible element in a JSON data structure.
Definition: JsonPointer.h:66
bool IsValid() const
Check if this iterator is valid.
Definition: JsonPointer.h:87
bool IsPrefixOf(const JsonPointer &other) const
Check if this pointer is a prefix of another.
Definition: JsonPointer.cpp:89
Iterator & operator++(int)
Move the iterator to the next token in the pointer.
Definition: JsonPointer.h:109
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
std::string TokenAt(unsigned int i) const
Return the token at the specifed index.
Definition: JsonPointer.h:171
bool operator==(const JsonPointer &other) const
Equality operator.
Definition: JsonPointer.cpp:60
std::string ToString() const
Returns the string representation of the pointer.
Definition: JsonPointer.cpp:74
std::string operator*() const
Return the current token.
Definition: JsonPointer.h:117