本文整理汇总了C++中FileSpec::IsResolved方法的典型用法代码示例。如果您正苦于以下问题:C++ FileSpec::IsResolved方法的具体用法?C++ FileSpec::IsResolved怎么用?C++ FileSpec::IsResolved使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSpec
的用法示例。
在下文中一共展示了FileSpec::IsResolved方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resolved_lhs
//------------------------------------------------------------------
// Equal to operator
//------------------------------------------------------------------
bool
FileSpec::operator== (const FileSpec& rhs) const
{
if (m_filename == rhs.m_filename)
{
if (m_directory == rhs.m_directory)
return true;
// TODO: determine if we want to keep this code in here.
// The code below was added to handle a case where we were
// trying to set a file and line breakpoint and one path
// was resolved, and the other not and the directory was
// in a mount point that resolved to a more complete path:
// "/tmp/a.c" == "/private/tmp/a.c". I might end up pulling
// this out...
if (IsResolved() && rhs.IsResolved())
{
// Both paths are resolved, no need to look further...
return false;
}
FileSpec resolved_lhs(*this);
// If "this" isn't resolved, resolve it
if (!IsResolved())
{
if (resolved_lhs.ResolvePath())
{
// This path wasn't resolved but now it is. Check if the resolved
// directory is the same as our unresolved directory, and if so,
// we can mark this object as resolved to avoid more future resolves
m_is_resolved = (m_directory == resolved_lhs.m_directory);
}
else
return false;
}
FileSpec resolved_rhs(rhs);
if (!rhs.IsResolved())
{
if (resolved_rhs.ResolvePath())
{
// rhs's path wasn't resolved but now it is. Check if the resolved
// directory is the same as rhs's unresolved directory, and if so,
// we can mark this object as resolved to avoid more future resolves
rhs.m_is_resolved = (m_directory == resolved_rhs.m_directory);
}
else
return false;
}
// If we reach this point in the code we were able to resolve both paths
// and since we only resolve the paths if the basenames are equal, then
// we can just check if both directories are equal...
return resolved_lhs.GetDirectory() == resolved_rhs.GetDirectory();
}
return false;
}