14 int ret = remove(filename);
26 fin.open(filename, ios::in);
41 static std::string delim =
"/";
43 std::string filename = fn;
46 int basename_pos = filename.rfind(delim);
49 #if defined(__WIN32__) || defined(__CYGWIN__) || defined(__CYGWIN32__)
50 if ( basename_pos == -1 ) {
51 basename_pos = filename.rfind(
"\\");
56 if (basename_pos != -1) {
57 filename.erase(filename.begin(), filename.begin() + basename_pos + 1);
64 std::string::size_type idx = fn.find_last_of(
".");
67 if (idx != std::string::npos) {
68 ext = fn.substr(idx + 1, fn.size() - idx);
77 std::string::size_type idx = fn.find_last_of(
".");
80 if (idx != std::string::npos) {
81 fname = fn.substr(0, idx);
static int removeFile(const char *filename)
static std::string removeExtension(std::string filename)
static bool fileExists(const char *filename)
static std::string extension(std::string filename)
static std::string basename(std::string filename)