本文整理汇总了C++中var_table_t类的典型用法代码示例。如果您正苦于以下问题:C++ var_table_t类的具体用法?C++ var_table_t怎么用?C++ var_table_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了var_table_t类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: add_key_to_string_set
/**
Function used with to insert keys of one table into a set::set<wcstring>
*/
static void add_key_to_string_set(const var_table_t &envs, std::set<wcstring> &strSet)
{
var_table_t::const_iterator iter;
for (iter = envs.begin(); iter != envs.end(); ++iter)
{
var_entry_t *e = iter->second;
if( ( e->exportv && get_names_show_exported) ||
( !e->exportv && get_names_show_unexported) )
{
/*Insert Key*/
strSet.insert(iter->first);
}
}
}
开发者ID:octaexon,项目名称:fish-shell,代码行数:19,代码来源:env.cpp
示例2: assert
/* Given a variable table, generate callbacks representing the difference between our vars and the new vars */
void env_universal_t::generate_callbacks(const var_table_t &new_vars, callback_data_list_t *callbacks) const
{
assert(callbacks != NULL);
/* Construct callbacks for erased values */
for (var_table_t::const_iterator iter = this->vars.begin(); iter != this->vars.end(); ++iter)
{
const wcstring &key = iter->first;
/* Skip modified values */
if (this->modified.find(key) != this->modified.end())
{
continue;
}
/* If the value is not present in new_vars, it has been erased */
if (new_vars.find(key) == new_vars.end())
{
callbacks->push_back(callback_data_t(ERASE, key, L""));
}
}
/* Construct callbacks for newly inserted or changed values */
for (var_table_t::const_iterator iter = new_vars.begin(); iter != new_vars.end(); ++iter)
{
const wcstring &key = iter->first;
/* Skip modified values */
if (this->modified.find(key) != this->modified.end())
{
continue;
}
/* See if the value has changed */
const var_entry_t &new_entry = iter->second;
var_table_t::const_iterator existing = this->vars.find(key);
if (existing == this->vars.end() || existing->second.exportv != new_entry.exportv || existing->second.val != new_entry.val)
{
/* Value has changed */
callbacks->push_back(callback_data_t(new_entry.exportv ? SET_EXPORT : SET, key, new_entry.val));
}
}
}
开发者ID:hadoocn,项目名称:fish-shell,代码行数:44,代码来源:env_universal_common.cpp
注:本文中的var_table_t类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论