From 4e6418ff1239064c9d2d0acd84cf08fbc7434388 Mon Sep 17 00:00:00 2001 From: beder Date: Tue, 13 Sep 2011 14:49:00 -0500 Subject: [PATCH] Added Dump() --- include/yaml-cpp/node/emit.h | 2 ++ src/node/emit.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/yaml-cpp/node/emit.h b/include/yaml-cpp/node/emit.h index b1cb5d2..7abf80b 100644 --- a/include/yaml-cpp/node/emit.h +++ b/include/yaml-cpp/node/emit.h @@ -15,6 +15,8 @@ namespace YAML Emitter& operator << (Emitter& out, const Node& node); std::ostream& operator << (std::ostream& out, const Node& node); + + std::string Dump(const Node& node); } #endif // NODE_EMIT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/node/emit.cpp b/src/node/emit.cpp index 8b6614b..5b1145c 100644 --- a/src/node/emit.cpp +++ b/src/node/emit.cpp @@ -20,4 +20,11 @@ namespace YAML out << emitter.c_str(); return out; } + + std::string Dump(const Node& node) + { + Emitter emitter; + emitter << node; + return emitter.c_str(); + } }