mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Implemented sugar Parse() functions
This commit is contained in:
@@ -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
|
||||
|
@@ -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);
|
||||
|
21
include/yaml-cpp/value/parse.h
Normal file
21
include/yaml-cpp/value/parse.h
Normal 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
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user