#include <json_pointer.h>
Definition at line 35 of file json_pointer.h.
Enumerator |
---|
invalid_first_character |
|
invalid_escape_sequence |
|
Definition at line 37 of file json_pointer.h.
38 invalid_first_character,
39 invalid_escape_sequence,
folly::json_pointer::json_pointer |
( |
| ) |
|
|
default |
folly::json_pointer::~json_pointer |
( |
| ) |
|
|
default |
folly::json_pointer::json_pointer |
( |
std::vector< std::string > |
tokens | ) |
|
|
explicitprivatenoexcept |
bool folly::json_pointer::is_prefix_of |
( |
json_pointer const & |
other | ) |
const |
|
noexcept |
Definition at line 66 of file json_pointer.cpp.
References tokens_.
67 auto const& other_tokens = other.tokens();
68 if (
tokens_.size() > other_tokens.size()) {
71 auto const other_begin = other_tokens.cbegin();
72 auto const other_end = other_tokens.cbegin() +
tokens_.size();
73 return std::equal(
tokens_.cbegin(),
tokens_.cend(), other_begin, other_end);
std::vector< std::string > tokens_
std::vector< std::string > const & folly::json_pointer::tokens |
( |
| ) |
const |
Definition at line 24 of file json_pointer.cpp.
References folly::Range< Iter >::at(), folly::Range< Iter >::empty(), invalid_escape_sequence, invalid_first_character, json_pointer(), folly::makeUnexpected(), folly::gen::move, tokens(), and unescape().
Referenced by parse(), and folly::json_patch::try_parse().
31 if (str.at(0) !=
'/') {
35 std::vector<std::string>
tokens;
36 splitTo<std::string>(
"/", str, std::inserter(tokens, tokens.begin()));
37 tokens.erase(tokens.begin());
39 for (
auto& token : tokens) {
static bool unescape(std::string &)
std::vector< std::string > const & tokens() const
constexpr detail::Map< Move > move
constexpr Unexpected< typename std::decay< Error >::type > makeUnexpected(Error &&)
bool folly::json_pointer::unescape |
( |
std::string & |
str | ) |
|
|
staticprivate |
Definition at line 85 of file json_pointer.cpp.
References fizz::decode(), and folly::test::end().
Referenced by try_parse().
86 char const*
end = &str[str.size()];
87 char* out = &str.front();
89 while (decode < end) {
94 if (decode + 1 == end) {
109 str.resize(out - &str.front());
TokenBindingMessage decode(folly::io::Cursor &cursor)
auto end(TestAdlIterable &instance)
Definition at line 72 of file json_pointer.h.
73 return lhs.tokens_ !=
rhs.tokens_;
FOLLY_PUSH_WARNING RHS rhs
Definition at line 68 of file json_pointer.h.
69 return lhs.tokens_ ==
rhs.tokens_;
FOLLY_PUSH_WARNING RHS rhs
The documentation for this class was generated from the following files: