Merged aliases branch into trunk, changes r100:150

This commit is contained in:
jbeder
2009-05-22 21:48:05 +00:00
parent 7297387015
commit 5abf31b991
13 changed files with 308 additions and 18 deletions

View File

@@ -38,6 +38,8 @@ namespace YAML
const std::string CHAR_IN_ANCHOR = "illegal character found while scanning anchor";
const std::string ZERO_INDENT_IN_BLOCK = "cannot set zero indentation for a block scalar";
const std::string CHAR_IN_BLOCK = "unexpected character in block scalar";
const std::string AMBIGUOUS_ANCHOR = "cannot assign the same alias to multiple nodes";
const std::string UNKNOWN_ANCHOR = "the referenced anchor is not defined";
const std::string INVALID_SCALAR = "invalid scalar";
const std::string KEY_NOT_FOUND = "key not found";

View File

@@ -66,6 +66,11 @@ namespace YAML
const Node& operator [] (unsigned u) const;
const Node& operator [] (int i) const;
// for anchors/aliases
const Node *Identity() const { return m_pIdentity; }
bool IsAlias() const { return m_alias; }
bool IsReferenced() const { return m_referenced; }
// insertion
friend std::ostream& operator << (std::ostream& out, const Node& node);
@@ -89,6 +94,8 @@ namespace YAML
std::string m_anchor, m_tag;
Content *m_pContent;
bool m_alias;
const Node *m_pIdentity;
mutable bool m_referenced;
};
// templated things we need to keep inline in the header