diff --git a/toolbox/toolbox.cpp b/toolbox/toolbox.cpp index e5b4ee1..35b1392 100644 --- a/toolbox/toolbox.cpp +++ b/toolbox/toolbox.cpp @@ -611,86 +611,4 @@ namespace ToolBox { return std::string(tmp); } - /* - * MacOS basically does the absolute/relative paths backwards vs unix. - * - * file -> file - * :dir -> dir - * :dir:file -> dir/file - * volume:file -> /volume/file - */ - #if 0 - std::string UnixToMac(const std::string &path) - { - // ./..., //... etc. - - std::string tmp; - int sep; - - if (path.empty()) return path; - - sep = path.find_first_of('/'); - - if (sep == path.npos) - { - // no sep -- relative file. treat as-is - return path; - } - if (sep == 0) - { - // absolute path -- drop the leading / - // '/' doesn't make sense. - tmp = path.substr(1); - } - else - { - // relative path. - tmp = '/'; - tmp.append(path); - } - - std::replace(tmp.begin(), tmp.end(), '/', ':'); - - return tmp; - } - - - std::string MacToUnix(const std::string &path) - { - std::string tmp; - int sep; - int slash; - - if (path.empty()) return path; - - sep = path.find_first_of(':'); - slash = path.find_first_of('/'); - - // if there's a / prior to the :, assume it's a unix prefix. - if (sep == path.npos) return path; - - if (slash == path.npos || slash > sep) - { - if (sep == 0) - { - // :directory... -> directory - tmp = path.substr(1); - } - else - { - // volume:path... - tmp = '/'; - tmp.append(path); - } - } - else // assume a unix prefix. - { - tmp = path; - } - - std::replace(tmp.begin(), tmp.end(), ':', '/'); - - return tmp; - } - #endif } \ No newline at end of file