YamlHelper.cpp
Go to the documentation of this file.
00001 /*
00002  * YamlHelper.cpp
00003  *
00004  *  Created on: Nov 13, 2011
00005  *      Author: mriedel
00006  */
00007 
00008 
00009 #include <telekyb_base/Tools/YamlHelper.hpp>
00010 
00011 namespace TELEKYB_NAMESPACE
00012 {
00013 
00014 bool YamlHelper::parseNodeToString(const YAML::Node& node, std::string& output) {
00015         YAML::Emitter emit;
00016         emit.SetMapFormat(YAML::Flow); // also flow
00017         emit.SetSeqFormat(YAML::Flow); // Flow format.
00018         // should I catch something here?
00019         emit << node;
00020 
00021         output = emit.c_str();
00022         return true;
00023 }
00024 
00025 bool YamlHelper::parseStringToNode(const std::string& string, YAML::Node& node) {
00026         // catch something?
00027         node = YAML::Load(string);
00028         return true;
00029 }
00030 
00031 // Not needed anymore.
00032 //bool YamlHelper::getFirstNodeFromString(const std::string& input, YAML::Node& output)
00033 //{
00034 //
00035 //      return true;
00036 //}
00037 
00038 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Defines


telekyb_base
Author(s): Dr. Antonio Franchi and Martin Riedel
autogenerated on Mon Nov 11 2013 11:12:34