| 34 | } |
| 35 | |
| 36 | bool TFsPath::IsSubpathOf(const TFsPath& that) const { |
| 37 | const TSplit& split = GetSplit(); |
| 38 | const TSplit& rsplit = that.GetSplit(); |
| 39 | |
| 40 | if (rsplit.IsAbsolute != split.IsAbsolute) { |
| 41 | return false; |
| 42 | } |
| 43 | |
| 44 | if (rsplit.Drive != split.Drive) { |
| 45 | return false; |
| 46 | } |
| 47 | |
| 48 | if (rsplit.size() >= split.size()) { |
| 49 | return false; |
| 50 | } |
| 51 | |
| 52 | return std::equal(rsplit.begin(), rsplit.end(), split.begin()); |
| 53 | } |
| 54 | |
| 55 | bool TFsPath::IsNonStrictSubpathOf(const TFsPath& that) const { |
| 56 | const TSplit& split = GetSplit(); |
no test coverage detected