mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-10 13:01:18 +00:00
Added append()
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user