Added templated casting to nodes, as well as operator == and != (for quick checks, especially to help in testing). Implemented size() on a map node to return the number of key/value pairs (as in std::map)

This commit is contained in:
Jesse Beder
2009-09-06 15:54:11 +00:00
parent 729fb4d30b
commit 07443495c8
5 changed files with 79 additions and 24 deletions

View File

@@ -53,6 +53,11 @@ namespace YAML
return true;
}
std::size_t Map::GetSize() const
{
return m_data.size();
}
void Map::Parse(Scanner *pScanner, const ParserState& state)
{
Clear();

View File

@@ -26,6 +26,7 @@ namespace YAML
virtual bool GetBegin(std::map <Node *, Node *, ltnode>::const_iterator& it) const;
virtual bool GetEnd(std::map <Node *, Node *, ltnode>::const_iterator& it) const;
virtual std::size_t GetSize() const;
virtual void Parse(Scanner *pScanner, const ParserState& state);
virtual void Write(Emitter& out) const;