本文整理汇总了C++中CDatabase::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ CDatabase::GetName方法的具体用法?C++ CDatabase::GetName怎么用?C++ CDatabase::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDatabase
的用法示例。
在下文中一共展示了CDatabase::GetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wmain
int wmain (int argc,wchar_t ** argv)
{
CAppData::stdfunc();
SetRegKey(argc,argv);
if (!SetLanguageSpecifigHandles(argv[0]))
return 1;
CArrayFP<CDatabase*> aDatabases;
WORD wCurrentThread=0;
aDatabases.Add(CDatabase::FromDefaults(TRUE));
aDatabases[0]->SetNamePtr(alloccopy(L"DEFAULTX"));
aDatabases[0]->SetThreadId(wCurrentThread);
int i,helps=0;
#ifndef WIN32
if (getenv("TZ")==NULL)
fprintf(stderr,"Timezone is not set. Database may contain invalid file times.\nFor example type "SET TZ=GMT+1" for central european time.\n");
#endif
for (i=1;i<argc;i++)
{
if (argv[i][0]=='-' || argv[i][0]=='/')
{
switch (argv[i][1])
{
case L'X':
if (argv[i][2]==L'\0')
{
if (i<argc-1)
i++; // RegKeyName already set
}
break;
case 'l':
case 'L':
if (wcsncmp(aDatabases.GetLast()->GetName(),L"PARAMX",6)!=0 &&
wcsncmp(aDatabases.GetLast()->GetName(),L"DEFAULTX",8)!=0)
wprintf(ID2W(IDS_UPDATEDB32CANNOTCHANGELOADED),aDatabases.GetLast()->GetName());
else if (argv[i][2]=='1')
{
aDatabases.GetLast()->AddLocalRoots();
aDatabases.GetLast()->SetNamePtr(alloccopy(L"PARAMX"));
}
else
{
CStringW* pStr;
if (argv[i][2]==L'\0' && i+1<argc)
pStr=new CStringW(argv[++i]);
else
pStr=new CStringW(argv[i]+2);
if ((*pStr)[0]==L'\"')
pStr->DelChar(0);
if (pStr->LastChar()==L'\"')
pStr->DelLastChar();
while (pStr->LastChar()==L'\\')
pStr->DelLastChar();
if (pStr->GetLength()>1)
{
if ((*pStr)[1]==':' && pStr->GetLength()==2)
aDatabases.GetLast()->AddRoot(pStr->GiveBuffer());
else if (FileSystem::IsDirectory(*pStr))
aDatabases.GetLast()->AddRoot(pStr->GiveBuffer());
else
fwprintf(stderr,ID2W(IDS_UPDATEDB32DIRECTORYISNOTVALID),(LPCWSTR)*pStr);
}
else
fwprintf(stderr,ID2W(IDS_UPDATEDB32DIRECTORYISNOTVALID),(LPCWSTR)*pStr);
delete pStr;
aDatabases.GetLast()->SetNamePtr(alloccopy(L"PARAMX"));
}
break;
case 'e':
if (wcsncmp(aDatabases.GetLast()->GetName(),L"PARAMX",6)!=0 &&
wcsncmp(aDatabases.GetLast()->GetName(),L"DEFAULTX",8)!=0)
wprintf(ID2W(IDS_UPDATEDB32CANNOTCHANGELOADED),aDatabases.GetLast()->GetName());
else
{
CStringW* pStr;
if (argv[i][2]=='\0' && i+1<argc)
pStr=new CStringW(argv[++i]);
else
pStr=new CStringW(argv[i]+2);
if ((*pStr)[0]==L'\"')
pStr->DelChar(0);
if (pStr->LastChar()==L'\"')
pStr->DelLastChar();
while (pStr->LastChar()==L'\\')
pStr->DelLastChar();
if (pStr->GetLength()>0)
aDatabases.GetLast()->SetExcludedFiles(*pStr);
aDatabases.GetLast()->SetNamePtr(alloccopy(L"PARAMX"));
}
//.........这里部分代码省略.........