| 201 | } |
| 202 | |
| 203 | ui64 ParseUint64FromYsonString(const TYsonStringBuf& str) |
| 204 | { |
| 205 | YT_ASSERT(str.GetType() == EYsonType::Node); |
| 206 | auto strBuf = str.AsStringBuf(); |
| 207 | TMemoryInput input(strBuf.data(), strBuf.length()); |
| 208 | char ch; |
| 209 | if (!input.ReadChar(ch)) { |
| 210 | throw TYsonLiteralParseException("Missing type marker"); |
| 211 | } |
| 212 | if (ch != NDetail::Uint64Marker) { |
| 213 | throw TYsonLiteralParseException(Format("Unexpected %v", |
| 214 | FormatUnexpectedMarker(ch))); |
| 215 | } |
| 216 | ui64 result; |
| 217 | try { |
| 218 | ReadVarUint64(&input, &result); |
| 219 | } catch (const std::exception& ex) { |
| 220 | throw TYsonLiteralParseException(ex, "Failed to decode \"uint64\" value"); |
| 221 | } |
| 222 | return result; |
| 223 | } |
| 224 | |
| 225 | TString ParseStringFromYsonString(const TYsonStringBuf& str) |
| 226 | { |
no test coverage detected