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

Method consumeAndAdvance

valdi_core/src/valdi_core/cpp/Utils/Parser.hpp:70–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69 template<typename Out>
70 [[nodiscard]] Result<const Out*> consumeAndAdvance(size_t requiredSize) {
71 if (getDistanceToEnd() < requiredSize) {
72 return Error(STRING_FORMAT("Unable to parse, missing at least {} bytes, only have {} bytes remaining",
73 requiredSize,
74 _end - _current));
75 }
76 const auto* current = _current;
77 _current += requiredSize;
78
79 return reinterpret_cast<const Out*>(current);
80 }
81};
82
83} // namespace Valdi

Callers

nothing calls this directly

Calls 1

ErrorClass · 0.70

Tested by

no test coverage detected