本文整理汇总了C++中StringSet::end方法的典型用法代码示例。如果您正苦于以下问题:C++ StringSet::end方法的具体用法?C++ StringSet::end怎么用?C++ StringSet::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringSet
的用法示例。
在下文中一共展示了StringSet::end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsBoolField
bool IsBoolField(const string& field_name) {
static StringSet int_bool_filter, special_bool_filter;
if (int_bool_filter.empty() && special_bool_filter.empty()) {
int_bool_filter.insert("lan-mode");
int_bool_filter.insert("announce");
int_bool_filter.insert("query");
int_bool_filter.insert("rcon");
int_bool_filter.insert("logqueries");
int_bool_filter.insert("chatlogging");
special_bool_filter.insert("timestamp");
special_bool_filter.insert("output");
}
return int_bool_filter.end() != int_bool_filter.find(field_name) || special_bool_filter.end() != special_bool_filter.find(field_name);
}
示例2: currentGroup
void Viewer::CategoryImageConfig::groupChanged()
{
QString categoryName = currentGroup();
if (categoryName.isNull())
return;
QString currentText = m_member->currentText();
m_member->clear();
StringSet directMembers = m_info->itemsOfCategory(categoryName);
StringSet set = directMembers;
QMap<QString,StringSet> map =
DB::ImageDB::instance()->memberMap().inverseMap(categoryName);
for( StringSet::const_iterator directMembersIt = directMembers.begin();
directMembersIt != directMembers.end(); ++directMembersIt ) {
set += map[*directMembersIt];
}
QStringList list = set.toList();
list.sort();
m_member->addItems( list );
int index = list.indexOf( currentText );
if ( index != -1 )
m_member->setCurrentIndex( index );
memberChanged();
}
示例3:
bool
inWordSet(int i)
{
const ECString& w = Pst::fromInt(i);
if(wordSet.find(w) == wordSet.end()) return false;
return true;
}
示例4: init
MojErr MojObjectFilter::init(const StringSet& selectProps)
{
MojAssert(m_root.get() == NULL);
//create the root node
m_root.reset(new Node(MojString()));
MojAllocCheck(m_root.get());
for (StringSet::ConstIterator i = selectProps.begin(); i != selectProps.end(); i++) {
MojVector<MojString> parts;
MojErr err = i->split(_T('.'), parts);
MojErrCheck(err);
Node* curNode = m_root.get();
for (MojVector<MojString>::ConstIterator pi = parts.begin(); pi != parts.end(); ++pi) {
Node* child = curNode->find(*pi);
if (child) {
if (child->m_children.empty()) {
break;
} else {
curNode = child;
}
} else {
MojAutoPtr<Node> node(new Node(*pi));
MojAllocCheck(node.get());
Node* nextNode = node.get();
MojErr err = curNode->addChild(node);
MojErrCheck(err);
curNode = nextNode;
}
}
}
return MojErrNone;
}
示例5: normalize
std::string normalize(const std::string& line)
{
static const char tbl[][3] = { "66", "67", "F2", "F3" };
size_t tblNum = sizeof(tbl) / sizeof(tbl[0]);
typedef std::set<std::string> StringSet;
StringSet suf;
size_t pos = 0;
for (; pos < line.size(); pos += 2) {
bool found = false;
for (size_t i = 0; i < tblNum; i++) {
if (::memcmp(&line[pos], tbl[i], 2) == 0) {
found = true;
suf.insert(tbl[i]);
break;
}
}
if (!found) break;
}
std::string ret;
for (StringSet::const_iterator i = suf.begin(), e = suf.end(); i != e; ++i) {
ret += *i;
}
ret += &line[pos];
return ret;
}
示例6: calculate_all_expressions
void Expressionizer::calculate_all_expressions(const std::string& i_str)
{
// __a_b__ -> __a_b__
// __a_b_ __a_b
// _a_b__ a_b__
// _a_b_ a_b
//
// Store original -> __a_b__ OK
// Remove leading _, store it -> _a_b__ OK
// Remove trailing _, store it -> _a_b_ OK
// Remove leading _, store it -> a_b_ OK
// Remove trailing _, store it -> a_b OK
// Repeat, starting with trailing -> __a_b_ OK, _a_b_ DUP, _a_b OK, a_b DUP
if (i_str.size() < 2) // || i_str.find_first_not_of("_") == std::string::npos)
{
return;
}
StringSet permutations;
generate_permutations(i_str, permutations);
for (StringSet::const_iterator it = permutations.begin() ; it != permutations.end() ; ++it)
{
Expression e(*it);
m_expression_seq.push_back(e);
}
}
示例7: clear
void Exif::TreeView::reload()
{
clear();
setRootIsDecorated( true );
StringSet keys = Exif::Info::instance()->availableKeys();
QMap<QString, QTreeWidgetItem*> tree;
for( StringSet::const_iterator keysIt = keys.begin(); keysIt != keys.end(); ++keysIt ) {
QStringList subKeys = (*keysIt).split(QLatin1String("."));
QTreeWidgetItem* parent = nullptr;
QString path;
for( QStringList::Iterator subKeyIt = subKeys.begin(); subKeyIt != subKeys.end(); ++subKeyIt ) {
if ( !path.isEmpty() )
path += QString::fromLatin1( "." );
path += *subKeyIt;
if ( tree.contains( path ) )
parent = tree[path];
else {
if ( parent == nullptr )
parent = new QTreeWidgetItem( this, QStringList(*subKeyIt) );
else
parent = new QTreeWidgetItem( parent, QStringList(*subKeyIt) );
parent->setText( 1, path ); // This is simply to make the implementation of selected easier.
parent->setFlags( Qt::ItemIsUserCheckable | Qt::ItemIsEnabled );
parent->setCheckState(0,Qt::Unchecked);
tree.insert( path, parent );
}
}
}
if ( QTreeWidgetItem* item = topLevelItem(0) )
item->setExpanded( true );
}
示例8: AddComponentGlyphs
EStatusCode Type1ToCFFEmbeddedFontWriter::AddDependentGlyphs(StringVector& ioSubsetGlyphIDs)
{
EStatusCode status = PDFHummus::eSuccess;
StringSet glyphsSet;
StringVector::iterator it = ioSubsetGlyphIDs.begin();
bool hasCompositeGlyphs = false;
for(;it != ioSubsetGlyphIDs.end() && PDFHummus::eSuccess == status; ++it)
{
bool localHasCompositeGlyphs;
status = AddComponentGlyphs(*it,glyphsSet,localHasCompositeGlyphs);
hasCompositeGlyphs |= localHasCompositeGlyphs;
}
if(hasCompositeGlyphs)
{
StringSet::iterator itNewGlyphs;
for(it = ioSubsetGlyphIDs.begin();it != ioSubsetGlyphIDs.end(); ++it)
glyphsSet.insert(*it);
ioSubsetGlyphIDs.clear();
for(itNewGlyphs = glyphsSet.begin(); itNewGlyphs != glyphsSet.end(); ++itNewGlyphs)
ioSubsetGlyphIDs.push_back(*itNewGlyphs);
sort(ioSubsetGlyphIDs.begin(),ioSubsetGlyphIDs.end());
}
return status;
}
示例9:
Listener::~Listener() {
StringSet subs = theObserver.getSubscriptionsFor(this);
StringSet::iterator it = subs.begin();
while (it != subs.end()) {
++it;
}
}
示例10: StringVector
std::vector<std::string> IddFile_Impl::groups() const {
StringSet result;
for (const IddObject& object : objects()) {
result.insert(object.group());
}
return StringVector(result.begin(),result.end());
}
示例11: UnsubscribeAll
int Ardb::UnsubscribeAll(Context& ctx, bool notify)
{
if(NULL == ctx.pubsub)
{
return 0;
}
StringSet tmp = ctx.GetPubsub().pubsub_channels;
StringSet::iterator it = tmp.begin();
int count = 0;
while (it != tmp.end())
{
count += UnsubscribeChannel(ctx, *it, notify);
it++;
}
if (notify && count == 0 && NULL != ctx.client)
{
RedisReply r;
RedisReply& r1 = r.AddMember();
RedisReply& r2 = r.AddMember();
RedisReply& r3 = r.AddMember();
fill_str_reply(r1, "unsubscribe");
r2.type = REDIS_REPLY_NIL;
fill_int_reply(r3, ctx.GetPubsub().pubsub_channels.size() + ctx.GetPubsub().pubsub_patterns.size());
ctx.client->Write(r);
}
return 0;
}
示例12: getAllSymbolsUsedByKernel
ModuleLinkerPass::StringVector ModuleLinkerPass::getAllSymbolsUsedByKernel(
const std::string& kernelName) const
{
StringSet usedSymbols;
usedSymbols.insert(kernelName);
StringVector unprocessedSymbols = getAllSymbolsUsedByThisKernel(
kernelName, _linkedModule);
while(!unprocessedSymbols.empty())
{
StringVector newSymbols;
for(auto symbol = unprocessedSymbols.begin();
symbol != unprocessedSymbols.end(); ++symbol)
{
if(!usedSymbols.insert(*symbol).second) continue;
if(!isKernelSymbol(_linkedModule, *symbol)) continue;
StringVector kernelSymbols = getAllSymbolsUsedByThisKernel(
*symbol, _linkedModule);
newSymbols.insert(newSymbols.end(), kernelSymbols.begin(),
kernelSymbols.end());
}
unprocessedSymbols = std::move(newSymbols);
}
return StringVector(usedSymbols.begin(), usedSymbols.end());
}
示例13: SRandMember
int MMKVImpl::SRandMember(DBID db, const Data& key, const StringArrayResult& members, int count)
{
int err = 0;
RWLockGuard<MemorySegmentManager, READ_LOCK> keylock_guard(m_segment);
StringSet* set = GetObject<StringSet>(db, key, V_TYPE_SET, false, err)();
if (IS_NOT_EXISTS(err))
{
return 0;
}
if (0 != err)
{
return err;
}
if (set->empty())
{
return 0;
}
//return whole set
if (count > 0 && count > set->size())
{
StringSet::iterator it = set->begin();
while (it != set->end())
{
it->ToString(members.Get());
it++;
}
return 0;
}
int rand = 0;
for (int i = 0; i < std::abs(count); i++)
{
if (count > 0)
{
if (i == 0)
{
rand = random_between_int32(0, set->size() - 1);
}
else
{
rand += i;
if (rand >= set->size())
{
rand -= set->size();
}
}
}
else
{
rand = random_between_int32(0, set->size() - 1);
}
StringSet::iterator it = set->begin();
it.increment_by(rand);
it->ToString(members.Get());
}
return 0;
}
示例14: isInput
static bool isInput(const StringSet<> &Prefixes, StringRef Arg) {
if (Arg == "-")
return true;
for (StringSet<>::const_iterator I = Prefixes.begin(),
E = Prefixes.end(); I != E; ++I)
if (Arg.startswith(I->getKey()))
return false;
return true;
}
示例15: has_repeats
static bool has_repeats(const Fragments& fragments) {
StringSet genomes;
BOOST_FOREACH (Fragment* f, fragments) {
ASSERT_TRUE(f->seq());
std::string genome = f->seq()->genome();
if (genomes.find(genome) != genomes.end()) {
return true;
}
genomes.insert(genome);
}