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

TODO: https://dev.stenway.com/SML/Examples.html. More...

Functions

auto parse (std::string_view wilson_str) -> nlohmann::json
 
auto parse_object (std::string_view wilson_str, char closing_char='}') -> nlohmann::json
 
auto parse_array (std::string_view wilson_str) -> nlohmann::json
 
auto parse_word_or_string (std::string_view wilson_str) -> nlohmann::json
 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) -> std::string
 Parses a word or a string literal a string value.
 
auto parse_string_literal (std::string_view wilson_str) -> std::string
 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='}') -> nlohmann::json
 
auto consume_array (std::string_view &wilson_str, char closing_char=']') -> nlohmann::json
 
auto consume_value (std::string_view &wilson_str) -> nlohmann::json
 
template<typename OUTFUNC >
void output (OUTFUNC &&out, nlohmann::json const &value)
 
void output_to_stream (std::ostream &strm, nlohmann::json const &value)
 
std::string to_string (nlohmann::json const &value)
 
nlohmann::json load_file (std::filesystem::path const &from, std::error_code &ec)
 
nlohmann::json try_load_file (std::filesystem::path const &from, nlohmann::json const &or_json=json::empty_json)
 

Detailed Description

TODO: https://dev.stenway.com/SML/Examples.html.

Function Documentation

◆ consume_array()

nlohmann::json ghassanpl::formats::wilson::consume_array ( std::string_view &  wilson_str,
char  closing_char = ']' 
) -> nlohmann::json
inline

Definition at line 49 of file wilson.h.

◆ consume_object()

nlohmann::json ghassanpl::formats::wilson::consume_object ( std::string_view &  wilson_str,
char  closing_char = '}' 
) -> nlohmann::json
inline

Definition at line 113 of file wilson.h.

◆ consume_string_literal()

std::string ghassanpl::formats::wilson::consume_string_literal ( std::string_view &  _str) -> std::string
inline

Consumes a string literal returning a string value.

Definition at line 70 of file wilson.h.

◆ consume_string_value()

std::string ghassanpl::formats::wilson::consume_string_value ( std::string_view &  str) -> std::string
inline

Consumes a word or a string literal returning a string value.

Definition at line 81 of file wilson.h.

◆ consume_value()

nlohmann::json ghassanpl::formats::wilson::consume_value ( std::string_view &  wilson_str) -> nlohmann::json
inline

Definition at line 156 of file wilson.h.

◆ consume_word_or_string()

nlohmann::json ghassanpl::formats::wilson::consume_word_or_string ( std::string_view &  str) -> nlohmann::json
inline

Consumes: a word, returning a string/bool/null value; or a "string literal", returning a string value.

Definition at line 94 of file wilson.h.

◆ load_file()

nlohmann::json ghassanpl::formats::wilson::load_file ( std::filesystem::path const from,
std::error_code &  ec 
)
inline

Definition at line 306 of file wilson.h.

◆ output()

template<typename OUTFUNC >
void ghassanpl::formats::wilson::output ( OUTFUNC &&  out,
nlohmann::json const value 
)

Definition at line 255 of file wilson.h.

◆ output_to_stream()

void ghassanpl::formats::wilson::output_to_stream ( std::ostream &  strm,
nlohmann::json const value 
)
inline

Definition at line 36 of file wilson.h.

◆ parse()

auto ghassanpl::formats::wilson::parse ( std::string_view  wilson_str) -> nlohmann::json
inline

Definition at line 184 of file wilson.h.

◆ parse_array()

auto ghassanpl::formats::wilson::parse_array ( std::string_view  wilson_str) -> nlohmann::json
inline

Definition at line 195 of file wilson.h.

◆ parse_object()

auto ghassanpl::formats::wilson::parse_object ( std::string_view  wilson_str,
char  closing_char = '}' 
) -> nlohmann::json
inline

Definition at line 190 of file wilson.h.

◆ parse_string_literal()

auto ghassanpl::formats::wilson::parse_string_literal ( std::string_view  wilson_str) -> std::string
inline

Parses a string literal as a string value.

Definition at line 210 of file wilson.h.

◆ parse_string_value()

auto ghassanpl::formats::wilson::parse_string_value ( std::string_view  wilson_str) -> std::string
inline

Parses a word or a string literal a string value.

Definition at line 205 of file wilson.h.

◆ parse_word_or_string()

auto ghassanpl::formats::wilson::parse_word_or_string ( std::string_view  wilson_str) -> nlohmann::json
inline

Parses: a word as a string value or bool/null value; a "string literal" as a string value.

Definition at line 200 of file wilson.h.

◆ to_string()

std::string ghassanpl::formats::wilson::to_string ( nlohmann::json const value)
inline

Definition at line 299 of file wilson.h.

◆ try_load_file()

nlohmann::json ghassanpl::formats::wilson::try_load_file ( std::filesystem::path const from,
nlohmann::json const or_json = json::empty_json 
)
inline

Definition at line 312 of file wilson.h.