检索锚点&文档中yaml-cpp中的别名字符串 [英] Retrieve anchor & alias string in yaml-cpp from document
问题描述
我已经仔细阅读了yaml-cpp文档&源代码,并且知道锚定节点的链接是由yaml-cpp lib处理的,但是我仍然想访问anchor的字符串值,因此我可以将其用作应用程序中的锚定/节点对字典的id.>
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 ...
因此对于以下yaml文档,我将同时获得值list_01和第一个响应节点(这是包含地图列表的地图节点).
So for the following yaml document, I would get both the value list_01 along with the first response node (which is the map node which contains the list of maps).
还存在某种内置的锚/节点对字典(或多次使用的节点列表)吗?
Also is there a some kind built-in dictionary of anchor/node pairs (or a list of nodes that are used multiple times) functionality?
推荐答案
It's not currently possible, but I've gotten a couple requests now, so you can follow the issue at http://code.google.com/p/yaml-cpp/issues/detail?id=110.
这篇关于检索锚点&文档中yaml-cpp中的别名字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!