本文整理汇总了C++中Path::HasVolume方法的典型用法代码示例。如果您正苦于以下问题:C++ Path::HasVolume方法的具体用法?C++ Path::HasVolume怎么用?C++ Path::HasVolume使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Path
的用法示例。
在下文中一共展示了Path::HasVolume方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindFilePath
Path FileMessageHandler::FindFilePath(const list<Path>& lps, const Path& f)
{
// check the current working dir (or full path if supplied) first
// note that if the file doesn't have a path and it is found in the
// CWD, the CWD is not returned as part of the path.
if(CheckIfFileExists(f) == true)
return f;
// if the path is absolute there's no point in checking the include paths;
// given it wasn't found above we can just return an empty path
if(f.HasVolume() == true)
return Path();
Path path(f);
for(list<Path>::const_iterator i(lps.begin()); i != lps.end(); i++)
{
Path path (*i, f);
if(CheckIfFileExists(path) == true)
return path;
}
// not found so return empty path
return Path();
}
示例2: TestPath
/////////////////////////////////////////////////////////////////////////
// return true if the path component of file is equal to the path component
// of path. will also return true if recursive is true and path is a parent
// of file. does not support relative paths, and will perform case-sensitive
// comparisons.
bool vfeUnixSession::TestPath (const Path& path, const Path& file, bool recursive) const
{
// we don't support relative paths
if (path.HasVolume() == false || file.HasVolume() == false)
return (false);
if (StrCompare(path.GetVolume(), file.GetVolume()) == false)
return (false);
vector<UCS2String> pc = path.GetAllFolders();
vector<UCS2String> fc = file.GetAllFolders();
if (fc.size() < pc.size())
return (false) ;
for (int i = 0 ; i < pc.size(); i++)
if (StrCompare(fc[i], pc[i]) == false)
return (false) ;
return (fc.size() == pc.size() ? true : recursive);
}