libdonut  2.3.2
Application framework for cross-platform game development in C++20
Public Attributes | List of all members
donut::json::SerializationOptions Struct Reference

Options for JSON serialization. More...

#include <donut/json.hpp>

Public Attributes

std::size_t indentation = 0
 The starting indentation level, expressed as the number of indentation characters. More...
 
std::size_t relativeIndentation = 4
 The number of indentation characters that each new level of indentation will add. More...
 
char indentationCharacter = ' '
 The character to use when performing indentation. More...
 
bool prettyPrint = true
 Format the output in a way that is nicely human-readable. More...
 
std::size_t prettyPrintMaxSingleLineObjectPropertyCount = 4
 Maximum size of an object before it is split into multiple lines when pretty printing. More...
 
std::size_t prettyPrintMaxSingleLineArrayItemCount = 4
 Maximum size of an array before it is split into multiple lines when pretty printing. More...
 
const char * newlineString = "\r\n"
 Non-owning pointer to a null-terminated ASCII string representing the newline sequence to use when performing line breaks. More...
 

Detailed Description

Options for JSON serialization.

Member Data Documentation

◆ indentation

std::size_t donut::json::SerializationOptions::indentation = 0

The starting indentation level, expressed as the number of indentation characters.

◆ relativeIndentation

std::size_t donut::json::SerializationOptions::relativeIndentation = 4

The number of indentation characters that each new level of indentation will add.

◆ indentationCharacter

char donut::json::SerializationOptions::indentationCharacter = ' '

The character to use when performing indentation.

◆ prettyPrint

bool donut::json::SerializationOptions::prettyPrint = true

Format the output in a way that is nicely human-readable.

Disable to use a more compact layout without whitespace or indentation.

See also
prettyPrintMaxSingleLineObjectPropertyCount
prettyPrintMaxSingleLineArrayItemCount

◆ prettyPrintMaxSingleLineObjectPropertyCount

std::size_t donut::json::SerializationOptions::prettyPrintMaxSingleLineObjectPropertyCount = 4

Maximum size of an object before it is split into multiple lines when pretty printing.

When set to a positive value, objects at or below this size will be written in a single line. Set to 0 to always split non-empty objects into multiple lines regardless of size.

Note
This option only applies when prettyPrint is true.
See also
prettyPrint

◆ prettyPrintMaxSingleLineArrayItemCount

std::size_t donut::json::SerializationOptions::prettyPrintMaxSingleLineArrayItemCount = 4

Maximum size of an array before it is split into multiple lines when pretty printing.

When set to a positive value, arrays at or below this size will be written in a single line. Set to 0 to always split non-empty arrays into multiple lines regardless of size.

Note
This option only applies when prettyPrint is true.
See also
prettyPrint

◆ newlineString

const char* donut::json::SerializationOptions::newlineString = "\r\n"

Non-owning pointer to a null-terminated ASCII string representing the newline sequence to use when performing line breaks.

Defaults to CRLF (carriage return followed by line feed).

Warning
Must not be set to nullptr.

The documentation for this struct was generated from the following file: