Added an iterator class that can iterate through both sequence and map nodes.

This commit is contained in:
Jesse Beder 2008-07-02 01:22:39 +00:00
parent f7358701f2
commit d56b54b34f
16 changed files with 393 additions and 105 deletions

View file

@ -41,8 +41,17 @@ namespace YAML
pScanner->EatNextToken();
}
const Node& Document::GetRoot() const
{
if(!m_pRoot)
throw;
return *m_pRoot;
}
std::ostream& operator << (std::ostream& out, const Document& doc)
{
out << "---\n";
if(!doc.m_pRoot) {
out << "{empty node}\n";
return out;