载入中...
搜索中...
未找到
ValueRead.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Json.h"
4#include "common/Value.h"
5
6namespace eve {
7
16[[nodiscard]] EVENGINE_API_FOUNDATION Result<std::string> readStringMember(const Value::Object& object,
17 std::string_view name);
18
26[[nodiscard]] EVENGINE_API_FOUNDATION Result<int> readIntValue(const Value& value);
27
34[[nodiscard]] EVENGINE_API_FOUNDATION Result<bool> readBoolValue(const Value& value);
35
42[[nodiscard]] EVENGINE_API_FOUNDATION Result<std::int64_t> readInt64Value(const Value& value);
43
50[[nodiscard]] EVENGINE_API_FOUNDATION Result<std::uint32_t> readUInt32Value(const Value& value);
51
60[[nodiscard]] EVENGINE_API_FOUNDATION Result<double> readNumericDoubleValue(const Value& value);
61
70[[nodiscard]] EVENGINE_API_FOUNDATION Result<float> readFiniteFloatValue(const Value& value);
71
79[[nodiscard]] EVENGINE_API_FOUNDATION Result<json::UnsignedIntegerScan> scanUnsignedStringValue(const Value& value);
80
89[[nodiscard]] EVENGINE_API_FOUNDATION Result<std::string> readNonEmptyStringMember(const Value::Object& object,
90 std::string_view name);
91
100[[nodiscard]] EVENGINE_API_FOUNDATION Result<json::UnsignedIntegerScan> scanUnsignedStringMember(
101 const Value::Object& object, std::string_view name);
102
103} // namespace eve
std::string name
Definition ECS.cpp:154
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
Object::Ptr value
Owning, renderer-independent dynamic values.
std::map< std::string, Value > Object
Definition Value.h:34
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16
Result< float > readFiniteFloatValue(const Value &value)
Convert an Integer or Double to a finite Float after validating its source range.
Definition Value.cpp:81
Result< bool > readBoolValue(const Value &value)
Read a Bool without coercing integers, strings or other kinds.
Definition Value.cpp:50
Result< int > readIntValue(const Value &value)
Read an Int64 value as a range-checked native int without numeric coercion.
Definition Value.cpp:41
Result< json::UnsignedIntegerScan > scanUnsignedStringMember(const Value::Object &object, std::string_view name)
Scan a required nonempty decimal-string field using from_chars semantics.
Definition Value.cpp:104
Result< std::string > readStringMember(const Value::Object &object, std::string_view name)
Read a required string field, including an empty string, as an owning value.
Definition Value.cpp:25
Result< json::UnsignedIntegerScan > scanUnsignedStringValue(const Value &value)
Scan an unsigned decimal prefix from a required nonempty String value.
Definition Value.cpp:96
Result< std::string > readNonEmptyStringMember(const Value::Object &object, std::string_view name)
Read a required nonempty string field as an independent owning value.
Definition Value.cpp:33
Result< std::int64_t > readInt64Value(const Value &value)
Read an Int64 without narrowing or numeric coercion.
Definition Value.cpp:57
Result< std::uint32_t > readUInt32Value(const Value &value)
Read an Int64 as a range-checked UInt32 without numeric coercion.
Definition Value.cpp:65
Result< double > readNumericDoubleValue(const Value &value)
Read an Int64 or Double as a double without imposing a finite-value policy.
Definition Value.cpp:74