ptree

    1热度

    1回答

    的提前声明我有以下代码: namespace boost { namespace property_tree { template<class Key, class Data, class KeyCompare> class basic_ptree; typedef basic_ptree<std::string, std::string, std:

    0热度

    1回答

    我有一个配置文件,这是一个JSON。我创建了一个读取该文件并存储值的类(ConfigFile)(使用boost parser和ptree)。我漫游是使用ptree作为ConfigFile类成员的一个好习惯,或者我只是将它用于读取json并将值存储在映射成员中?

    2热度

    1回答

    我试图将一个boost :: property_tree :: ptree的元素传递给一个函数。 详细地说,我必须从中ptree中被初始化下面的XML代码: <Master Name='gamma'> <Par1 Name='name1'> <Value>0.</Value> <Fix>1</Fix> </Par1> <Par2 Name='n

    1热度

    1回答

    我尝试使用ptree在C++中为具有多个键名的键名提取值的值。在键中。 所以我有JSON, "product": { "product.description.text": "Some text here" } 我打过电话 std::string product = pt.get_value("product.product.description.text"); ,但不能得到

    0热度

    1回答

    问候 我用boost ptree得到一些信息,也投入了一些时间。 typedef ptree MInfo; 在我的应用程序使用下面的风格来.put或.get信息到我的MInfo。 a_info.put<WORD>(PathTree(SStatus)(fwDevice).str(), s_status->fwDevice); WORD y = a_info.get<WORD>(PathTre

    0热度

    1回答

    在下面的代码用C++升压属性树,我想到一个美丽的输出如 { "fruit": { "apple": "true", "orange": "true" }, "animal": { "cat": "true", "dog": "true", "bird": { "duck": "true" }

    1热度

    1回答

    我使用升压库来解析ini文件看起来像: [head] type1=val1 type2=cal2 ... 我的代码是这样的: #include <iostream> #include <string> #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/ini_parser.hpp> usi

    0热度

    1回答

    我试图使用Boost属性树来读取INI包含部分内的属性的文件具有“合成”路径名。 比如我INI文件看起来像这样: [my.section.subsection1] someProp1=0 [my.section.subsection2] anotherProp=1 我用下面的代码阅读: namespace pt = boost::property_tree; pt::ptree p

    1热度

    1回答

    因此,我正在处理一项任务,并且需要将几个属性解析为json以通过网络发送。这是最终的价值应该是什么样子。 {"__type":"Login:#Messages","Identity":{"sNumber":"value","Alias":"value","FirstName":"value","LastName":"value"}} 所以我的代码是 boost::property_tree::

    8热度

    2回答

    我使用升压ptree中读取XML文件是这样的: ptree myTree; ... /*open xml file*/ try{ myTree.get<string>(s); } catch(boost::exception const& ex) { /*get useful info!*/ } 我知道我可以使用what()功能,但它产生的错误和琴弦我刚刚发送。 有没有