319 questions
-1
votes
1
answer
104
views
Using yaml-cpp to parse YAML files with complex keys
Does lib-yaml support complex keys, for example:
thr:
- ? {cpu: 1, mem: 1} : 24
- ? {cpu: 2, mem: 2} : 42
The following test program
#include <yaml-cpp/yaml.h>
int main()
{
YAML::Node ...
0
votes
0
answers
52
views
find_package(yaml-cpp) on Visual Studio 2022
Porting a project from Mac. In CMakeLists.txt there is a call:
find_package(yaml-cpp REQUIRED)
But that doesn't work directly, with error:
C:<path>/repos/yaml-cpp/out/build/x64-Debug/yaml-cpp-...
0
votes
1
answer
64
views
Number string does not get quotes with yaml-cpp [duplicate]
This code:
...
YAML::Node myNode;
myNode["some-value"] = "3";
...
YAML::Emitter emitter;
emitter << myNode;
...
Produces the following output:
some-value: 3
This leads to ...
2
votes
1
answer
66
views
Seemingly unnecessary indexing when traversing yaml-cp nodes
I'm trying to use the following C++ program
#include <iostream>
#include <yaml-cpp/yaml.h>
int main() {
YAML::Node config = YAML::LoadFile("test.yaml");
YAML::Node ...
0
votes
0
answers
22
views
Problem with link stage while try use yaml-cpp "library" [duplicate]
Hi I am try create static library from yaml-cpp.
Windows x64 to use in my own project
I did next steps:
Clone repo prepare build dir and move to it
mkdir build
cd build
Configure Cmake in different ...
1
vote
1
answer
138
views
Yaml-cpp emits an doublequoted yaml string when emitted in an destructor
I‘m trying to serialize some data using yaml-cpp on destruction of an object. This normally works fine but as soon as that object is static something weird happens: Every string, also keys of maps, is ...
3
votes
0
answers
243
views
Why is yaml-cpp adding a thousands separator to numbers, and how do I prevent this?
This code:
std::cout << "std::cout for 2112 = " << 2112 << '\n';
std::stringstream ss;
ss << 2112;
std::cout << "std::stringstream for 2112 = " <&...
0
votes
1
answer
94
views
Question about protect global extern variable
I want to using this variable globally (C,C++)
config.h
extern YAML::Node m_configList
config.cpp
YAML::Node m_configList;
this is yaml-cpp variable.
this variable using 3 files
file1.cpp
file2.cpp
...
0
votes
1
answer
192
views
Traverse through nodes with a path and change a value in a YAML File using yaml-cpp
I am trying to load and alter a YAML file using yaml-cpp.
I have a string that determines a path thought a yaml, e.g. "node1/node2/node3", it gets split at '/' and then traverses through the ...
2
votes
1
answer
216
views
Problems using _GLIBCXX_DEBUG with yaml-cpp
I find it convenient to use the flag _GLIBCXX_DEBUG when compiling c++ with gcc in debug builds since they enable range checking for std::vector and the like. However, when I use yaml-cpp to parse ...
0
votes
0
answers
74
views
Attempt of a MWE of a yaml-cpp parser does not compile
I am using Ubuntu 20.04 with libyaml-cpp-dev (version 0.6.2-4ubuntu1).
I try to compile this simple example
#include <iostream>
#include <yaml-cpp/yaml.h>
int main() {
try {
//...
1
vote
1
answer
523
views
How to use yaml-cpp without exceptions support?
Is it possible to use yaml-cpp without exception support?
Currently, I use yaml-cpp-0.8.0. When I try to compile a program that uses yaml-cpp I get the following error:
external/yaml-cpp~override/src/...
-3
votes
1
answer
89
views
YAML Emitter multiline lines [closed]
How do i write multiline yaml file, that looks like this:
I am using c++ library yaml-cpp.
Here is a peek to my code:
YAML::Emitter out; out << YAML::BeginMap; out << YAML::Key << &...
2
votes
1
answer
473
views
Parsing YAML containing multiple documents
I have YAML file (Unity YAML) which contains multiple documents:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &500710038956159860
GameObject:
m_ObjectHideFlags: 0
...
0
votes
0
answers
360
views
How to read YAML / use "yaml-cpp" with C++Builder?
I am using Embarcadero C++Builder v10.4 with a C++ VCL application.
I need to read YAML, and the most referenced API is "yaml-cpp".
What I am asking for is help or guidance on what I have to ...