Added append()

This commit is contained in:
Jesse Beder
2011-09-09 02:51:35 -05:00
parent 4f8680b540
commit d3bbd08273
7 changed files with 37 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
#include "yaml-cpp/value/detail/memory.h"
#include "yaml-cpp/value/detail/node.h"
#include <sstream>
#include <stdexcept>
namespace YAML
{
@@ -57,6 +58,14 @@ namespace YAML
m_scalar = scalar;
}
void node_data::append(node& node, shared_memory_holder /* pMemory */)
{
if(m_type != ValueType::Sequence)
throw std::runtime_error("Can't append to a non-sequence node");
m_sequence.push_back(&node);
}
// indexing
node& node_data::get(node& key, shared_memory_holder pMemory) const
{