|
Rosetta
|
Emitter for more classically formatted YAML. More...
#include <Emitter.hh>

Public Member Functions | |
| YamlEmitter (std::ostream &out) | |
| ~YamlEmitter () override | |
| void | start_doc () override |
| Start a new YAML document, ending the previous one first if necessary. More... | |
Public Member Functions inherited from basic::Emitter | |
| Emitter (std::ostream &out) | |
| ~Emitter () override | |
| void | flush () |
| Flush the underlying output stream. More... | |
| template<typename T > | |
| void | write (T const &data) |
| Write method for use inside lists / arrays. More... | |
| void | start_list (bool indent=true) |
| Write method for use inside lists / arrays. More... | |
| void | start_map (bool indent=true) |
| Write method for use inside lists / arrays. More... | |
| template<typename T > | |
| void | write (std::string const &label, T const &data) |
| Write method for use inside maps / dicts / objects. More... | |
| void | start_list (std::string const &label, bool indent=true) |
| Write method for use inside maps / dicts / objects. More... | |
| void | start_list (const char *label, bool indent=true) |
| Write method for use inside maps / dicts / objects. More... | |
| void | start_map (std::string const &label, bool indent=true) |
| Write method for use inside maps / dicts / objects. More... | |
| void | start_map (const char *label, bool indent=true) |
| Write method for use inside maps / dicts / objects. More... | |
| void | end_list () |
| Counterpart to start_list() – writes closing bracket. More... | |
| void | end_map () |
| Counterpart to start_map() – writes closing brace. More... | |
| void | end (size_t desired_depth=0) |
| By default, closes all open maps/lists, ending the document. More... | |
| int | depth () const |
| Number of closing brackets/braces required to end document (non-negative) More... | |
| void | set_indent (int num_spaces) |
| Number of spaces used for indenting. Default is one. More... | |
Public Member Functions inherited from utility::VirtualBase | |
| VirtualBase ()=default | |
| Default constructor. More... | |
| virtual | ~VirtualBase ()=default |
| The virtual destructor is one of the main reasons for the VirtualBase class. More... | |
| VirtualBase (VirtualBase const &)=default | |
| VirtualBase (VirtualBase &&)=default | |
| VirtualBase & | operator= (VirtualBase const &)=default |
| VirtualBase & | operator= (VirtualBase &&)=default |
Protected Member Functions | |
| std::string | quote_string (std::string const &s) override |
| YAML only quotes strings when they contain special characters. More... | |
| void | do_indent (bool write_comma=true) override |
| Handle pretty-printing indentation. Don't want to use commas for opening/closing brace/bracket. More... | |
| void | write_list_marker () override |
| YAML uses "-" for list items when in block (indented) mode. More... | |
| void | start_raw (bool is_map, bool indent) override |
| void | end_raw () override |
Protected Member Functions inherited from basic::Emitter | |
| Emitter () | |
| Emitter (Emitter const &) | |
| bool | assert_in (bool in_map, std::string const &msg) |
| Check that we're in the expected context (either map or list) More... | |
| void | write_label (std::string const &label) |
| Write the key part of a key-value pair. More... | |
| void | write_raw (bool b) |
| void | write_raw (int i) |
| void | write_raw (long l) |
| void | write_raw (float f) |
| void | write_raw (double d) |
| void | write_raw (std::string const &s) |
| std::string | escape_string (std::string const &s, bool &needs_quotes_out) |
| Converts special characters (newlines, etc) to escape codes ( , etc). More... | |
Private Member Functions | |
| YamlEmitter () | |
| YamlEmitter (YamlEmitter const &) | |
Additional Inherited Members | |
Protected Attributes inherited from basic::Emitter | |
| std::ostream & | out_ |
| std::string | indent_str_ |
| std::vector< bool > | in_map_ |
| std::vector< bool > | first_ |
| std::vector< bool > | indent_ |
| std::vector< int > | indent_depth_ |
Emitter for more classically formatted YAML.
|
inline |
References start_raw().
|
inlineoverride |
|
private |
|
private |
|
inlineoverrideprotectedvirtual |
Handle pretty-printing indentation. Don't want to use commas for opening/closing brace/bracket.
Implements basic::Emitter.
References basic::Emitter::depth(), create_a3b_hbs::first, basic::Emitter::first_, create_a3b_hbs::i, binder::indent(), basic::Emitter::indent_, basic::Emitter::indent_depth_, basic::Emitter::indent_str_, and basic::Emitter::out_.
|
inlineoverrideprotectedvirtual |
YAML only uses brackets and braces if data is not being indented.
Implements basic::Emitter.
References basic::Emitter::first_, basic::Emitter::in_map_, binder::indent(), basic::Emitter::indent_, basic::Emitter::indent_depth_, and basic::Emitter::out_.
|
inlineoverrideprotectedvirtual |
YAML only quotes strings when they contain special characters.
Implements basic::Emitter.
References basic::Emitter::escape_string(), docking::s, and predPRE::t.
|
inlineoverridevirtual |
Start a new YAML document, ending the previous one first if necessary.
Implements basic::Emitter.
References basic::Emitter::end(), basic::Emitter::out_, and start_raw().
|
inlineoverrideprotectedvirtual |
YAML only uses brackets and braces if data is not being indented.
Implements basic::Emitter.
References basic::Emitter::first_, basic::Emitter::in_map_, binder::indent(), basic::Emitter::indent_, basic::Emitter::indent_depth_, and basic::Emitter::out_.
Referenced by start_doc(), and YamlEmitter().
|
inlineoverrideprotectedvirtual |
YAML uses "-" for list items when in block (indented) mode.
Implements basic::Emitter.
References binder::indent(), basic::Emitter::indent_, and basic::Emitter::out_.