47 #include "EST_System.h"
48 #include "EST_Pathname.h"
50 void EST_Pathname::setup(
void)
52 this->
gsub(
"/",
"\\");
55 int EST_Pathname::is_absolute(
void)
const
57 return length()>0 && (*this)[0] ==
'\\';
60 int EST_Pathname::is_dirname(
void)
const
71 if ((pos=
index(
"\\", -1)) >=0)
113 return EST_Pathname::construct(dir, filename);
118 WIN32_FIND_DATA find_data;
123 handle = FindFirstFile(pattern, &find_data);
124 if (handle != INVALID_HANDLE_VALUE)
129 if (check_for_directories
130 && (find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
131 list.
append(name.as_directory());
134 if (!FindNextFile(handle, &find_data))
143 if (addition.is_absolute())
150 result.EST_String::operator += (add);
156 EST_String EST_Pathname::extension(
void)
const
175 result = result.after(
index(
"\\",-1));
179 EST_String EST_Pathname::basename(
int remove_all)
const
181 EST_String result(this->as_file().filename());
185 if (result.contains(
"."))
186 result = result.before(
".");
192 {
return EST_Pathname::append(p, addition); }
195 {
return EST_Pathname::append(p, addition); }
198 { p = EST_Pathname::append(p, addition);
return p; }
200 { p = EST_Pathname::append(p, addition);
return p; }