载入中...
搜索中...
未找到
WorldSnapshotParsing.cpp
浏览该文件的文档.
9bool hasExactFields(const eve::Value::Object& object, std::initializer_list<std::string_view> expected) {
38 eve::DiagnosticCode::ParseError, "snapshot integer is not a uint64 decimal string", std::string(name)));
50 eve::DiagnosticCode::ParseError, "snapshot integer is not an int64 decimal string", std::string(name)));
59 const double result = value->isDouble() ? value->asDouble() : static_cast<double>(value->asInt());
62 eve::DiagnosticCode::InvalidArgument, "snapshot numeric field must be finite", std::string(name)));
69 if (number.value() < -std::numeric_limits<float>::max() || number.value() > std::numeric_limits<float>::max())
71 eve::DiagnosticCode::InvalidArgument, "snapshot numeric field is outside float range", std::string(name)));
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
Value * find(const std::string &key) noexcept
Return an object member, or nullptr when absent.
Definition Value.cpp:244
Result< float > readFloat(const Value::Object &object, std::string_view name)
Reads a required finite number representable by float.
Definition WorldSnapshotParsing.cpp:66
const Value * field(const Value::Object &object, std::string_view name)
Borrow an optional field only during the current synchronous codec call. @ownership Object owns the r...
Definition WorldSnapshotParsing.cpp:17
bool hasExactFields(const Value::Object &object, std::initializer_list< std::string_view > expected)
Internal exact-field schema predicate.
Definition WorldSnapshotParsing.cpp:9
Result< std::uint64_t > readUint64(const Value::Object &object, std::string_view name)
Reads a required unsigned decimal integer string.
Definition WorldSnapshotParsing.cpp:30
Result< std::int64_t > readInt64(const Value::Object &object, std::string_view name)
Reads a required signed decimal integer string.
Definition WorldSnapshotParsing.cpp:42
Result< bool > readBool(const Value::Object &object, std::string_view name)
Reads a required boolean.
Definition WorldSnapshotParsing.cpp:75
eve::Result< double > readNumber(const eve::Value::Object &object, std::string_view name)
Reads a required finite number.
Definition WorldSnapshotParsing.cpp:54
Result< std::string > readString(const Value::Object &object, std::string_view name)
Reads a required owning string.
Definition WorldSnapshotParsing.cpp:22
@ InvalidArgument
@ ParseError