header_utils
Loading...
Searching...
No Matches
ghassanpl::formats::wilson Namespace Reference

Typedefs

using wilson

Functions

auto parse (std::string_view wilson_str) -> expected< wilson, wilson_parsing_error >
 Parses any Wilson value.
auto parse_object (std::string_view wilson_str, char closing_char='}') -> expected< wilson, wilson_parsing_error >
 Parses a set of key-value pairs, until end of string or encountering the closing_char.
auto parse_array (std::string_view wilson_str, char closing_char=']') -> expected< wilson, wilson_parsing_error >
 Parses an array of Wilson values, until end of string or encountering the closing_char.
auto parse_word_or_string (std::string_view wilson_str) -> expected< wilson, wilson_parsing_error >
 Parses: a word as a string value or bool/null value; a "string literal" as a string value.
auto parse_string_value (std::string_view wilson_str) -> expected< std::string, wilson_parsing_error >
 Parses a word or a string literal a string value.
auto parse_string_literal (std::string_view wilson_str) -> expected< std::string, wilson_parsing_error >
 Parses a string literal as a string value.
auto consume_string_literal (std::string_view &_str)
 Consumes a string literal returning a string value.
auto consume_string_value (std::string_view &str)
 Consumes a word or a string literal returning a string value.
auto consume_word_or_string (std::string_view &str)
 Consumes: a word, returning a string/bool/null value; or a "string literal", returning a string value.
auto consume_object (std::string_view &wilson_str, char closing_char='}') -> expected< wilson, wilson_parsing_error >
auto consume_array (std::string_view &wilson_str, char closing_char=']') -> expected< wilson, wilson_parsing_error >
auto consume_value (std::string_view &wilson_str) -> expected< wilson, wilson_parsing_error >
template<typename OUTFUNC>
void output (OUTFUNC &&out, wilson const &value, output_parameters const &parameters={}, size_t indent=0)
 Outputs value formatted as a string using the out function which should take a string_view to append to the output.
void output_to_stream (std::ostream &strm, wilson const &value, output_parameters const &parameters={})
 Outputs value formatted as a string to the strm output stream.
std::string to_string (wilson const &value, output_parameters const &parameters={})
 Returns value formatted as a string.
expected< wilson, wilson_parsing_error > load_file (std::filesystem::path const &from)
 Loads a Wilson value from a file.
wilson try_load_file (std::filesystem::path const &from, wilson or_json=json::empty_json)
 Loads a Wilson value from a file, or returns or_json on failure.
void save_file (std::filesystem::path const &to, wilson const &j, output_parameters const &parameters={})
 Saves a Wilson value to a file formatted as a string.
void consume_whitespace (std::string_view &str)

Detailed Description

Typedef Documentation

◆ wilson

using ghassanpl::formats::wilson::wilson

Definition at line 19 of file wilson.h.

Function Documentation

◆ consume_whitespace()

void ghassanpl::formats::wilson::consume_whitespace ( std::string_view & str)
inline

Definition at line 135 of file wilson.h.