本文整理汇总了C++中ptree::not_found方法的典型用法代码示例。如果您正苦于以下问题:C++ ptree::not_found方法的具体用法?C++ ptree::not_found怎么用?C++ ptree::not_found使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ptree
的用法示例。
在下文中一共展示了ptree::not_found方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: string
Request::Request(const ptree &pt, const Storage &storage) {
ptree::const_assoc_iterator it;
storage.checkReady();
indexName = pt.get<string>("index", "id");
tableName = pt.get<string>("from");
string api = pt.get<string>("api_key");
APIKey = string(); for (size_t i=0; i<api.size() && APIKey.size()<=32; i++) if (isalnum(api[i])) APIKey += api[i];
mode = Mode::Default;
it = pt.find("mode"); if ( it != pt.not_found() ) {
string modeString = pt.get<string>("mode");
if (modeString == "count") mode = Mode::Count;
}
offset = pt.get<size_t>("offset", 0);
limit = pt.get<size_t>("limit", 10);
if (limit > 100) limit = 100;
const Table &tbl = storage.activeSlotConst().getTableByNameConst(tableName);
string name;
name = "where"; it = pt.find(name); if ( it != pt.not_found() ) {BOOST_FOREACH(const ptree::value_type &v, pt.get_child(name)) { filters.push_back( ColumnCondition(v, tbl, ColumnCondition::OperType::Compare) ); } }