本文整理汇总了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);
}
示例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();
}
}
}
示例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);
}
}
示例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;
}
示例5:
const StringSet& EventManager::getDependencies() const {
static StringSet _dependencies;
if (_dependencies.empty()) {
_dependencies.insert(MODULE_XMLREGISTRY);
}
return _dependencies;
}
示例6:
const StringSet& Map::getDependencies() const {
static StringSet _dependencies;
if (_dependencies.empty()) {
_dependencies.insert(MODULE_RADIANT);
}
return _dependencies;
}
示例7: getDependencies
virtual const StringSet& getDependencies() const {
static StringSet _dependencies;
if (_dependencies.empty())
{
_dependencies.insert(MODULE_XMLREGISTRY);
}
return _dependencies;
}
示例8: getDependencies
virtual const StringSet& getDependencies() const {
static StringSet _dependencies;
if (_dependencies.empty()) {
_dependencies.insert(MODULE_EVENTMANAGER);
_dependencies.insert(MODULE_UIMANAGER);
}
return _dependencies;
}
示例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);
}
}
示例10:
const StringSet& Doom3PatchCreator::getDependencies() const
{
static StringSet _dependencies;
if (_dependencies.empty())
{
_dependencies.insert(MODULE_PREFERENCESYSTEM);
}
return _dependencies;
}
示例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;
}
示例12:
const StringSet& Doom3MapCompiler::getDependencies() const
{
static StringSet _dependencies;
if (_dependencies.empty())
{
_dependencies.insert(MODULE_COMMANDSYSTEM);
_dependencies.insert(MODULE_RENDERSYSTEM);
}
return _dependencies;
}
示例13:
const StringSet& OpenGLRenderSystem::getDependencies() const
{
static StringSet _dependencies;
if (_dependencies.empty())
{
_dependencies.insert(MODULE_SHADERSYSTEM);
_dependencies.insert(MODULE_OPENGL);
}
return _dependencies;
}
示例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;
}
示例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;
}