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

Method splitLastComponent

src/common/os/win32/path_utils.cpp:109–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void PathUtils::splitLastComponent(PathName& path, PathName& file,
110 const PathName& orgPath)
111{
112 PathName::size_type pos = orgPath.rfind(PathUtils::dir_sep);
113 if (pos == PathName::npos)
114 {
115 pos = orgPath.rfind('/'); // temp hack to make it work with paths,
116 // not expanded by ISC_expand_filename
117 if (pos == PathName::npos)
118 {
119 path = "";
120 file = orgPath;
121 return;
122 }
123 }
124
125 path.erase();
126 path.append(orgPath, 0, pos); // skip the directory separator
127 file.erase();
128 file.append(orgPath, pos + 1, orgPath.length() - pos - 1);
129}
130
131void PathUtils::concatPath(PathName& result,
132 const PathName& first,

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