Added tags to Node

This commit is contained in:
Jesse Beder
2011-09-13 14:00:47 -05:00
parent 2dfccbb945
commit 0987b234c3
7 changed files with 35 additions and 7 deletions

View File

@@ -73,14 +73,25 @@ namespace YAML
{
if(Type() != NodeType::Scalar)
throw std::runtime_error("Unable to convert to string, not a scalar");
return scalar();
return Scalar();
}
inline const std::string& Node::scalar() const
inline const std::string& Node::Scalar() const
{
return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar;
}
inline const std::string& Node::Tag() const
{
return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar;
}
inline void Node::SetTag(const std::string& tag)
{
EnsureNodeExists();
m_pNode->set_tag(tag);
}
// assignment
inline bool Node::is(const Node& rhs) const
{