MCPcopy Create free account
hub / github.com/Snapchat/Valdi / ensureParserAtEnd

Function ensureParserAtEnd

valdi/src/valdi/runtime/Attributes/ValueConverters.cpp:54–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53template<typename T>
54std::optional<T> ensureParserAtEnd(AttributeParser& parser, std::optional<T>&& result) {
55 if (!result) {
56 return std::nullopt;
57 }
58
59 parser.tryParseWhitespaces();
60 if (!parser.ensureIsAtEnd()) {
61 return std::nullopt;
62 }
63
64 return std::move(result);
65}
66
67Result<Value> ValueConverter::toColor(const ColorPalette& colorPalette, const Value& value) {
68 if (value.isString()) {

Callers 3

toColorMethod · 0.85
toDoubleMethod · 0.85
toPercentMethod · 0.85

Calls 2

tryParseWhitespacesMethod · 0.80
ensureIsAtEndMethod · 0.45

Tested by

no test coverage detected