MCPcopy Create free account
hub / github.com/KTH-RPL/dufomap / parse_key_buffer

Class parse_key_buffer

src/toml.hpp:12978–13024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12976#define push_parse_scope(scope) push_parse_scope_1(scope, __LINE__)
12977
12978 struct parse_key_buffer
12979 {
12980 std::string buffer;
12981 std::vector<std::pair<size_t, size_t>> segments;
12982 std::vector<source_position> starts;
12983 std::vector<source_position> ends;
12984
12985 void clear() noexcept
12986 {
12987 buffer.clear();
12988 segments.clear();
12989 starts.clear();
12990 ends.clear();
12991 }
12992
12993 void push_back(std::string_view segment, source_position b, source_position e)
12994 {
12995 segments.push_back({ buffer.length(), segment.length() });
12996 buffer.append(segment);
12997 starts.push_back(b);
12998 ends.push_back(e);
12999 }
13000
13001 TOML_PURE_INLINE_GETTER
13002 std::string_view operator[](size_t i) const noexcept
13003 {
13004 return std::string_view{ buffer.c_str() + segments[i].first, segments[i].second };
13005 }
13006
13007 TOML_PURE_INLINE_GETTER
13008 std::string_view back() const noexcept
13009 {
13010 return (*this)[segments.size() - 1u];
13011 }
13012
13013 TOML_PURE_INLINE_GETTER
13014 bool empty() const noexcept
13015 {
13016 return segments.empty();
13017 }
13018
13019 TOML_PURE_INLINE_GETTER
13020 size_t size() const noexcept
13021 {
13022 return segments.size();
13023 }
13024 };
13025
13026 struct depth_counter_scope
13027 {

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected