319 questions
-1
votes
1
answer
109
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
1
answer
66
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 ...
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 ...
3
votes
0
answers
248
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
197
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 ...
0
votes
0
answers
75
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 {
//...
-3
votes
1
answer
90
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 << &...
0
votes
0
answers
362
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 ...
1
vote
1
answer
536
views
In yaml-cpp, can the node tags be used to store custom data?
I'm thinking of assigning my own unique id string to each YAML::Node via the SetTag() function. Is this possible, or is yaml-cpp referencing these tags internally, and it'll get confused?
Also, is ...
0
votes
1
answer
944
views
Linking problems with yaml-cpp
I am trying to incorporate yaml-cpp into my project.
I have a "Demes" class where I need to parse a YAML file.
This is the relevant method in Demes.cpp:
#include "Demes.hpp"
void ...
0
votes
1
answer
929
views
Can not link yaml-cpp with my cmake project
My CMakeLists.txt
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(test_includes)
#find_package(Boost COMPONENTS system filesystem REQUIRED)
#include_directories( ${Boost_INCLUDE_DIRS} )
set(...
2
votes
1
answer
695
views
How to manually override the automatic quotation of strings
I am writing to a YAML file with jbeders/yaml-cpp and I am writing IP addresses to a file. When I write the wildcard IP "*" to the file, it automatically gets quoted (since '*' is a special ...
0
votes
0
answers
271
views
Output a YAML::Node
How can I convert a YAML::Node into a stream/string for saving to a file? For example (taken from the tutorial):
YAML::Node node; // starts out as null
node["key"] = "value"; // ...
0
votes
0
answers
1k
views
Troubles linking yaml-cpp staticly
I got yaml-cpp library and I made a project out of it inside visual studio and when I tried to link with my existing project as a static lib I got an error about dllimport/export. I also have one ...
2
votes
2
answers
4k
views
How to print out a yaml::Node?
I have tried many different ways to do this. I have a bunch of nodes nested under each other e.g:
yaml::Node a;
a["foo"] = 3;
yaml::Node b;
b["baz"] = 7;
a["bar"] = b;
I ...
3
votes
1
answer
1k
views
Why do some Conan packages delete CMake Package information
I'm relatively new to Conan. I'm trying to use packages provided by conan in a very natural cmake way...i.e. I don't want anything conan specific in the consuming library's CMakeLists.txt. I just ...
1
vote
0
answers
219
views
yaml-cpp issue: InvalidNode@YAML@@QEAA@AEBV?$basic_string@DU?... not found in DLL
I am facing a runtime issue while running a C++ application in windows that links to the yaml-cpp library (yaml-cpp.lib).
The yaml-cpp has been installed using vcpkg.
The error has been pasted below. ...
1
vote
1
answer
2k
views
Iterate Through All Nodes In yaml-cpp Including Recursive Anchor/Alias
Given a YAML::Node how can we visit all Scalar Nodes within that node (to modify them)? My best guess is a recursive function:
void parseNode(YAML::Node node) {
if (node.IsMap()) {
for (...
0
votes
0
answers
49
views
Remove data from YAML file in cpp [duplicate]
I have data base:
point:
A:
w: 0.922068417
x: -1.89226389
y: -0.992412388
z: -0.387026489
B:
w: 0.922068417
x: -1.89226389
y: -0.992412388
z: -0.387026489
a:
...
0
votes
1
answer
2k
views
Compiler cannot find header file within header file in C++
I have a header file provided by yaml-cpp library, yaml.h
yaml.h:
#include "yaml-cpp/parser.h"
#include "yaml-cpp/emitter.h"
#include "yaml-cpp/emitterstyle.h"
#include &...
0
votes
1
answer
1k
views
Build using 0.5 libyaml-cpp-dev fails with boost errors
I installed libyaml-cpp-dev via sudo apt install libyaml-cpp-dev and got yaml-cpp 0.5 version installed on my machine.
dpkg -s libyaml-cpp-dev | grep Version
Version: 0.5.2-4ubuntu1
Using this , I ...
2
votes
2
answers
5k
views
Installing C++ libraries in codeblocks
I need to run some code which involves yaml-cpp and cvode libraries in code blocks. I have tried to install the libraries and link to the compiler (I think that,s what I did) but it doesn't seem to ...
0
votes
1
answer
2k
views
any means of returning bool for yaml variables in yaml-cpp?
I have a config file for disabling specific code paths. I just added a bool option to the yaml file, and am having a hard time figuring out how yaml-cpp handles those. The documentation is a bit ...
0
votes
1
answer
660
views
build yaml-cpp lib with -m32 (32-bit) - on linux /w gcc or llvm
subject pretty much says it all:
I downloaded yaml-cpp version 0.6.3.
I need to compile on linux x86_64, target linux x86_32 (build on 64 bit, use result on 32-bit)
I have been trying to add a new &...
0
votes
1
answer
386
views
How to create the top object with yaml-cpp?
I am trying to create a config file for my application using yaml-cpp, I am able to create map by
YAML::Emitter emitter;
emitter << YAML::BeginMap;
emitter << YAML::Key <<...