forked from qt-creator/qt-creator
Utils: add absoluteFilePath convenience function to FilePath
Change-Id: I870c3e8fce908d3c5830d2716b525cb12b701503 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -878,6 +878,13 @@ FilePath FilePath::absolutePath() const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FilePath FilePath::absoluteFilePath() const
|
||||||
|
{
|
||||||
|
FilePath result = *this;
|
||||||
|
result.m_data = QFileInfo(m_data).absoluteFilePath();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/// Constructs an absolute FilePath from this path which
|
/// Constructs an absolute FilePath from this path which
|
||||||
/// is interpreted as being relative to \a anchor.
|
/// is interpreted as being relative to \a anchor.
|
||||||
FilePath FilePath::absoluteFromRelativePath(const FilePath &anchor) const
|
FilePath FilePath::absoluteFromRelativePath(const FilePath &anchor) const
|
||||||
|
@@ -119,6 +119,7 @@ public:
|
|||||||
|
|
||||||
FilePath parentDir() const;
|
FilePath parentDir() const;
|
||||||
FilePath absolutePath() const;
|
FilePath absolutePath() const;
|
||||||
|
FilePath absoluteFilePath() const;
|
||||||
FilePath absoluteFromRelativePath(const FilePath &anchor) const;
|
FilePath absoluteFromRelativePath(const FilePath &anchor) const;
|
||||||
|
|
||||||
bool operator==(const FilePath &other) const;
|
bool operator==(const FilePath &other) const;
|
||||||
|
Reference in New Issue
Block a user