// if the filename is an absolute path, just return it // otherwise, make it absolute (relative to base dir) and return that // // note: if base dir is not absolute, first make it absolute via toAbsolutePath(base) std::string FileUtils::toAbsolutePath(const std::string& filename, const std::string base) { const std::string newbase = toAbsolutePath(base); #if BOOST_VERSION >= 104600 && BOOST_FILESYSTEM_VERSION >= 3 const boost::filesystem::path p = boost::filesystem::absolute(filename, newbase); #else const boost::filesystem::path p = boost::filesystem::complete(filename, newbase); #endif return p.string(); }
// if the filename is an absolute path, just return it // otherwise, make it absolute (relative to base dir) and return that // // note: if base dir is not absolute, first make it absolute via // toAbsolutePath(base) string toAbsolutePath(const string& filename, const string base) { const string newbase = toAbsolutePath(base); return pdalboost::filesystem::absolute(filename, newbase).string(); }