本文整理汇总了C++中PathName::SetPathName方法的典型用法代码示例。如果您正苦于以下问题:C++ PathName::SetPathName方法的具体用法?C++ PathName::SetPathName怎么用?C++ PathName::SetPathName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathName
的用法示例。
在下文中一共展示了PathName::SetPathName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddSpecificIndex
BOOL LibraryFile::AddSpecificIndex(SuperGallery *ParentGal, PathName *Path, SGLibType Type,
StringBase *Description, UINT32 bModified, BOOL bIsWebLib)
{
if(ParentGal == NULL || Path == NULL || !Libraries.IsEmpty() || !Path->IsValid())
{
ERROR3("LibraryFile::AddSpecificIndex - Problems on entry");
return FALSE;
}
// Check the path for the library exists
// if(!SGLibOil::FileExists(Path))
// return FALSE;
// Remember the pathname and type
MyPath = *Path;
MyType = Type;
ParentGallery = ParentGal;
// Create the sub lib
Library *NewSubLib = new Library;
if (NewSubLib != NULL)
{
// Path = "C:\testlib\animals\xarainfo\animals.txt"
// Path of files themselves... FilesPath = "C:\testlib\animals"
NewSubLib->m_bIsWebLib = bIsWebLib;
PathName TmpPath(Path->GetLocation(FALSE));
NewSubLib->SetModified(bModified);
// If it's a root directory we need the slash...
PathName FilesPath;
String_256 TmpRootCheck(TmpPath.GetLocation(TRUE));
if(SGLibOil::IsRootDirectory(&TmpRootCheck))
FilesPath.SetPathName(TmpPath.GetLocation(TRUE));
else
FilesPath.SetPathName(TmpPath.GetLocation(FALSE));
// Default title for the new group
String_256 Desc256;
String_64 Desc64;
if(Description == NULL)
Desc256 = Path->GetTruncatedPath(60);
else
Desc256 = *Description;
Desc256.Left(&Desc64, 64);
// The filename of the index
String_64 IndexFilename(Path->GetFileName(TRUE));
// Add this new index to the library file and scan it in...
if(NewSubLib->Init(ParentGal, &FilesPath, &Desc64, &IndexFilename, Type, FALSE, (Description != NULL)))
{
Libraries.AddTail(NewSubLib);
// Keep track of libraries added for redraw purposes...
AddNewFolderToScrollRedrawSystem(NewSubLib);
return TRUE;
}
else
{
// if there was a problem, don't go round leaving memory everywhere...
delete NewSubLib;
NewSubLib = NULL;
}
}
// Nothing added
return FALSE;
}