mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Fixed node iterator
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "valueevents.h"
|
||||
#include "yaml-cpp/value.h"
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
@@ -7,7 +8,7 @@ namespace YAML
|
||||
Visit(m_root);
|
||||
}
|
||||
|
||||
void Visit(detail::node& node)
|
||||
void ValueEvents::Visit(const detail::node& node)
|
||||
{
|
||||
int& refCount = m_refCount[node.ref()];
|
||||
refCount++;
|
||||
@@ -15,8 +16,13 @@ namespace YAML
|
||||
return;
|
||||
|
||||
if(node.type() == ValueType::Sequence) {
|
||||
|
||||
for(detail::const_node_iterator it=node.begin();it!=node.end();++it)
|
||||
Visit(**it);
|
||||
} else if(node.type() == ValueType::Map) {
|
||||
for(detail::const_node_iterator it=node.begin();it!=node.end();++it) {
|
||||
Visit(*it->first);
|
||||
Visit(*it->second);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "yaml-cpp/anchor.h"
|
||||
#include "yaml-cpp/value/ptr.h"
|
||||
#include <multiset>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace YAML
|
||||
@@ -20,7 +20,7 @@ namespace YAML
|
||||
ValueEvents(const Value& value);
|
||||
|
||||
private:
|
||||
void Visit(detail::node& node);
|
||||
void Visit(const detail::node& node);
|
||||
|
||||
private:
|
||||
detail::shared_memory_holder m_pMemory;
|
||||
|
Reference in New Issue
Block a user