#include <json_format.hpp>
The json_format class defines parameters how the json is formatted when it is written as a string.
◆ json_format() [1/4]
matador::json_format::json_format |
( |
| ) |
|
|
default |
◆ json_format() [2/4]
matador::json_format::json_format |
( |
bool |
enable_line_break | ) |
|
|
explicit |
Creates a json format with enables line break if the given parameter is set to true
- Parameters
-
enable_line_break | If true json string json has line breaks |
◆ json_format() [3/4]
matador::json_format::json_format |
( |
unsigned |
indentation | ) |
|
|
explicit |
Creates a json format with given number of indentation spaces
- Parameters
-
indentation | Number of indentation spaces |
◆ json_format() [4/4]
matador::json_format::json_format |
( |
bool |
enable_line_break, |
|
|
bool |
skip_empty, |
|
|
unsigned |
indentation |
|
) |
| |
Creates a json format object with flags for enabling line breaks and skip empty json values. Furthermore the number of indentation spaces is defined.
- Parameters
-
enable_line_break | If true json string json has line breaks |
skip_empty | If true empty json values are skipped |
indentation | Number of indentation spaces |
◆ indentation()
unsigned matador::json_format::indentation |
( |
| ) |
const |
Return the number of indentation spaces.
- Returns
- Return the number of indentation spaces
◆ indentation_char()
char matador::json_format::indentation_char |
( |
| ) |
const |
Returns the indentation character.
- Returns
- Returns the indentation character
◆ show_line_break()
bool matador::json_format::show_line_break |
( |
| ) |
const |
True if line breaks are enabled.
- Returns
- True if line breaks are enabled
◆ skip_empty()
bool matador::json_format::skip_empty |
( |
| ) |
|
True if empty json should be skipped.
- Returns
- True if empty json should be skipped
◆ compact
A default json format object for compact json formatting. Without spaces, linebreaks and indentation.
◆ pretty
A default json format object resulting in a pretty readable json string.
The documentation for this class was generated from the following file:
- matador/json/json_format.hpp