yaml-cpp

Yaml Emitter in C++

Is there a C++ library for emitting YAML? Wikipedia mentions a c++ wrapper for libyaml, but the link is broken. The official YAML site only offers yaml-cpp, which was also suggested in this SO question, but cpp-yaml is only a parser, not an emitter. Am I out of luck? Edit: I'm looking for an object oriented interface, hence the C++ r...

Problem using yaml-cpp on OS X

So I'm having trouble compiling my application which is using yaml-cpp I'm including "yaml.h" in my source files (just like the examples in the yaml-cpp wiki) but when I try compiling the application I get the following error: g++ -c -o entityresourcemanager.o entityresourcemanager.cpp entityresourcemanager.cpp:2:18: error: yaml.h: ...

Error yaml-cpp compile in RAD Studio 2010

I can't compile yaml-cpp in RAD Studio 2010. I have error in nodeutil.h template <typename T, typename U> struct is_same_type { enum { value = false }; }; template <typename T> struct is_same_type<T, T> { enum { value = true }; }; template <typename T, bool check> struct is_index_type_with_check { enum { value = false }; }; template ...

invalid scalar hex value 0x8000000 and over

Hi. I found a problem getting hex value from yaml file. It couldn't get hex value 0x80000000 and over. Following is a sample C++ program. // ymlparser.cpp #include <iostream> #include <fstream> #include "yaml-cpp/yaml.h" int main(void) { try { std::ifstream fin("hex.yaml"); YAML::Parser parser(fin); YAML::Node doc; p...

Trying to parse OpenCV YAML ouput with yaml-cpp

I've got a series of OpenCv generated YAML files and would like to parse them with yaml-cpp I'm doing okay on simple stuff, but the matrix representation is proving difficult. # Center of table tableCenter: !!opencv-matrix rows: 1 cols: 2 dt: f data: [ 240, 240] This should map into the vector 240 240 with type floa...

yaml-cpp parsing strings

Am i missing some thing or isnt it possible to parse YAML formatted strings with yaml-cpp? at least there isnt a YAML::Parser::Parser(std::string&) constructor. i get a yaml-string via libcurl from a http-server. ...

Overloading stream insertion without violating information hiding?

I'm using yaml-cpp for a project. I want to overload the << and >> operators for some classes, but I'm having an issue grappling with how to "properly" do this. Take the Note class, for example. It's fairly boring: class Note { public: // constructors Note( void ); ~Note( void ); // public accessor methods void ...

Modifying documents in memory in yaml-cpp

I want to read a YML document, filter it by modifying some nodes in memory, and then spit it back out with an emitter. The problem is that YAML::Node appears to be designed to be read-only. Is there a way to replace a node's value (with a scalar in this case) that I'm missing? ...

Compiler error coming out of yaml-cpp

I'm attempting to integrate yaml-cpp into a project, but I'm seeing some unexpected errors out of GCC. For example: g++ -c -ggdb3 -ansi -Wall -Werror -pedantic-errors src/commands-tz.cpp -o obj/commands-tz.o In file included from /usr/local/include/yaml-cpp/conversion.h:9, from /usr/local/include/yaml-cpp/node.h:8, ...

Can't read nested maps (raises YAML::InvalidScalar)

I have a class (contains a few scalar values and a vector of floats) and I want to read and write an instance as the value of another map. // write out << YAML::Key << "my_queue" << YAML::Value << my_queue; // read (other code cut out...) for (YAML::Iterator it=doc.begin();it!=doc.end();++it) { std::string key, value; ...

Save a YAML Emitter content to a file with YAML-CPP

I just started playing around with yaml-cpp, I managed to build it properly and run some of the examples from the yaml-cpp wiki but I can't find a way to save my emitter to a file. Is this not possible? I mean the PyYAML library has a 'dump' function for this. Is there no such functionality in yaml-cpp? Is there some workaround to conve...

How to emit a blank line using yaml-cpp

Using yaml-cpp, version 0.2.5 ... I would like to emit a blank line between entries in a list (for readability purposes). Is this possible? I have tried experimentation with the Verbatim, and Null manipulators, but have not had success. ...

How-to emit and parse raw binary data using yaml-cpp

Is it possible to emit and read(parse) binary data(image, file etc)? Like this is shown here: http://yaml.org/type/binary.html How can I do this in yaml-cpp? ...