当前位置: 首页>>代码示例>>C++>>正文


C++ ptree::put方法代码示例

本文整理汇总了C++中ptree::put方法的典型用法代码示例。如果您正苦于以下问题:C++ ptree::put方法的具体用法?C++ ptree::put怎么用?C++ ptree::put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ptree的用法示例。


在下文中一共展示了ptree::put方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

/// \brief Save the specified coord to the specified Boost Property Tree ptree
///
/// \relates coord
void cath::geom::save_to_ptree(ptree       &arg_ptree, ///< The ptree to which the coord should be saved
                               const coord &arg_coord  ///< The coord to be saved
                               ) {
	arg_ptree.put( "x", arg_coord.get_x() );
	arg_ptree.put( "y", arg_coord.get_y() );
	arg_ptree.put( "z", arg_coord.get_z() );
}
开发者ID:UCLOrengoGroup,项目名称:cath-tools,代码行数:10,代码来源:coord.cpp

示例2: WritePtree

void ProjectConfiguration::WritePtree(ptree& pt,
									  const wxString& proj_path)
{
    pt.put("project.title", project_title);
    ptree& subtree = pt.put("project.layers.layer","");
    layer_confs[0]->WritePtree(subtree, proj_path);
}
开发者ID:jontheepi,项目名称:geoda,代码行数:7,代码来源:ProjectConf.cpp

示例3: save

	void save(ptree & pt)
	{
		LOG(LTRACE) << "CvFindChessboardCornersProps::save()\n";
		pt.put("width", patternSize.width);
		pt.put("height", patternSize.height);
		pt.put("squareSize", squareSize);
		pt.put("findSubpix", findSubpix);
	}
开发者ID:krejmano,项目名称:DisCODe,代码行数:8,代码来源:CvFindChessboardCorners_Processor.hpp

示例4: saveHelper

void EnvObject::saveHelper( ptree &tree ) {

    tree.put("x", xCoordinate);
    tree.put("y", yCoordinate);
    tree.put("width", width);
    tree.put("height", height);
    tree.put("temp", temp);
    tree.put("source", source);
}
开发者ID:BeepBoopBop,项目名称:BeepHive,代码行数:9,代码来源:EnvObject.cpp

示例5: save

	/*!
	 * \copydoc Base::Props::save
	 */
	void save(ptree & pt)
	{
		pt.put("dev.device", device);
		pt.put("dev.input", input);
		pt.put("dev.norm", norm);
		pt.put("dev.format", format);
		pt.put("dev.width", width);
		pt.put("dev.height", height);

		pt.put("image.brightness", brightness);
		pt.put("image.contrast", contrast);
		pt.put("image.saturation", saturation);
		pt.put("image.hue", hue);
	}
开发者ID:Sapphire1,项目名称:DCL_CameraUniCap,代码行数:17,代码来源:CameraUniCap_Source.hpp

示例6: write

void DeviceMatcher::write(const DeviceMatcher &matcher,ptree& writeTo){

    writeTo.put(CLASS_NAME_KEY,matcher.className());

    matcher.writeSelf(writeTo);

}
开发者ID:comicfans,项目名称:UnifiedKeyboardCombo,代码行数:7,代码来源:DeviceMatcher.cpp

示例7: put

//for yaw and pitch
std::string JsonObj::put(std::string& data, ptree& node){
	node.put("",data);

	//savoir si c'est l'arbre yaw ou pitch
	std::ostringstream buf;
	write_json (buf, node, false);
	std::string json = buf.str();
}
开发者ID:eiithel,项目名称:Leap,代码行数:9,代码来源:JsonObj.cpp

示例8: api_call

ptree api_call(const Remote &r, const String &api, ptree request)
{
    request.put("auth.user", r.user);
    request.put("auth.token", r.token);

    HttpRequest req = httpSettings;
    req.type = HttpRequest::POST;
    req.url = r.url + "/api/" + api;
    req.data = ptree2string(request);
    auto resp = url_request(req);
    auto ret = string2ptree(resp.response);
    if (resp.http_code != 200)
    {
        auto e = ret.get<String>("error", "");
        throw std::runtime_error(e);
    }

    return string2ptree(resp.response);
}
开发者ID:cppan,项目名称:cppan,代码行数:19,代码来源:api.cpp

示例9: ptreeFromParam

    bool ConfigTree::ptreeFromParam(ConfigParameter fromParam, ptree &toPtree)
    {
        CONFIGSYS_DEBUG_CALLS;

        toPtree = ptree();

        toPtree.put("desc", fromParam.getDescription());
        
        std::string modStr = (fromParam.isModified())? "true" : "false";
        toPtree.put("modified", modStr);

        std::string lockStr = (fromParam.isLocked())? "true" : "false";
        toPtree.put("locked", lockStr);


        value_type vt = fromParam.getType();
        std::string typStr = makeValueTypeString(vt);
        toPtree.put("type", typStr);
        
        return addParamValueandRangeToPtree(fromParam, toPtree);
    }
开发者ID:NUbots,项目名称:robocup,代码行数:21,代码来源:ConfigTree.cpp

