[refac] deprecate emit() and emitrs(), use emit_yaml() and emitrs_yaml()

re #120
This commit is contained in:
Joao Paulo Magalhaes
2022-09-08 11:37:10 +01:00
parent d6147a0e58
commit 8654e321ba
26 changed files with 280 additions and 203 deletions

View File

@@ -587,16 +587,16 @@ CHECK(!constsomething.valid());
// Emitting:
// emit to a FILE*
ryml::emit(tree, stdout);
ryml::emit_yaml(tree, stdout); // there is also emit_json()
// emit to a stream
std::stringstream ss;
ss << tree;
std::string stream_result = ss.str();
// emit to a buffer:
std::string str_result = ryml::emitrs<std::string>(tree);
std::string str_result = ryml::emitrs_yaml<std::string>(tree); // there is also emitrs_json()
// can emit to any given buffer:
char buf[1024];
ryml::csubstr buf_result = ryml::emit(tree, buf);
ryml::csubstr buf_result = ryml::emit_yaml(tree, buf);
// now check
ryml::csubstr expected_result = R"(foo: says who
bar: