Added IsNull, IsScalar, IsSequence, IsMap functions, so you don't have to query Type()

This commit is contained in:
beder
2011-09-13 14:10:27 -05:00
parent d2a10e3d53
commit c314860e00
3 changed files with 34 additions and 30 deletions

View File

@@ -29,6 +29,10 @@ namespace YAML
~Node();
NodeType::value Type() const;
bool IsNull() const { return Type() == NodeType::Null; }
bool IsScalar() const { return Type() == NodeType::Scalar; }
bool IsSequence() const { return Type() == NodeType::Sequence; }
bool IsMap() const { return Type() == NodeType::Map; }
// access
template<typename T> const T as() const;