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

Method checkedTo

valdi_core/src/valdi_core/cpp/Utils/Value.cpp:971–978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

969
970template<>
971int32_t Value::checkedTo(ExceptionTracker& exceptionTracker) const {
972 if (!isNumber()) {
973 exceptionTracker.onError(Value::invalidTypeError(ValueType::Int, getType()));
974 return 0;
975 }
976
977 return toInt();
978}
979
980template<>
981int64_t Value::checkedTo(ExceptionTracker& exceptionTracker) const {

Callers

nothing calls this directly

Calls 8

getTypeFunction · 0.85
toStringBoxFunction · 0.85
isArrayFunction · 0.85
StringBoxClass · 0.70
VoidClass · 0.70
onErrorMethod · 0.65
isNumberFunction · 0.50
isFunctionFunction · 0.50

Tested by

no test coverage detected