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


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

本文整理汇总了C++中StringSet::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ StringSet::empty方法的具体用法?C++ StringSet::empty怎么用?C++ StringSet::empty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StringSet的用法示例。


在下文中一共展示了StringSet::empty方法的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: queueTargets

void SBWorkspace::queueTargets(const StringSet& targetNames, const StringSet& configNames) {
    BuildSettings bs(NULL);
    bool isInteractive = bs.getValue("VSIMPORTER_INTERACTIVE") == "YES";

    // Get the specified targets
    PotentialTargetsVec selectedTargets;
    if (isInteractive) {
        // Query the user to select targets to be queued
        selectTargets(selectedTargets);
    } else if (targetNames.empty()) {
        // Queue up all targets
        getAllTargets(selectedTargets);
    } else {
        // Try to find matching targets by name
        for (auto targetName : targetNames) {
            TargetProjectPair targetKV = findTargetWithName(targetName);
            if (targetKV.first) {
                selectedTargets.push_back(targetKV);
            }
        }
    }

    // Queue targets
    for (auto targetKV : selectedTargets) {
        SBTarget* target = targetKV.second->queueTarget(targetKV.first, &configNames);

        // Mark target as having been explicitly queued up
        if (target) {
            target->markExplicit();
        }
    }
}
开发者ID:bbowman,项目名称:WinObjC,代码行数:32,代码来源:SBWorkspace.cpp

示例3: writeProjectItem

static void writeProjectItem(const ProjectItem* item, const StringMap& params, const StringSet& urlSchemes)
{
  if (!item)
    return;

  // Open input file
  auto inMode = item->replaceParams ? ios::in : ios::binary;
  ifstream ifs(item->inFile.c_str(), inMode);
  if (!ifs.is_open()) {
    SBLog::warning() << "Failed to open " << item->inFile << " for reading." << std::endl;
    return;
  }

  // Open output file
  ofstream ofs;
  auto outMode = item->replaceParams ? ios::out : ios::binary;
  openOutputFileStream(ofs, item->outFile, outMode);

  if (item->replaceParams) {
    // Expand input line by line and write it out
    std::string line;
    while (std::getline(ifs, line)) {
      expandString(line, params);
      ofs << line << std::endl;
    }
  } else {
    // Copy the file contents
    ofs << ifs.rdbuf();
  }

  if (!urlSchemes.empty() && isAppxManifestFileName(item->inFile)) {
      ofs.close();
      insertUrlSchemes(item->outFile, urlSchemes);
  }
}
开发者ID:CadeLaRen,项目名称:WinObjC,代码行数:35,代码来源:VSTemplateProject.cpp

示例4: 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

示例5:

const StringSet& EventManager::getDependencies() const {
	static StringSet _dependencies;

	if (_dependencies.empty()) {
		_dependencies.insert(MODULE_XMLREGISTRY);
	}

	return _dependencies;
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:9,代码来源:EventManager.cpp

示例6:

const StringSet& Map::getDependencies() const {
    static StringSet _dependencies;

    if (_dependencies.empty()) {
        _dependencies.insert(MODULE_RADIANT);
    }

    return _dependencies;
}
开发者ID:Zbyl,项目名称:DarkRadiant,代码行数:9,代码来源:Map.cpp

示例7: getDependencies

	virtual const StringSet& getDependencies() const {
		static StringSet _dependencies;

		if (_dependencies.empty())
		{
			_dependencies.insert(MODULE_XMLREGISTRY);
		}

		return _dependencies;
	}
开发者ID:BielBdeLuna,项目名称:DarkRadiant,代码行数:10,代码来源:plugin.cpp

示例8: getDependencies

	virtual const StringSet& getDependencies() const {
		static StringSet _dependencies;

		if (_dependencies.empty()) {
			_dependencies.insert(MODULE_EVENTMANAGER);
			_dependencies.insert(MODULE_UIMANAGER);
		}

		return _dependencies;
	}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:10,代码来源:plugin.cpp

示例9: sbAssert

SBTarget::SBTarget(const PBXTarget* target, const StringSet& configNames, SBProject& parentProject)
  : m_target(target),
    m_parentProject(parentProject)
{
  sbAssert(target);
  sbAssert(!configNames.empty());

  for (auto configName : configNames) {
    m_buildSettings[configName] = new BuildSettings(target, configName);
  }
}
开发者ID:neuswcjr,项目名称:WinObjC,代码行数:11,代码来源:SBTarget.cpp

示例10:

const StringSet& Doom3PatchCreator::getDependencies() const
{
	static StringSet _dependencies;

	if (_dependencies.empty())
	{
		_dependencies.insert(MODULE_PREFERENCESYSTEM);
	}

	return _dependencies;
}
开发者ID:BielBdeLuna,项目名称:DarkRadiant,代码行数:11,代码来源:PatchCreators.cpp

示例11:

const StringSet& Doom3FileSystem::getDependencies() const {
    static StringSet _dependencies;

    if (_dependencies.empty()) {
        _dependencies.insert("ArchivePK4");
        _dependencies.insert(MODULE_XMLREGISTRY);
        _dependencies.insert(MODULE_GAMEMANAGER);
    }

    return _dependencies;
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:11,代码来源:Doom3FileSystem.cpp

示例12:

const StringSet& Doom3MapCompiler::getDependencies() const
{
	static StringSet _dependencies;

	if (_dependencies.empty())
	{
		_dependencies.insert(MODULE_COMMANDSYSTEM);
		_dependencies.insert(MODULE_RENDERSYSTEM);
	}

	return _dependencies;
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:12,代码来源:Doom3MapCompiler.cpp

示例13:

const StringSet& OpenGLRenderSystem::getDependencies() const
{
	static StringSet _dependencies;

	if (_dependencies.empty()) 
	{
		_dependencies.insert(MODULE_SHADERSYSTEM);
		_dependencies.insert(MODULE_OPENGL);
	}

	return _dependencies;
}
开发者ID:codereader,项目名称:DarkRadiant,代码行数:12,代码来源:OpenGLRenderSystem.cpp

示例14:

const StringSet& MainFrameLayoutManager::getDependencies() const
{
	static StringSet _dependencies;

	if (_dependencies.empty()) {
		_dependencies.insert(MODULE_EVENTMANAGER);
		_dependencies.insert(MODULE_UIMANAGER);
		_dependencies.insert(MODULE_COMMANDSYSTEM);
	}

	return _dependencies;
}
开发者ID:BielBdeLuna,项目名称:DarkRadiant,代码行数:12,代码来源:MainFrameLayoutManager.cpp

示例15:

const StringSet& EClassManager::getDependencies() const {
	static StringSet _dependencies;

	if (_dependencies.empty()) {
		_dependencies.insert(MODULE_VIRTUALFILESYSTEM);
		_dependencies.insert(MODULE_XMLREGISTRY);
		_dependencies.insert(MODULE_RENDERSYSTEM);
		_dependencies.insert(MODULE_UIMANAGER);
	}

	return _dependencies;
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:12,代码来源:EClassManager.cpp


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