本文整理汇总了C++中StringList::AddString方法的典型用法代码示例。如果您正苦于以下问题:C++ StringList::AddString方法的具体用法?C++ StringList::AddString怎么用?C++ StringList::AddString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringList
的用法示例。
在下文中一共展示了StringList::AddString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessCommand
void CommandData::ProcessCommand()
{
#ifndef SFX_MODULE
const wchar *SingleCharCommands=L"FUADPXETK";
if (Command[0]!=0 && Command[1]!=0 && wcschr(SingleCharCommands,Command[0])!=NULL || *ArcName==0)
OutHelp(*Command==0 ? RARX_SUCCESS:RARX_USERERROR); // Return 'success' for 'rar' without parameters.
#ifdef _UNIX
if (GetExt(ArcName)==NULL && (!FileExist(ArcName) || IsDir(GetFileAttr(ArcName))))
wcsncatz(ArcName,L".rar",ASIZE(ArcName));
#else
if (GetExt(ArcName)==NULL)
wcsncatz(ArcName,L".rar",ASIZE(ArcName));
#endif
if (wcschr(L"AFUMD",*Command)==NULL)
{
if (GenerateArcName)
GenerateArchiveName(ArcName,ASIZE(ArcName),GenerateMask,false);
StringList ArcMasks;
ArcMasks.AddString(ArcName);
ScanTree Scan(&ArcMasks,Recurse,SaveSymLinks,SCAN_SKIPDIRS);
FindData FindData;
while (Scan.GetNext(&FindData)==SCAN_SUCCESS)
AddArcName(FindData.Name);
}
else
AddArcName(ArcName);
#endif
switch(Command[0])
{
case 'P':
case 'X':
case 'E':
case 'T':
case 'I':
{
CmdExtract Extract(this);
Extract.DoExtract();
}
break;
#ifndef SILENT
case 'V':
case 'L':
ListArchive(this);
break;
default:
OutHelp(RARX_USERERROR);
#endif
}
if (!BareOutput)
mprintf(L"\n");
}
示例2: ProcessCommand
void CommandData::ProcessCommand()
{
#ifndef SFX_MODULE
if (Command[1] && strchr("FUADPXETK",*Command)!=NULL || *ArcName==0)
OutHelp();
#ifdef _UNIX
if (GetExt(ArcName)==NULL && (!FileExist(ArcName) || IsDir(GetFileAttr(ArcName))))
strcat(ArcName,".rar");
#else
if (GetExt(ArcName)==NULL)
strcat(ArcName,".rar");
#endif
if (strchr("AFUMD",*Command)==NULL)
{
StringList ArcMasks;
ArcMasks.AddString(ArcName);
ScanTree Scan(&ArcMasks,Recurse,SaveLinks,SCAN_SKIPDIRS);
FindData FindData;
while (Scan.GetNext(&FindData)==SCAN_SUCCESS)
AddArcName(FindData.Name,FindData.NameW);
}
else
AddArcName(ArcName,NULL);
#endif
switch(Command[0])
{
case 'P':
case 'X':
case 'E':
case 'T':
case 'I':
{
CmdExtract Extract;
Extract.DoExtract(this);
}
break;
#if !defined(GUI) && !defined(SILENT)
case 'V':
case 'L':
ListArchive(this);
break;
default:
OutHelp();
#endif
}
#ifndef GUI
if (!BareOutput)
mprintf("\n");
#endif
}
示例3: ProcessCommand
void CommandData::ProcessCommand()
{
#ifndef SFX_MODULE
const char *SingleCharCommands="FUADPXETK";
if (Command[1] && strchr(SingleCharCommands,*Command)!=NULL || *ArcName==0)
OutHelp();
//get filename *ArcName
#ifdef _UNIX
if (GetExt(ArcName)==NULL && (!FileExist(ArcName) || IsDir(GetFileAttr(ArcName))))
strcat(ArcName,".rar");
#endif
//printf("test4 %c %s\n",*Command,ArcName);
//找文件,将ArcName传到FindData.Name
if (strchr("AFUMD",*Command)==NULL)
{
StringList ArcMasks;
ArcMasks.AddString(ArcName);
ScanTree Scan(&ArcMasks,Recurse,SaveLinks,SCAN_SKIPDIRS);
FindData FindData;
while (Scan.GetNext(&FindData)==SCAN_SUCCESS)
AddArcName(FindData.Name,FindData.NameW); //FindData.Name "ere.rar"
}
#endif
switch(Command[0])
{
case 'P':
case 'X':
case 'E':
case 'T':
case 'I':
{
printf("\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n");
CmdExtract Extract;
Extract.DoExtract(this);
printf("\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n");
}
break;
#ifndef SILENT
case 'V':
case 'L':
ListArchive(this);
break;
default:
OutHelp();
#endif
}
if (!BareOutput)
mprintf("\n");
}