jsonWriteInt

Adds an integer key-value pair to a JSON object. Takes json string, key string, and integer value. Returns modified json via ReturnString.

JSON

Parameters & Returns

Parameters

json String
key String
value Int

Returns

String

Quick Summary

Adds an integer key-value pair to a JSON object. Takes json string, key string, and integer value. Returns modified json via ReturnString.

Technical Exegesis...

Adds an integer key-value pair to a JSON object. Takes json string, key string, and integer value. Calls NeedsComma to check if comma needed (returns true if last non-whitespace char is not '{' or '['). If comma needed, appends ",". Appends "\"key\":value" format. Converts value to string with std::to_string. Returns modified json via ReturnString.

This function adds integer field to JSON object. NeedsComma helper prevents syntax errors by adding comma between fields. Format is JSON standard: "key":123.

Example

Example.bam
; No example implemented yet