22 #include <utl/FileName.h>
23 #include <boost/filesystem/path.hpp>
26 namespace fs = boost::filesystem;
35 const fs::path head = thePath.branch_path();
36 #if BOOST_FILESYSTEM_VERSION < 3
37 const string tail = thePath.leaf();
39 const string tail = thePath.leaf().string();
41 return head / tail.substr(0, tail.rfind(
"."));
48 #if BOOST_FILESYSTEM_VERSION < 3
49 const string tail = thePath.leaf();
51 const string tail = thePath.leaf().string();
53 return tail.substr(0, tail.rfind(
"."));
60 #if BOOST_FILESYSTEM_VERSION < 3
61 const string tail = thePath.leaf();
63 const string tail = thePath.leaf().string();
65 const string::size_type pos = tail.rfind(
".");
66 if (pos != string::npos)
67 return tail.substr(pos, tail.size());
73 operator+(
const fs::path& thePath,
const string& extra)
75 const fs::path head = thePath.branch_path();
76 #if BOOST_FILESYSTEM_VERSION < 3
77 const string tail = thePath.leaf() + extra;
79 const string tail = thePath.leaf().string() + extra;
91 return !stat(filename.c_str(), &buffer);
fs::path operator+(const fs::path &thePath, const string &extra)
bool Exists(const string &filename)
std::string BareFileName(const fs::path &thePath)
fs::path BareFilePath(const fs::path &thePath)
std::string FileExtension(const fs::path &thePath)