Copied all files from new-api branch of old repo

This commit is contained in:
Jesse Beder
2012-05-19 15:34:02 -05:00
parent c8a539f4f4
commit c22512649e
38 changed files with 4333 additions and 27 deletions

29
src/memory.cpp Normal file
View File

@@ -0,0 +1,29 @@
#include "yaml-cpp/node/detail/memory.h"
#include "yaml-cpp/node/detail/node.h"
namespace YAML
{
namespace detail
{
void memory_holder::merge(memory_holder& rhs)
{
if(m_pMemory == rhs.m_pMemory)
return;
m_pMemory->merge(*rhs.m_pMemory);
rhs.m_pMemory = m_pMemory;
}
node& memory::create_node()
{
shared_node pNode(new node);
m_nodes.insert(pNode);
return *pNode;
}
void memory::merge(const memory& rhs)
{
m_nodes.insert(rhs.m_nodes.begin(), rhs.m_nodes.end());
}
}
}