MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / splitLastComponent

Method splitLastComponent

src/common/os/posix/path_utils.cpp:126–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void PathUtils::splitLastComponent(PathName& path, PathName& file,
127 const PathName& orgPath)
128{
129 PathName::size_type pos = orgPath.rfind(dir_sep);
130 if (pos == PathName::npos)
131 {
132 path = "";
133 file = orgPath;
134 return;
135 }
136
137 path.erase();
138 path.append(orgPath, 0, pos); // skip the directory separator
139 file.erase();
140 file.append(orgPath, pos + 1, orgPath.length() - pos - 1);
141}
142
143void PathUtils::splitPrefix(PathName& path, PathName& prefix)
144{

Callers

nothing calls this directly

Calls 4

rfindMethod · 0.45
eraseMethod · 0.45
appendMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected