simdjson 5.0.2
Ridiculously Fast JSON
Loading...
Searching...
No Matches
simdjson::fractured_json_options Struct Reference

Configuration options for FracturedJson formatting. More...

#include <fractured_json.h>

Public Attributes

size_t max_total_line_length = 120
 Maximum total characters per line (default: 120).
 
size_t max_inline_complexity = 2
 Maximum nesting depth for inline rendering (default: 2).
 
size_t max_compact_array_complexity = 2
 Maximum complexity for compact array formatting (default: 2).
 
size_t indent_spaces = 4
 Number of spaces per indentation level (default: 4).
 
int always_expand_depth = -1
 Forces elements close to the root to always fully expand, regardless of other settings.
 
bool enable_table_format = true
 Enable tabular formatting for arrays of similar objects or arrays (default: true).
 
size_t max_table_row_complexity = 2
 Maximum complexity of each row of a table (default: 2).
 
bool enable_compact_multiline = true
 Enable compact multiline arrays (default: true).
 
size_t min_compact_array_row_items = 3
 Minimum number of items per line for an array to be formatted as a compact multiline array (default: 3).
 
bool simple_bracket_padding = false
 Add space inside brackets for containers that hold only scalar values (default: false).
 
bool nested_bracket_padding = true
 Add space inside brackets for containers that hold at least one nested array/object (default: true).
 
bool colon_padding = true
 Add space after colons (default: true).
 
bool comma_padding = true
 Add space after commas in inline content (default: true).
 
table_comma_placement comma_placement = table_comma_placement::before_padding_except_numbers
 Placement of commas relative to column padding in table-formatted rows and compact multiline arrays (default: before_padding_except_numbers).
 
number_list_alignment number_alignment = number_list_alignment::left
 Controls alignment of numbers in table columns or compact multiline arrays (default: left).
 

Detailed Description

Configuration options for FracturedJson formatting.

FracturedJson intelligently chooses between different layout strategies (inline, compact multiline, table, expanded) based on content complexity, length, and structure similarity.

Definition at line 34 of file fractured_json.h.

Member Data Documentation

◆ always_expand_depth

int simdjson::fractured_json_options::always_expand_depth = -1

Forces elements close to the root to always fully expand, regardless of other settings.

(default: -1). -1 = none; 0 = root node only; 1 = root node and its children; etc.

Definition at line 64 of file fractured_json.h.

◆ colon_padding

bool simdjson::fractured_json_options::colon_padding = true

Add space after colons (default: true).

When true: "key": "value" When false: "key":"value"

Definition at line 116 of file fractured_json.h.

◆ comma_padding

bool simdjson::fractured_json_options::comma_padding = true

Add space after commas in inline content (default: true).

When true: [1, 2, 3] When false: [1,2,3]

Definition at line 123 of file fractured_json.h.

◆ comma_placement

table_comma_placement simdjson::fractured_json_options::comma_placement = table_comma_placement::before_padding_except_numbers

Placement of commas relative to column padding in table-formatted rows and compact multiline arrays (default: before_padding_except_numbers).

Definition at line 129 of file fractured_json.h.

◆ enable_compact_multiline

bool simdjson::fractured_json_options::enable_compact_multiline = true

Enable compact multiline arrays (default: true).

When enabled, arrays of simple elements may have multiple items per line.

Definition at line 87 of file fractured_json.h.

◆ enable_table_format

bool simdjson::fractured_json_options::enable_table_format = true

Enable tabular formatting for arrays of similar objects or arrays (default: true).

When enabled, the rows of such an array are written one per line with their columns aligned. Rows need not have identical keys: columns are ordered by the first occurrence of each key, and a row missing a key gets blank space in that column.

Definition at line 73 of file fractured_json.h.

◆ indent_spaces

size_t simdjson::fractured_json_options::indent_spaces = 4

Number of spaces per indentation level (default: 4).

Definition at line 58 of file fractured_json.h.

◆ max_compact_array_complexity

size_t simdjson::fractured_json_options::max_compact_array_complexity = 2

Maximum complexity for compact array formatting (default: 2).

Arrays with elements of this complexity or less may have multiple items per line.

Definition at line 53 of file fractured_json.h.

◆ max_inline_complexity

size_t simdjson::fractured_json_options::max_inline_complexity = 2

Maximum nesting depth for inline rendering (default: 2).

Elements with complexity exceeding this will be expanded. Complexity 0 = scalar, 1 = flat array/object, 2 = one level of nesting.

Definition at line 46 of file fractured_json.h.

◆ max_table_row_complexity

size_t simdjson::fractured_json_options::max_table_row_complexity = 2

Maximum complexity of each row of a table (default: 2).

0 = rows may only be scalars (a single column); 1 = rows may be flat arrays/objects; higher values allow deeper nesting.

Definition at line 80 of file fractured_json.h.

◆ max_total_line_length

size_t simdjson::fractured_json_options::max_total_line_length = 120

Maximum total characters per line (default: 120).

Content exceeding this will be expanded to multiple lines.

Definition at line 39 of file fractured_json.h.

◆ min_compact_array_row_items

size_t simdjson::fractured_json_options::min_compact_array_row_items = 3

Minimum number of items per line for an array to be formatted as a compact multiline array (default: 3).

Definition at line 93 of file fractured_json.h.

◆ nested_bracket_padding

bool simdjson::fractured_json_options::nested_bracket_padding = true

Add space inside brackets for containers that hold at least one nested array/object (default: true).

When true: { "a": [1, 2] }. When false: {"a": [1, 2]}.

See also
simple_bracket_padding

Definition at line 109 of file fractured_json.h.

◆ number_alignment

number_list_alignment simdjson::fractured_json_options::number_alignment = number_list_alignment::left

Controls alignment of numbers in table columns or compact multiline arrays (default: left).

Numbers are always written exactly as in the input.

Definition at line 135 of file fractured_json.h.

◆ simple_bracket_padding

bool simdjson::fractured_json_options::simple_bracket_padding = false

Add space inside brackets for containers that hold only scalar values (default: false).

When true: { "key": "value" }. When false: {"key": "value"}.

See also
nested_bracket_padding

Definition at line 101 of file fractured_json.h.


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