示例10: process_pde_element

  void process_pde_element(PdeElementP element, ptree& node) {
    if (!element) return;
    node.put("id", element->GetId());

    PdfRect bbox;
    element->GetBBox(&bbox);
    node.put("left", bbox.left);
    node.put("bottom", bbox.bottom);
    node.put("right", bbox.right);
    node.put("top", bbox.top);

    switch (element->GetType())
    {
    case kPdeText:
    case kPdeTextLine:
    case kPdeWord:
      process_pde_text((PdeText*)element, node);
      break;
    case kPdeImage:
      process_pde_image((PdeImage*)element, node);
      break;
    case kPdePath:
    case kPdeLine:
    case kPdeRect:
      process_pde_path((PdePath*)element, node);
      break;
    case kPdeTable:
      process_pde_table((PdeTable*)element, node);
      break;
    default:
      break;
    }
    auto num_childs = element->GetNumChildren();
    for (auto i = 0; i < num_childs; i++) {
      ptree elem_node;
      PdeElementP child = element->GetChild(i);
      process_pde_element(child, elem_node);
      node.add_child("element", elem_node);
    }
  }
开发者ID:malcolmgreaves,项目名称:pdf2json,代码行数:40,代码来源:pdf_to_json.cpp

示例11: save

void CameraProps::save(ptree & pt) {
	pt.put("device.device", device);
	pt.put("device.io", convIOMethod(io));
	pt.put("device.video_standard", convStandard(standard));
	pt.put("device.width", width);
	pt.put("device.height", height);
	pt.put("device.channel", channel);
}
开发者ID:aszymane,项目名称:DisCODe,代码行数:8,代码来源:CameraProps.cpp

示例12: save

	void save(ptree & pt) {
		pt.put("directory", directory);
		pt.put("pattern", pattern);
		pt.put("sort", sort);
		pt.put("prefetch", prefetch);
		pt.put("triggered", triggered);
		pt.put("loop", loop);
	}
开发者ID:TomekGH,项目名称:DCL_CvBasic,代码行数:8,代码来源:Sequence.hpp

示例13: process_pde_text

  void process_pde_text(PdeTextP text, ptree& node) {
    PdfTextState ts;

    switch (text->GetType())
    {
    case kPdeText:
    {
      node.put("type", "text_paragraph");
      std::wstring s;
      s.resize(text->GetText(nullptr, 0));
      text->GetText((wchar_t*)s.c_str(), s.size());
      node.put("text", w2utf8(s.c_str()));
      text->GetTextState(&ts);
      auto num_lines = text->GetNumTextLines();
      for (auto i = 0; i < num_lines; i++) {
        ptree line_node;
        PdeTextLineP text_line = text->GetTextLine(i);
        process_pde_element((PdeElementP)text_line, line_node);
        node.add_child("element", line_node);
      }
    }
    break;
    case kPdeTextLine:
    {
      PdeTextLineP text_line = (PdeTextLine*)text;
      node.put("type", "text_line");
      std::wstring s;
      s.resize(text_line->GetText(nullptr, 0));
      text_line->GetText((wchar_t*)s.c_str(), s.size());
      node.put("text", w2utf8(s.c_str()));
      text_line->GetTextState(&ts);
      auto num_word = text_line->GetNumWords();
      for (auto i = 0; i < num_word; i++) {
        ptree word_node;
        PdeWordP text_word = text_line->GetWord(i);
        process_pde_element((PdeElementP)text_word, word_node);
        node.add_child("element", word_node);
      }
    }
    break;
    case kPdeWord:
    {
      PdeWordP word = (PdeWord*)text;
      node.put("type", "text_word");
      std::wstring s;
      s.resize(word->GetText(nullptr, 0));
      word->GetText((wchar_t*)s.c_str(), s.size());
      node.put("text", w2utf8(s.c_str()));
      word->GetTextState(&ts);
    }
    break;
    }
    process_pdf_text_state(ts, node);
  }
开发者ID:malcolmgreaves,项目名称:pdf2json,代码行数:54,代码来源:pdf_to_json.cpp

示例14: process_page

 void process_page(PdfPageP page, ptree& node) {
   if (!page) return;
   node.put("number", page->GetNumber());
   node.put("rotate", page->GetRotate());
   PdfPageMapParams params;
   PdePageMapP page_map = page->AcquirePageMap(&params, nullptr, nullptr);
   if (page_map == nullptr)
     return;
   int num_elements = page_map->GetNumElements();
   for (auto i = 0; i < num_elements; i++) {
     ptree elem_tree;
     PdeElementP element = page_map->GetElement(i);
     process_pde_element(element, elem_tree);
     node.add_child("element", elem_tree);
   }
   page->ReleasePageMap();
 }
开发者ID:malcolmgreaves,项目名称:pdf2json,代码行数:17,代码来源:pdf_to_json.cpp

示例15: process_pdf_text_state

 void process_pdf_text_state(PdfTextState& ts, ptree& node) {
   node.put("char_spacing", ts.char_spacing);
   node.put("flags", ts.flags);
   process_pdf_font(ts.font, node);
   node.put("font_size", ts.font_size);
   
   node.put("fill_alpha", ts.color_state.fill_opacity);
   process_pdf_rgb(ts.color_state.fill_color, node);
   node.put("stroke_alpha", ts.color_state.stroke_opacity);
   process_pdf_rgb(ts.color_state.stroke_color, node);
   
   node.put("word_spacing", ts.word_spacing);
 }
开发者ID:malcolmgreaves,项目名称:pdf2json,代码行数:13,代码来源:pdf_to_json.cpp


注:本文中的ptree::put方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。