yaml-cpp

Why my <package>-config.cmake have <package>_include_dir and <package>_librairies empty

非 Y 不嫁゛ 提交于 2021-01-29 14:17:29
问题 I am trying to make a cross-platform CMake for my project (Windows and Linux). I need to use external libraries (yaml-cpp). On Linux, I just had to do an apt get and use find_package . But on Windows, I need to append the CMAKE_MODULE_PATH in order for my program to find the yaml-cpp-config.cmake . So I start by installing yaml-cpp (https://github.com/jbeder/yaml-cpp) with CMake GUI 3.16 and mingw32 ( mingw32-make install ). I have tried the library on a hello world project, and it works fine

Ubuntu下yaml-cpp的安装

被刻印的时光 ゝ 提交于 2021-01-29 08:13:58
由于要学习的代码中用到了yaml-cpp,因此在此记录一下安装过程,翻译自: stackoverflow 。 关于yaml-cpp可以看一下 yaml , yaml-cpp 来了解一下。 首先删除本地原有的yaml-cpp库: The installer just copies the header files to the directory $PREFIX/include/yaml-cpp and the library files to $PREFIX/lib/libyaml-cpp.so . ( $PREFIX is probably /usr/local ) Just remove the header directory and the library files and it should be uninstalled. 翻译一下这意思就是安装仅仅是将一些头文件拷贝到 $PREFIX/include/yaml-cpp;将一些库文件拷贝到 $PREFIX/lib,比如libyaml-cpp.so( $PREFIX 在Ubuntu下一般是/usr/local)。 因此将头文件目录和这些库文件删除掉,那么就算完成了卸载。 然后是yam-cpp的安装,这里说的是利用源码进行安装的方式: git clone https: // github.com/jbeder/yaml

Finding correct cmake configuration for yaml-cpp library

亡梦爱人 提交于 2020-05-16 03:17:08
问题 I was trying to use yaml-cpp in my project. It took me half an hour to correctly link the library by experimenting with the following names. After I finally stumbled across them in this file, I settled for this: find_package(yaml-cpp REQUIRED) include_directories(${YAML_INCLUDE_DIRS}) target_link_libraries(${YAML_CPP_LIBRARIES}) It works, but the way I was searching for those seems brainless. How is it remotely possible to figure out the correct name of the include variables? It could be YAML

Yaml to database

三世轮回 提交于 2020-01-15 12:23:29
问题 For my c++ program, I use jobs.yml which contains information about jobs in yaml format like: 141647523: JobType: Turbo LocalJobID: 16773779.0 Status: Done SystemPriority: 0.0 UserPriority: 8.0 Then I use yaml-cpp library for parsing file and casting jobs to c++ Job objects. Due to the big size of jobs.yml (~900Mb) I can't read all file at once at the beginning of the program and store in RAM . How can I overcome this obstacle? I guess that I should convert jobs.yml to database and in the

Parsing yaml with yaml cpp

纵然是瞬间 提交于 2020-01-13 09:35:31
问题 I am trying to parse a yaml usign yaml-cpp. This is my yaml: --- configuration: - height: 600 - widht: 800 - velocity: 1 - scroll: 30 types: - image: resources/images/grass.png name: grass - image: resources/images/water.png name: water version: 1.0 When I do YAML::Node basenode = YAML::LoadFile("./path/to/file.yaml"); int height; if(basenode["configuration"]) if(basenode["configuration"]["height"] height = basenode["configuration"]["height"].as<int>(); else cout << "The node height doesn't

Retrieve anchor & alias string in yaml-cpp from document

不想你离开。 提交于 2020-01-06 18:33:11
问题 I've looked through the yaml-cpp documentation & source code and know that linking of anchored nodes is handled by yaml-cpp lib but I would still like to access the string value of anchor so I could reuse it as a id for the dictionary of anchor/node pair in my application. --- - response: &list_01 - tim: Yes - bill: hello - selector: - option: What? response: *list_01 - option: Huh? response: - tim: Right ... So for the following yaml document, I would get both the value list_01 along with

How to edit / update YAML file in OpenCV?

女生的网名这么多〃 提交于 2020-01-05 19:30:10
问题 What is the best way to edit/update YAML/YML file in OpenCV ? 回答1: There is NO DIRECT support for update in YAML in general because it need to rewrite the whole file below the update node, so the reason in OpenCV as well as in yaml-cpp dont support direct edit of node value. So, the work around is re-create/write YAML structure again. 回答2: It looks like OpenCV has some native ways to read and write YAML. From this SO answer, I found the following "cheat sheet" for the OpenCV C++ interface:

How to edit / update YAML file in OpenCV?

◇◆丶佛笑我妖孽 提交于 2020-01-05 19:29:41
问题 What is the best way to edit/update YAML/YML file in OpenCV ? 回答1: There is NO DIRECT support for update in YAML in general because it need to rewrite the whole file below the update node, so the reason in OpenCV as well as in yaml-cpp dont support direct edit of node value. So, the work around is re-create/write YAML structure again. 回答2: It looks like OpenCV has some native ways to read and write YAML. From this SO answer, I found the following "cheat sheet" for the OpenCV C++ interface:

Defining custom input types for the new yaml-cpp API

我是研究僧i 提交于 2019-12-24 07:58:02
问题 I am trying to define some custom input types using the new-style YamlCpp API. I have two questions. Let me first say that we are currently using the 0.3 style-api and everything works great. The code-appearance of the new API is about 10x better though so we wanted to move to it. Why does my current approach bork the compiler? Is yaml-cpp smart enough to handle nested templates. For example, if my parser knows how to enc/dec std::vectors, and then I define a custom handler for MyAwesomeType