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