本文整理汇总了C++中_List::countitems方法的典型用法代码示例。如果您正苦于以下问题:C++ _List::countitems方法的具体用法?C++ _List::countitems怎么用?C++ _List::countitems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_List
的用法示例。
在下文中一共展示了_List::countitems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadModelList
void ReadModelList(void)
{
if (templateModelList.lLength > 0) return;
_String modelListFile (_HYStandardDirectory (HY_HBL_DIRECTORY_TEMPLATE_MODELS) & "models.lst");
FILE* modelList = doFileOpen (modelListFile.getStr(),"rb");
if (!modelList) {
return;
}
_String theData (modelList);
fclose (modelList);
if (theData.sLength) {
_ElementaryCommand::ExtractConditions(theData,0,templateModelList);
for (unsigned long i = 0; i<templateModelList.countitems(); i++) {
_String* thisString = (_String*)templateModelList(i);
_List thisModel;
_ElementaryCommand::ExtractConditions(*thisString,thisString->FirstNonSpaceIndex(),thisModel,',');
if (thisModel.lLength!=5) {
templateModelList.Delete(i);
i--;
continue;
}
for (long j = 0; j<5; j++) {
((_String*)thisModel(j))->StripQuotes();
}
((_String*)thisModel(0))->UpCase();
templateModelList.Replace(i,&thisModel,true);
}
}
}
示例2: fopen
//__________________________________________________________________________________
void ReadInTemplateFiles(void)
{
_String fileIndex;
fileIndex = *((_String*)pathNames(0)) &"TemplateBatchFiles/files.lst";
FILE* modelList = fopen (fileIndex.getStr(),"r");
if (!modelList)
{
fileIndex = baseArgDir&"TemplateBatchFiles/files.lst";
modelList = fopen (fileIndex.getStr(),"r");
if (!modelList)
return;
}
else
baseArgDir = *((_String*)pathNames(0));
fseek (modelList,0,SEEK_END);
unsigned long fLength = ftell(modelList);
if (fLength)
{
rewind (modelList);
_String theData (fLength);
fread (theData.getStr(),sizeof (char), fLength, modelList);
_ElementaryCommand::ExtractConditions(theData,0,availableTemplateFiles);
for (long i = 0; i<availableTemplateFiles.countitems(); i++)
{
_String* thisString = (_String*)availableTemplateFiles(i);
_List thisFile;
_ElementaryCommand::ExtractConditions(*thisString,thisString->FirstNonSpaceIndex(),thisFile,',');
if (thisFile.lLength!=3)
{
availableTemplateFiles.Delete(i);
i--;
continue;
}
for (long j = 0; j<3; j++)
((_String*)thisFile(j))->StripQuotes();
availableTemplateFiles.Replace(i,&thisFile,true);
}
}
}