本文整理汇总了C++中OovStringVec::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ OovStringVec::begin方法的具体用法?C++ OovStringVec::begin怎么用?C++ OovStringVec::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OovStringVec
的用法示例。
在下文中一共展示了OovStringVec::begin方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseProjRefs
void ComponentsFile::parseProjRefs(OovStringRef const arg, OovString &rootDir,
OovStringVec &excludes)
{
excludes.clear();
OovStringVec tokens = StringSplit(arg, '!');
if(rootDir.size() == 0)
rootDir = tokens[0];
if(tokens.size() > 1)
{
excludes.resize(tokens.size()-1);
std::copy(tokens.begin()+1, tokens.end(), excludes.begin());
}
}
示例2: addConfig
void OptionsDialog::addConfig()
{
GtkEntry *newNameEntry = GTK_ENTRY(Builder::getBuilder()->getWidget("NewConfigNameEntry"));
// Update the build config option
std::string compStr = mProjectOptions.getValue(OptBuildConfigs);
CompoundValue compVal;
compVal.parseString(compStr);
OovString newName = Gui::getText(newNameEntry);
OovStringVec cfgs = compVal;
cfgs.push_back(BuildConfigAnalysis);
cfgs.push_back(BuildConfigDebug);
cfgs.push_back(BuildConfigRelease);
bool found = std::find(cfgs.begin(), cfgs.end(), newName) != cfgs.end();
if(!found)
{
compVal.addArg(newName);
mProjectOptions.setNameValue(OptBuildConfigs, compVal.getAsString());
// Leave what is on the screen, and change the config name.Save the
// screen data to the new config.
mCurrentBuildConfig = newName;
// ScreenOptions options(mCurrentBuildConfig);
// options.screenToOptions();
updateBuildConfig();
}
else
Gui::messageBox("Configuration already exists", GTK_MESSAGE_INFO);
}
示例3: getComponentFiles
OovStringVec ComponentTypesFile::getComponentFiles(OovStringRef const compName,
OovStringRef const tagStr, bool getNested) const
{
OovStringVec files;
OovStringVec names = getComponentNames();
OovString parentName = compName;
for(auto const &name : names)
{
bool match = false;
if(getNested)
{
if(strcmp(compName, Project::getRootComponentName()) == 0)
{
match = true;
}
else
{
match = compareComponentNames(parentName, name);
}
}
else
{
match = (parentName == name);
}
if(match)
{
OovString tag = ComponentTypesFile::getCompTagName(name, tagStr);
OovString val = mCompSourceListFile.getValue(tag);
OovStringVec newFiles = CompoundValueRef::parseString(val);
files.insert(files.end(), newFiles.begin(), newFiles.end());
}
}
return files;
}
示例4: getErrorPosition
static int getErrorPosition(OovStringRef const line, int &charOffset)
{
int lineNum = -1;
OovStringVec tokens = StringSplit(line, ':');
auto iter = std::find_if(tokens.begin(), tokens.end(),
[](OovStringRef const tok)
{ return(isdigit(tok[0])); }
);
int starti = iter-tokens.begin();
if(tokens[starti].getInt(0, INT_MAX, lineNum))
{
if(static_cast<unsigned int>(starti+1) < tokens.size())
{
tokens[starti+1].getInt(0, INT_MAX, charOffset);
}
}
return lineNum;
}
示例5: getCompSources
OovStringVec CMaker::getCompSources(OovStringRef const compName)
{
OovStringVec sources = mCompTypes.getComponentSources(compName);
OovString compPath = mCompTypes.getComponentAbsolutePath(compName);
for(auto &src : sources)
{
src.erase(0, compPath.length());
}
std::sort(sources.begin(), sources.end(), compareNoCase);
return sources;
}
示例6: getComponentNames
OovStringVec ComponentTypesFile::getComponentNames(bool definedComponentsOnly) const
{
OovStringVec compNames = CompoundValueRef::parseString(
mCompTypesFile.getValue("Components"));
if(definedComponentsOnly)
{
compNames.erase(std::remove_if(compNames.begin(), compNames.end(),
[this](OovString &name)
{ return(getComponentType(name) == CT_Unknown); }), compNames.end());
}
return compNames;
}
示例7: displayAddPackageDialog
void ProjectPackagesDialog::displayAddPackageDialog()
{
AddPackageDialog dlg;
if(dlg.run(true))
{
OovStringVec packages = mProjectPackagesList.getText();
Package pkg = dlg.getPackage();
if(std::find(packages.begin(), packages.end(), pkg.getPkgName()) ==
packages.end())
{
mProjectPackages.insertPackage(pkg);
}
else
{
Gui::messageBox("Package already exists");
}
updatePackageList();
mProjectPackagesList.setSelected(pkg.getPkgName());
#ifndef __linux__
winScanDirectories();
#endif
}
}
示例8: makeComponentFile
void CMaker::makeComponentFile(OovStringRef const compName,
ComponentTypesFile::eCompTypes compType,
OovStringVec const &sources, OovStringRef const destName)
{
OovString str;
if(mVerbose)
printf("Processing %s\n %s\n", compName.getStr(), destName.getStr());
if(compType == ComponentTypesFile::CT_Program)
{
if(mVerbose)
printf(" Executable\n");
addCommandAndNames(CT_Exec, compName, sources, str);
addLibsAndIncs(compName, str);
str += "install(TARGETS ";
str += compName;
str += "\n EXPORT ";
str += mProjectName;
str += "Targets";
str += "\n RUNTIME DESTINATION \"${INSTALL_BIN_DIR}\" COMPONENT lib)\n";
}
else if(compType == ComponentTypesFile::CT_SharedLib)
{
if(mVerbose)
printf(" SharedLib\n");
addCommandAndNames(CT_Shared, compName, sources, str);
addLibsAndIncs(compName, str);
str += "install(TARGETS ";
str += compName;
str += "\n LIBRARY DESTINATION \"${INSTALL_LIB_DIR}\" COMPONENT lib)\n";
}
else if(compType == ComponentTypesFile::CT_StaticLib)
{
if(mVerbose)
printf(" Library\n");
OovStringVec headers = mCompTypes.getComponentIncludes(compName);
discardDirs(headers);
OovStringVec allFiles = headers;
allFiles.insert(allFiles.end(), sources.begin(), sources.end() );
std::sort(allFiles.begin(), allFiles.end(), compareNoCase);
if(sources.size() == 0)
{
addCommandAndNames(CT_Interface, compName, allFiles, str);
str += "set_target_properties(";
str += compName;
str += " PROPERTIES LINKER_LANGUAGE CXX)\n";
}
else
addCommandAndNames(CT_Static, compName, allFiles, str);
addCommandAndNames(CT_TargHeaders, compName, headers, str);
str += "install(TARGETS ";
str += compName;
str += "\n EXPORT ";
str += mProjectName;
str += "Targets";
str += "\n ARCHIVE DESTINATION \"${INSTALL_LIB_DIR}\" COMPONENT lib";
str += "\n PUBLIC_HEADER DESTINATION \"${INSTALL_INCLUDE_DIR}/";
str += mProjectName;
str += "\" COMPONENT dev)\n";
}
writeFile(destName, str);
}