47 #include "EST_Pathname.h"
49 void EST_Pathname::setup(
void)
53 int EST_Pathname::is_absolute(
void)
const
55 return length()>0 && (*this)(0) ==
'/';
58 int EST_Pathname::is_dirname(
void)
const
69 if ((pos=
index(
"/", -1)) >=0)
115 return EST_Pathname::construct(dir, filename);
123 if ((dir = opendir(this->as_directory()))!=NULL)
125 struct dirent *entry;
127 while ((entry = readdir(dir)) != NULL)
132 if (check_for_directories &&
134 (buf.st_mode & S_IFDIR))
135 list.
append(name.as_directory());
146 {
return EST_Pathname::append(p, addition); }
149 {
return EST_Pathname::append(p, addition); }
153 {
EST_String q = EST_Pathname::append(p, addition);
return q; }
155 {
EST_String q = EST_Pathname::append(p, addition);
return q; }
160 if (addition.is_absolute())
173 EST_String EST_Pathname::extension(
void)
const
192 result = result.after(
index(
"/",-1));
196 EST_String EST_Pathname::basename(
int remove_all)
const
198 EST_String result(this->as_file().filename());
202 if (result.contains(
"."))
203 result = result.before(
".");