diff options
Diffstat (limited to 'src/utility/path.cpp')
| -rw-r--r-- | src/utility/path.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utility/path.cpp b/src/utility/path.cpp index 76a938e3..282af12e 100644 --- a/src/utility/path.cpp +++ b/src/utility/path.cpp @@ -192,6 +192,20 @@ const bool path::isDirectParentOf(const path& p) const } +const bool path::isParentOf(const path& p) const +{ + if (p.getSize() < getSize() + 1) + return (false); + + bool equal = true; + + for (list::size_type i = 0 ; equal && i < m_list.size() ; ++i) + equal = (m_list[i] == p.m_list[i]); + + return (equal); +} + + void path::appendComponent(const path::component& c) { m_list.push_back(c); |
