MCPcopy Create free account
hub / github.com/catboost/catboost / IsSubpathOf

Method IsSubpathOf

util/folder/path.cpp:36–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36bool 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
55bool TFsPath::IsNonStrictSubpathOf(const TFsPath& that) const {
56 const TSplit& split = GetSplit();

Callers 3

RelativeToMethod · 0.95
IsContainerOfMethod · 0.80
Y_UNIT_TESTFunction · 0.80

Calls 5

GetSplitMethod · 0.80
equalFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected