DoxigAlpha

objectFieldRaw

See Stringify for when to call this method. quoted_key is the complete bytes of the key including quotes and any necessary escape sequences. A few assertions are performed on the given value to ensure that the caller of this function understands the API contract. See also objectField.

Function parameters

Parameters

#
self:*Stringify
quoted_key:[]const u8

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#
print
An alternative to calling `write` that formats a value with `std.fmt`.
beginWriteRaw
An alternative to calling `write` that allows you to write directly to the `.writer` field, e.g.
endWriteRaw
See `beginWriteRaw`.
objectField
See `Stringify` for when to call this method.
objectFieldRaw
See `Stringify` for when to call this method.
beginObjectFieldRaw
In the rare case that you need to write very long object field names,
endObjectFieldRaw
See `beginObjectFieldRaw`.
write
Renders the given Zig value as JSON.
value
Writes the given value to the `Writer` writer.
valueAlloc
Calls `value` and stores the result in dynamically allocated memory instead
encodeJsonString
Write `string` to `writer` as a JSON encoded string.
encodeJsonStringChars
Write `chars` to `writer` as JSON encoded string characters.

Error sets in this namespace

Error Sets

#

Source

Implementation

#
pub fn objectFieldRaw(self: *Stringify, quoted_key: []const u8) Error!void {
    if (build_mode_has_safety) assert(self.raw_streaming_mode == .none);
    assert(quoted_key.len >= 2 and quoted_key[0] == '"' and quoted_key[quoted_key.len - 1] == '"'); // quoted_key should be "quoted".
    try self.objectFieldStart();
    try self.writer.writeAll(quoted_key);
    self.next_punctuation = .colon;
}