本文整理汇总了C++中SymbolMap::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ SymbolMap::isEmpty方法的具体用法?C++ SymbolMap::isEmpty怎么用?C++ SymbolMap::isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymbolMap
的用法示例。
在下文中一共展示了SymbolMap::isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findCursorInfo
SymbolMap::const_iterator findCursorInfo(const SymbolMap &map, const Location &location, const String &context,
const SymbolMap *errors, bool *foundInErrors)
{
if (foundInErrors)
*foundInErrors = false;
if (map.isEmpty() && !errors)
return map.end();
if (errors) {
SymbolMap::const_iterator ret = findCursorInfo(map, location, context, false);
if (ret != map.end()) {
return ret;
}
ret = findCursorInfo(*errors, location, context, false);
if (ret != errors->end()) {
if (foundInErrors)
*foundInErrors = true;
return ret;
}
// ret = findCursorInfo(*errors, location, context, true);
// if (ret != errors->end()) {
// if (foundInErrors)
// *foundInErrors = true;
// return ret;
// }
// ret = findCursorInfo(map, location, context, true);
// if (ret != map.end()) {
// return ret;
// }
return map.end();
} else {
const SymbolMap::const_iterator ret = findCursorInfo(map, location, context, true);
return ret;
}
}
示例2: writeCursors
static inline void writeCursors(SymbolMap &symbols, SymbolMap ¤t)
{
if (!symbols.isEmpty()) {
if (current.isEmpty()) {
current = symbols;
} else {
SymbolMap::iterator it = symbols.begin();
const SymbolMap::iterator end = symbols.end();
while (it != end) {
SymbolMap::iterator cur = current.find(it->first);
if (cur == current.end()) {
current[it->first] = it->second;
} else {
cur->second.unite(it->second);
}
++it;
}
}
}
}
示例3: findCursorInfo
SymbolMap::const_iterator findCursorInfo(const SymbolMap &map, const Location &location)
{
if (map.isEmpty())
return map.end();
SymbolMap::const_iterator it = map.find(location);
if (it != map.end())
return it;
it = map.lower_bound(location);
if (it == map.end()) {
--it;
} else {
const int cmp = it->first.compare(location);
if (!cmp)
return it;
--it;
}
if (location.fileId() != it->first.fileId())
return map.end();
const int off = location.offset() - it->first.offset();
if (it->second.symbolLength > off)
return it;
return map.end();
}