4 * Created on: Sep 1, 2012
17 string Dirname(const string &path) {
19 char *str(new char[path.size() + 1]);
20 std::memcpy(str, path.c_str(), path.size());
21 str[path.size()] = '\0';
22 string dn(dirname(str));
27 string CatPath(const string &lhs, const string &rhs) {
30 if (!path.empty() && path[path.size() - 1] != '/') {
33 if (!rhs.empty() && rhs[0] == '/') {
34 path.append(rhs, 1, string::npos);