MCPcopy Create free account
hub / github.com/dhbloo/rapfi / parse_value_array

Function parse_value_array

Rapfi/external/cpptoml/include/cpptoml.h:3046–3066  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3044
3045 template <class Value>
3046 std::shared_ptr<array> parse_value_array(std::string::iterator& it,
3047 std::string::iterator& end)
3048 {
3049 auto arr = make_array();
3050 while (it != end && *it != ']')
3051 {
3052 auto val = parse_value(it, end);
3053 if (auto v = val->as<Value>())
3054 arr->get().push_back(val);
3055 else
3056 throw_parse_exception("Arrays must be homogeneous");
3057 skip_whitespace_and_comments(it, end);
3058 if (*it != ',')
3059 break;
3060 ++it;
3061 skip_whitespace_and_comments(it, end);
3062 }
3063 if (it != end)
3064 ++it;
3065 return arr;
3066 }
3067
3068 template <class Object, class Function>
3069 std::shared_ptr<Object> parse_object_array(Function&& fun, char delim,

Callers

nothing calls this directly

Calls 6

make_arrayFunction · 0.85
throw_parse_exceptionFunction · 0.85
parse_valueFunction · 0.70
push_backMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected