MCPcopy Create free account
hub / github.com/catboost/catboost / ParseInt64FromYsonString

Function ParseInt64FromYsonString

library/cpp/yt/yson_string/convert.cpp:181–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181i64 ParseInt64FromYsonString(const TYsonStringBuf& str)
182{
183 YT_ASSERT(str.GetType() == EYsonType::Node);
184 auto strBuf = str.AsStringBuf();
185 TMemoryInput input(strBuf.data(), strBuf.length());
186 char ch;
187 if (!input.ReadChar(ch)) {
188 throw TYsonLiteralParseException("Missing type marker");
189 }
190 if (ch != NDetail::Int64Marker) {
191 throw TYsonLiteralParseException(Format("Unexpected %v",
192 FormatUnexpectedMarker(ch)));
193 }
194 i64 result;
195 try {
196 ReadVarInt64(&input, &result);
197 } catch (const std::exception& ex) {
198 throw TYsonLiteralParseException(ex, "Failed to decode \"int64\" value");
199 }
200 return result;
201}
202
203ui64 ParseUint64FromYsonString(const TYsonStringBuf& str)
204{

Callers

nothing calls this directly

Calls 9

FormatUnexpectedMarkerFunction · 0.85
ReadCharMethod · 0.80
FormatFunction · 0.50
ReadVarInt64Function · 0.50
GetTypeMethod · 0.45
AsStringBufMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected