Function gkfs::path::prepend_path(const string&, const char *)
Defined in File path_util.cpp
Function Documentation
-
string gkfs::path::prepend_path(const string &prefix_path, const char *raw_path)
Add path prefix to a given C string.
Returns a string composed by the
prefix_path
followed byraw_path
.This would return the same of:
But it is faster because it avoids to copy thestring(raw_path).append(prefix_path);
raw_path
twice.Time cost approx: O(len(prefix_path)) + 2 O(len(raw_path))
Example:
prepend_path("/tmp/prefix", "./my/path") == "/tmp/prefix/./my/path"