| 179 | } |
| 180 | |
| 181 | i64 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 | |
| 203 | ui64 ParseUint64FromYsonString(const TYsonStringBuf& str) |
| 204 | { |
nothing calls this directly
no test coverage detected