MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / __parent_path

Method __parent_path

system/lib/libcxx/src/filesystem/path.cpp:102–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102string_view_t path::__parent_path() const {
103 if (empty())
104 return {};
105 // Determine if we have a root path but not a relative path. In that case
106 // return *this.
107 {
108 auto PP = PathParser::CreateBegin(__pn_);
109 if (ConsumeRootDir(&PP))
110 return __pn_;
111 }
112 // Otherwise remove a single element from the end of the path, and return
113 // a string representing that path
114 {
115 auto PP = PathParser::CreateEnd(__pn_);
116 --PP;
117 if (PP.RawEntry.data() == __pn_.data())
118 return {};
119 --PP;
120 return createView(__pn_.data(), &PP.RawEntry.back());
121 }
122}
123
124string_view_t path::__filename() const {
125 if (empty())

Callers

nothing calls this directly

Calls 5

ConsumeRootDirFunction · 0.85
createViewFunction · 0.85
emptyFunction · 0.50
dataMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected