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

Function parse_bool

Rapfi/external/cpptoml/include/cpptoml.h:2836–2856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2834 }
2835
2836 std::shared_ptr<value<bool>> parse_bool(std::string::iterator& it,
2837 const std::string::iterator& end)
2838 {
2839 auto eat = make_consumer(it, end, [this]() {
2840 throw_parse_exception("Attempted to parse invalid boolean value");
2841 });
2842
2843 if (*it == 't')
2844 {
2845 eat("true");
2846 return make_value<bool>(true);
2847 }
2848 else if (*it == 'f')
2849 {
2850 eat("false");
2851 return make_value<bool>(false);
2852 }
2853
2854 eat.error();
2855 return nullptr;
2856 }
2857
2858 std::string::iterator find_end_of_number(std::string::iterator it,
2859 std::string::iterator end)

Callers 1

parse_valueFunction · 0.70

Calls 3

make_consumerFunction · 0.85
throw_parse_exceptionFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected