Added emitting for a YAML::Node (instead of the ad-hoc std::ostream overload) so it'll actually emit valid YAML always

This commit is contained in:
Jesse Beder
2009-07-10 23:39:14 +00:00
parent 6c8600ab52
commit 3e0179fd6e
13 changed files with 136 additions and 202 deletions

View File

@@ -1,7 +1,6 @@
#pragma once
#include <string>
#include <ios>
#include <vector>
#include <map>
#include "parserstate.h"
@@ -13,6 +12,7 @@ namespace YAML
{
class Content;
class Scanner;
class Emitter;
enum CONTENT_TYPE { CT_NONE, CT_SCALAR, CT_SEQUENCE, CT_MAP };
@@ -24,7 +24,6 @@ namespace YAML
void Clear();
void Parse(Scanner *pScanner, const ParserState& state);
void Write(std::ostream& out, int indent, bool startedLine, bool onlyOneCharOnLine) const;
CONTENT_TYPE GetType() const;
@@ -65,8 +64,8 @@ namespace YAML
bool IsAlias() const { return m_alias; }
bool IsReferenced() const { return m_referenced; }
// insertion
friend std::ostream& operator << (std::ostream& out, const Node& node);
// emitting
friend Emitter& operator << (Emitter& out, const Node& node);
// ordering
int Compare(const Node& rhs) const;