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

Method toUInt32

valdi_core/src/valdi_core/cpp/Utils/StringBox.cpp:251–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251std::optional<uint32_t> StringBox::toUInt32() const noexcept {
252 auto sv = toStringView();
253 uint32_t value = 0;
254
255 auto [ptr, ec] = std::from_chars(sv.data(), sv.data() + sv.size(), value);
256 if (ec == std::errc() && ptr == sv.data() + sv.size()) {
257 return value;
258 }
259 return std::nullopt;
260}
261
262StringBox StringBox::append(const std::string_view& other) const noexcept {
263 std::string out;

Callers

nothing calls this directly

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected