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

Method GetName

util/folder/path.cpp:154–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154TString TFsPath::GetName() const {
155 if (!IsDefined()) {
156 return TString();
157 }
158
159 const TSplit& split = GetSplit();
160
161 if (split.size() > 0) {
162 if (split.back() != "..") {
163 return TString(split.back());
164 } else {
165 // cannot just drop last component, because path itself may be a symlink
166 return RealPath().GetName();
167 }
168 } else {
169 if (split.IsAbsolute) {
170 return split.Reconstruct();
171 } else {
172 return Cwd().GetName();
173 }
174 }
175}
176
177TString TFsPath::GetExtension() const {
178 return TString(GetSplit().Extension());

Callers 13

DecodeOpenModeFunction · 0.45
DuplicateMethod · 0.45
LinkToMethod · 0.45
TestOpenMethod · 0.45
TestRWMethod · 0.45
TestLocaleMethod · 0.45
InitMethod · 0.45
TImplMethod · 0.45
TUnbufferedFileInputMethod · 0.45
TUnbufferedFileOutputMethod · 0.45
ContainsMethod · 0.45
CopyToMethod · 0.45

Calls 5

RealPathFunction · 0.85
CwdClass · 0.85
sizeMethod · 0.45
backMethod · 0.45
ReconstructMethod · 0.45

Tested by 3

TestOpenMethod · 0.36
TestRWMethod · 0.36
TestLocaleMethod · 0.36