本文整理汇总了C++中OovStringVec::size方法的典型用法代码示例。如果您正苦于以下问题:C++ OovStringVec::size方法的具体用法?C++ OovStringVec::size怎么用?C++ OovStringVec::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OovStringVec
的用法示例。
在下文中一共展示了OovStringVec::size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StringJoin
OovString StringJoin(OovStringVec const &tokens, char delimiter)
{
OovString str;
for(size_t i=0; i<tokens.size(); i++)
{
str += tokens[i];
if(i < tokens.size()-1)
{
str += delimiter;
}
}
return str;
}
示例2: 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());
}
}
示例3: addFilterList
void BuildVarSettingsDialog::addFilterList()
{
GuiTreeItem parent;
OovString filterTag;
int index = getComboId("FilterNameComboboxtext", mFilterNames);
if(index != BAD_INDEX)
{
switch(index)
{
case FT_BuildConfig:
filterTag = OptFilterNameBuildConfig;
break;
case FT_BuildMode:
filterTag = OptFilterNameBuildMode;
break;
case FT_Component:
filterTag = OptFilterNameComponent;
break;
case FT_Platform:
filterTag = OptFilterNamePlatform;
break;
}
}
OovStringVec filterVals = mFilterValuesTreeView.getSelected();
if(filterVals.size() > 0)
{
VariableFilter filter(filterTag, filterVals[0]);
mFiltersTreeView.appendText(parent, filter.getFilterAsString());
}
updateSettingText();
}
示例4: updateDebugDataValue
void Editor::updateDebugDataValue()
{
OovStringVec strs = mVarView.getSelected();
if(strs.size() > 0)
{
mEditFiles.getDebugger().startGetVariable(strs[0]);
}
}
示例5: removeVariableSetting
void BuildVariablesDialog::removeVariableSetting()
{
OovStringVec vars = mVarListTreeView.getSelected();
if(vars.size() > 0)
{
BuildVariable origBuildVar;
origBuildVar.initVarFromString(vars[0]);
mVarListTreeView.removeSelected();
mProject.removeName(origBuildVar.getVarFilterName());
}
}
示例6: getAsString
OovString CompoundValueRef::getAsString(const OovStringVec &vec,
char delimiter)
{
OovString str;
for(size_t i=0; i<vec.size(); i++)
{
str += vec[i];
str += delimiter;
}
return str;
}
示例7: addLibsAndIncs
void CMaker::addLibsAndIncs(OovStringRef const compName, OovString &str)
{
OovStringVec extraIncs;
OovStringVec libs = getCompLibrariesAndIncs(compName, extraIncs);
addCommandAndNames(CT_TargLinkLibs, compName, libs, str);
if(extraIncs.size())
{
str += "include_directories(";
appendNames(extraIncs, ',', str);
str += ")\n\n";
}
}
示例8: deleteSelected
void deleteSelected()
{
OovString selStr = mPathMapList.getSelected();
if(selStr.length() > 0)
{
OovStringVec vec = selStr.split(" > ");
if(vec.size() == 2)
{
mPathMapList.removeSelected();
mDiagramPathMap->remove(ZonePathReplaceItem(vec[0], vec[1]));
}
}
}
示例9: getComponentIndex
size_t ComponentGraph::getComponentIndex(OovStringVec const &compPaths,
OovStringRef const dir)
{
size_t compIndex = NO_INDEX;
for(size_t i=0; i<compPaths.size(); i++)
{
std::string const &compPath = compPaths[i];
if(compPath.compare(dir) == 0)
{
compIndex = i;
break;
}
}
return compIndex;
}
示例10: isOutputOld
bool FileStat::isOutputOld(OovStringRef const outputFn,
OovStringVec const &inputs, size_t *oldIndex)
{
bool old = false;
for(size_t i=0; i<inputs.size(); i++)
{
if(isOutputOld(outputFn, inputs[i]))
{
old = true;
if(oldIndex)
*oldIndex = i;
break;
}
}
return old;
}
示例11: getArg
// First arg at index 0 is the command.
OovString OovIpcMsg::getArg(size_t argNum) const
{
OovStringVec args = split(',');
OovString arg;
#if(DEBUG_IPC)
if(argNum == 0)
{
FILE *fp = fopen("IPC.txt", "a");
fprintf(fp, "RCV: %s\n", cmdStr.getStr());
fclose(fp);
}
#endif
if(argNum < args.size())
{
arg = args[argNum];
}
return arg;
}
示例12: 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;
}
示例13: drawClass
GraphSize OperationDrawer::drawClass(DiagramDrawer &drawer, const OperationClass &node,
const OperationDrawOptions & /*options*/, bool draw)
{
GraphPoint startpos = node.getPosition();
const ModelType *type = node.getType();
OovStringRef const typeName = type->getName();
int rectx = 0;
int recty = 0;
const ModelClassifier *classifier = type->getClass();
if(classifier)
{
if(draw)
{
drawer.groupText(true, false);
}
OovStringVec strs;
std::vector<GraphPoint> positions;
strs.push_back(typeName);
splitStrings(strs, 30, 40);
for(auto const &str : strs)
{
recty += mCharHeight + (mPad * 2);
positions.push_back(GraphPoint(startpos.x+mPad, startpos.y + recty - mPad));
int curx = static_cast<int>(drawer.getTextExtentWidth(str)) + mPad*2;
if(curx > rectx)
rectx = curx;
}
if(draw)
{
drawer.groupShapes(true, Color(0,0,0), Color(245,245,255));
drawer.drawRect(GraphRect(startpos.x, startpos.y, rectx, recty));
drawer.groupShapes(false, Color(0,0,0), Color(245,245,255));
for(size_t i=0; i<strs.size(); i++)
{
drawer.drawText(positions[i], strs[i]);
}
drawer.groupText(false, false);
}
}
return GraphSize(rectx, recty);
}
示例14: getDiagResults
OovStringVec Tokenizer::getDiagResults()
{
OovStringVec diagResults;
if(mTransUnit)
{
int numDiags = clang_getNumDiagnostics(mTransUnit);
for (int i = 0; i<numDiags && diagResults.size() < 10; i++)
{
CXDiagnostic diag = clang_getDiagnostic(mTransUnit, i);
// CXDiagnosticSeverity sev = clang_getDiagnosticSeverity(diag);
// if(sev >= CXDiagnostic_Error)
OovString diagStr = getDisposedString(clang_formatDiagnostic(diag,
clang_defaultDiagnosticDisplayOptions()));
if(diagStr.find(mSourceFilename) != std::string::npos)
{
diagResults.push_back(diagStr);
}
}
}
return diagResults;
}
示例15: editVariable
void BuildVariablesDialog::editVariable()
{
OovStringVec vars = mVarListTreeView.getSelected();
if(vars.size() > 0)
{
OovString var = vars[0];
if(sBuildVarSettingsDialog->editVariable(var))
{
mVarListTreeView.removeSelected();
GuiTreeItem parent;
mVarListTreeView.appendText(parent, var);
BuildVariable origBuildVar;
origBuildVar.initVarFromString(vars[0]);
mProject.removeName(origBuildVar.getVarFilterName());
BuildVariable newBuildVar;
newBuildVar.initVarFromString(var);
mProject.setNameValue(newBuildVar.getVarFilterName(), newBuildVar.getVarValue());
}
}
}