|
const char * | tlws (const char *start) |
| (t)rims (l)eading (w)hite (s)pace More...
|
|
std::string | read_digits (const char *input) |
| Reads a set of digits from a string. More...
|
|
std::string | decode_string (const char *input) |
| Decodes a string in JSON format. More...
|
|
std::string | encode_string (const char *input) |
| Encodes a string in JSON format. More...
|
|
parse_results | parse (const char *input) |
| Parses the first value encountered in a JSON string. More...
|
|
template<typename T > |
T | get_number (const char *input, const char *format) |
| Template for reading a numeric value. More...
|
|
template<typename T > |
std::string | get_number_string (const T &number, const char *format) |
| Converts a number to a string. More...
|
|
std::vector< std::string > | parse_array (const char *input) |
| Parses a JSON array. More...
|
|
Namespace used for JSON parsing functions.
std::string json::parsing::decode_string |
( |
const char * |
input | ) |
|
Decodes a string in JSON format.
The quotation mark ("), reverse solidus (\), solidus (/), backspace (b), formfeed (f), linefeed (n), carriage return (r), horizontal tab (t), and Unicode character will be unescaped
@param input A string, encapsulated in quotations ("), potentially containing escaped control characters
- Returns
- A string with control characters un-escaped
- Note
- This function will strip leading and trailing quotations.
- See also
- encode_string
std::string json::parsing::encode_string |
( |
const char * |
input | ) |
|
Encodes a string in JSON format.
The quotation mark ("), reverse solidus (), solidus (/), backspace (b), formfeed (f), linefeed (n), carriage return (r), horizontal tab (t), and Unicode character will be escaped
- Parameters
-
input | A string potentially containing control characters |
- Returns
- A string that has all control characters escaped with a reverse solidus ()
- Note
- This function will add leading and trailing quotations.
- See also
- decode_string