mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
@@ -81,7 +81,7 @@ class YAML_CPP_API node_data {
|
|||||||
shared_memory_holder pMemory);
|
shared_memory_holder pMemory);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static std::string empty_scalar;
|
static const std::string& empty_scalar();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void compute_seq_size() const;
|
void compute_seq_size() const;
|
||||||
|
@@ -156,13 +156,13 @@ inline T Node::as(const S& fallback) const {
|
|||||||
inline const std::string& Node::Scalar() const {
|
inline const std::string& Node::Scalar() const {
|
||||||
if (!m_isValid)
|
if (!m_isValid)
|
||||||
throw InvalidNode();
|
throw InvalidNode();
|
||||||
return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar;
|
return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const std::string& Node::Tag() const {
|
inline const std::string& Node::Tag() const {
|
||||||
if (!m_isValid)
|
if (!m_isValid)
|
||||||
throw InvalidNode();
|
throw InvalidNode();
|
||||||
return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar;
|
return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Node::SetTag(const std::string& tag) {
|
inline void Node::SetTag(const std::string& tag) {
|
||||||
|
@@ -13,7 +13,10 @@
|
|||||||
namespace YAML {
|
namespace YAML {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
std::string node_data::empty_scalar;
|
const std::string& node_data::empty_scalar() {
|
||||||
|
static const std::string svalue;
|
||||||
|
return svalue;
|
||||||
|
}
|
||||||
|
|
||||||
node_data::node_data()
|
node_data::node_data()
|
||||||
: m_isDefined(false),
|
: m_isDefined(false),
|
||||||
|
Reference in New Issue
Block a user