本文整理汇总了C++中Archive::IsArchive方法的典型用法代码示例。如果您正苦于以下问题:C++ Archive::IsArchive方法的具体用法?C++ Archive::IsArchive怎么用?C++ Archive::IsArchive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Archive
的用法示例。
在下文中一共展示了Archive::IsArchive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VolNameToFirstName
// Get the name of first volume. Return the leftmost digit of volume number.
wchar* VolNameToFirstName(const wchar *VolName,wchar *FirstName,size_t MaxSize,bool NewNumbering)
{
if (FirstName!=VolName)
wcsncpyz(FirstName,VolName,MaxSize);
wchar *VolNumStart=FirstName;
if (NewNumbering)
{
wchar N='1';
// From the rightmost digit of volume number to the left.
for (wchar *ChPtr=GetVolNumPart(FirstName);ChPtr>FirstName;ChPtr--)
if (IsDigit(*ChPtr))
{
*ChPtr=N; // Set the rightmost digit to '1' and others to '0'.
N='0';
}
else
if (N=='0')
{
VolNumStart=ChPtr+1; // Store the position of leftmost digit in volume number.
break;
}
}
else
{
// Old volume numbering scheme. Just set the extension to ".rar".
SetExt(FirstName,L"rar",MaxSize);
VolNumStart=GetExt(FirstName);
}
if (!FileExist(FirstName))
{
// If the first volume, which name we just generated, is not exist,
// check if volume with same name and any other extension is available.
// It can help in case of *.exe or *.sfx first volume.
wchar Mask[NM];
wcsncpyz(Mask,FirstName,ASIZE(Mask));
SetExt(Mask,L"*",ASIZE(Mask));
FindFile Find;
Find.SetMask(Mask);
FindData FD;
while (Find.Next(&FD))
{
Archive Arc;
if (Arc.Open(FD.Name,0) && Arc.IsArchive(true) && Arc.FirstVolume)
{
wcsncpyz(FirstName,FD.Name,MaxSize);
break;
}
}
}
return VolNumStart;
}
示例2: VolNameToFirstName
char* VolNameToFirstName(const char *VolName,char *FirstName,bool NewNumbering)
{
if (FirstName!=VolName)
strcpy(FirstName,VolName);
char *VolNumStart=FirstName;
if (NewNumbering)
{
int N='1';
for (char *ChPtr=GetVolNumPart(FirstName);ChPtr>FirstName;ChPtr--)
if (isdigit(*ChPtr))
{
*ChPtr=N;
N='0';
}
else
if (N=='0')
{
VolNumStart=ChPtr+1;
break;
}
}
else
{
SetExt(FirstName,"rar");
VolNumStart=GetExt(FirstName);
}
if (!FileExist(FirstName))
{
char Mask[NM];
strcpy(Mask,FirstName);
SetExt(Mask,"*");
FindFile Find;
Find.SetMask(Mask);
struct FindData FD;
while (Find.Next(&FD))
{
Archive Arc;
if (Arc.Open(FD.Name,FD.NameW) && Arc.IsArchive(true) && !Arc.NotFirstVolume)
{
strcpy(FirstName,FD.Name);
break;
}
}
}
return(VolNumStart);
}