Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions source/src/basic/Emitter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ public:

~Emitter() override {}

Emitter( Emitter const & ) = delete;
Emitter & operator=( Emitter const & ) = delete;

/// @brief Flush the underlying output stream.
void flush() { out_.flush(); }

Expand Down Expand Up @@ -123,9 +126,6 @@ public:

protected:

Emitter(); // no null ctor
Emitter(Emitter const &); // no copy ctor

/// @brief Check that we're in the expected context (either map or list)
bool assert_in(bool in_map, std::string const & msg)
{
Expand Down Expand Up @@ -224,15 +224,13 @@ public:

~YamlEmitter() override {}

YamlEmitter( YamlEmitter const & ) = delete;
YamlEmitter & operator=( YamlEmitter const & ) = delete;

/// @brief Start a new YAML document, ending the previous one first if necessary
void start_doc() override
{ end(); out_ << "\n---\n"; start_raw(true, true); }

private:

YamlEmitter(); // no null ctor
YamlEmitter(YamlEmitter const &); // no copy ctor

protected:

/// @brief YAML only quotes strings when they contain special characters.
Expand Down Expand Up @@ -342,16 +340,14 @@ public:

~JsonEmitter() override {}

JsonEmitter( JsonEmitter const & ) = delete;
JsonEmitter & operator=( JsonEmitter const & ) = delete;

/// @brief JSON doesn't support multiple documents, so this just calls end(1)
/// to return you to the top (least-nested) level.
void start_doc() override
{ end(1); }

private:

JsonEmitter(); // no null ctor
JsonEmitter(JsonEmitter const &); // no copy ctor

protected:

/// @brief JSON always quotes strings, regardless.
Expand Down