本文整理汇总了C++中Path::MakePretty方法的典型用法代码示例。如果您正苦于以下问题:C++ Path::MakePretty方法的具体用法?C++ Path::MakePretty怎么用?C++ Path::MakePretty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Path
的用法示例。
在下文中一共展示了Path::MakePretty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTmpPath
const Path Instance::GetTmpPath(GenericString file)
{
Path path;
path.Reserve( 255 );
if (uint length = ::GetTempPath( path.Capacity() + 1, path.Ptr() ))
{
if (length > path.Capacity() + 1)
{
path.Reserve( length - 1 );
length = ::GetTempPath( path.Capacity() + 1, path.Ptr() );
}
if (length)
path = GetLongPath( path.Ptr() );
}
if (path.Length())
path.MakePretty( true );
else
path << ".\\";
if (file.Empty())
file = L"nestopia.tmp";
path << file;
return path;
}
示例2: SelectDirectory
const Path Browser::SelectDirectory()
{
Path path;
path.Reserve( MAX_PATH*2 );
Object::Pod<BROWSEINFO> bi;
bi.hwndOwner = Application::Instance::GetActiveWindow();
bi.pszDisplayName = path.Ptr();
bi.ulFlags = BIF_RETURNONLYFSDIRS;
if (LPITEMIDLIST const idl = ::SHBrowseForFolder( &bi ))
{
if (::SHGetPathFromIDList( idl, path.Ptr() ) && path.Validate())
path.MakePretty( true );
else
path.Clear();
IMalloc* pMalloc;
if (SUCCEEDED(::SHGetMalloc( &pMalloc )))
{
pMalloc->Free( idl );
pMalloc->Release();
}
}
else
{
path.Clear();
}
return path;
}
示例3: GetLongPath
const Path Instance::GetLongPath(wcstring const shortPath)
{
Path longPath;
longPath.Reserve( 255 );
uint length = ::GetLongPathName( shortPath, longPath.Ptr(), longPath.Capacity() + 1 );
if (length > longPath.Capacity() + 1)
{
longPath.Reserve( length - 1 );
length = ::GetLongPathName( shortPath, longPath.Ptr(), longPath.Capacity() + 1 );
}
if (!length)
return shortPath;
const wchar_t slashed = GenericString(shortPath).Back();
longPath.ShrinkTo( length );
longPath.MakePretty( slashed == '\\' || slashed == '/' );
return longPath;
}