Implemented sugar Parse() functions

This commit is contained in:
beder
2011-09-09 23:40:19 -05:00
parent 8185fa48f1
commit b8e9b52af7
8 changed files with 67 additions and 20 deletions

View File

@@ -11,5 +11,6 @@
#include "yaml-cpp/value/convert.h"
#include "yaml-cpp/value/iterator.h"
#include "yaml-cpp/value/detail/impl.h"
#include "yaml-cpp/value/parse.h"
#endif // VALUE_H_62B23520_7C8E_11DE_8A39_0800200C9A66

View File

@@ -112,13 +112,13 @@ namespace YAML
return *this;
}
void Value::AssignData(const Value& rhs)
inline void Value::AssignData(const Value& rhs)
{
m_pNode->set_data(*rhs.m_pNode);
m_pMemory->merge(*rhs.m_pMemory);
}
void Value::AssignNode(const Value& rhs)
inline void Value::AssignNode(const Value& rhs)
{
m_pNode->set_ref(*rhs.m_pNode);
m_pMemory->merge(*rhs.m_pMemory);

View File

@@ -0,0 +1,21 @@
#ifndef VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
#define VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
#if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
#pragma once
#endif
#include <string>
#include <iosfwd>
namespace YAML
{
class Value;
Value Parse(const std::string& input);
Value Parse(const char *input);
Value Parse(std::istream& input);
}
#endif // VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66

View File

@@ -17,6 +17,7 @@ namespace YAML
class Value
{
public:
friend class ValueBuilder;
friend class detail::node_data;
template<typename, typename, typename> friend class detail::iterator_base;