载入中...
搜索中...
未找到
eve::json 命名空间参考

类

class  Document
 EVENGINE_API_FOUNDATION public API. 更多...
 
struct  Node
 
class  Value
 EVENGINE_API_FOUNDATION public API. 更多...
 

函数

std::string quoteString (std::string_view value, StringEscapeStyle style)
 Encode an owning JSON string using the canonical serializer's escaping implementation.
 
Result< UnsignedIntegerScan > scanUnsignedInteger (std::string_view text, UnsignedIntegerSyntax syntax)
 Scan an unsigned integer prefix without mutating caller state.
 
Result< std::string > stringify (const eve::Value &value)
 Serialize the canonical owning Value as deterministic compact JSON.
 

函数说明

◆ quoteString()

EVENGINE_API_FOUNDATION std::string eve::json::quoteString ( std::string_view  value,
StringEscapeStyle  style 
)

Encode an owning JSON string using the canonical serializer's escaping implementation.

参数
valueBorrowed bytes, used only during this synchronous call; UTF-8 bytes are preserved.
styleExplicit spelling of backspace and form feed; both styles encode every control byte.
返回
Independent JSON string including quotes; allocation failures propagate as exceptions. @cost Linear in input bytes, with one output allocation amortized over the string.
注解
Callable on any thread with stable input; retains no borrows and invokes no callbacks.

在文件 Json.cpp 第 576 行定义.

引用了 output , 以及 value.

◆ scanUnsignedInteger()

EVENGINE_API_FOUNDATION Result< UnsignedIntegerScan > eve::json::scanUnsignedInteger ( std::string_view  text,
UnsignedIntegerSyntax  syntax 
)

Scan an unsigned integer prefix without mutating caller state.

参数
textBorrowed input used synchronously; never retained.
syntaxDecimal uses from_chars; LegacyStoull preserves the old decimal stoull contract.
返回
Owning prefix and consumed length, or ParseError for no conversion or overflow.
备注
Trailing bytes are reported through consumed, allowing compatibility adapters to preserve their historical output assignment before rejecting trailing input. Embedded NUL is trailing input.
注解
Runs on the caller thread; no callbacks. LegacyStoull uses the process C locale as stoull did.

在文件 Json.cpp 第 583 行定义.

引用了 consumed, end, error, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::ParseError, eve::Result< T >::success(), syntax, text , 以及 value.

◆ stringify()

EVENGINE_API_FOUNDATION Result< std::string > eve::json::stringify ( const eve::Value &  value)

Serialize the canonical owning Value as deterministic compact JSON.

参数
valueOwning value containing only JSON-compatible kinds.
返回
JSON text, or SerializationError when a Double is NaN or infinity.
备注
Object keys are emitted in lexicographic order. This is the single canonical JSON serializer used by owning Value adapters.

在文件 Json.cpp 第 605 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), output, eve::SerializationError, eve::Result< T >::success() , 以及 value.

被这些函数引用 eve::Value::toJson().