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


C++ StringSet::end方法代码示例

本文整理汇总了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);
	}
开发者ID:sabinich,项目名称:gsmanager,代码行数:15,代码来源:gta_mini.cpp

示例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();
}
开发者ID:astifter,项目名称:kphotoalbum-astifter-branch,代码行数:28,代码来源:CategoryImageConfig.cpp

示例3:

bool
inWordSet(int i)
{
  const ECString& w = Pst::fromInt(i);
  if(wordSet.find(w) == wordSet.end()) return false;
  return true;
}
开发者ID:haewon-mit,项目名称:Syntax-Analysis,代码行数:7,代码来源:trainRs.C

示例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;
}
开发者ID:ctbrowser,项目名称:db8,代码行数:34,代码来源:MojObjectFilter.cpp

示例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;
}
开发者ID:153370771,项目名称:xbyak,代码行数:26,代码来源:normalize_prefix.cpp

示例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);
    }
}
开发者ID:dcastroviejo,项目名称:peterbourgon.wordsmith,代码行数:27,代码来源:Expression.cpp

示例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 );
}
开发者ID:Df458,项目名称:kphotoalbum-multitags-branch,代码行数:34,代码来源:TreeView.cpp

示例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;	
}
开发者ID:CornerZhang,项目名称:PDF-Writer,代码行数:29,代码来源:Type1ToCFFEmbeddedFontWriter.cpp

示例9:

Listener::~Listener() {
	StringSet subs = theObserver.getSubscriptionsFor(this);
	StringSet::iterator it = subs.begin();
	while (it != subs.end()) {
		++it;
	}
}
开发者ID:massivedanger,项目名称:matter,代码行数:7,代码来源:Message.cpp

示例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());
 }
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:7,代码来源:IddFile.cpp

示例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;
 }
开发者ID:Abioy,项目名称:ardb,代码行数:27,代码来源:pubsub.cpp

示例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());
}
开发者ID:dougct,项目名称:ocelot-ufmg,代码行数:33,代码来源:ModuleLinkerPass.cpp

示例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;
    }
开发者ID:shitfSign,项目名称:mmkv,代码行数:58,代码来源:t_set.cpp

示例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;
}
开发者ID:dongjinxian,项目名称:llvm,代码行数:9,代码来源:OptTable.cpp

示例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);
    }
开发者ID:npge,项目名称:npge,代码行数:10,代码来源:SplitRepeats.cpp


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