47 #include "EST_System.h" 50 void EST_Pathname::setup(
void)
52 this->
gsub(
"/",
"\\");
57 return length()>0 && (*this)[0] ==
'\\';
71 if ((pos=
index(
"\\", -1)) >=0)
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))
150 result.EST_String::operator += (
add);
175 result = result.after(
index(
"\\",-1));
185 if (result.contains(
"."))
186 result = result.before(
".");
int contains(const char *s, ssize_t pos=-1) const
Does it contain this substring?
static EST_Pathname construct(EST_Pathname dir, EST_String basename, EST_String extension)
int is_absolute(void) const
static EST_Pathname append(EST_Pathname directory, EST_Pathname addition)
EST_TList< EST_String > entries(int check_for_directories=1) const
size_t index(const char *s, ssize_t pos=0) const
Position of substring (starting at pos)
int is_filename(void) const
EST_Pathname as_file(void) const
int gsub(const char *os, const EST_String &s)
Substitute one string for another.
EST_FVector add(const EST_FVector &a, const EST_FVector &b)
elementwise add
EST_Pathname filename(void) const
void append(const T &item)
add item onto end of list
friend EST_Pathname operator+(const EST_Pathname p, const EST_Pathname addition)
EST_Pathname & operator+=(const char *addition)
EST_String basename(int remove_all=0) const
size_t length(void) const
Length of string ({not} length of underlying chunk)
EST_Pathname directory(void) const
EST_String extension(void) const
int is_dirname(void) const
EST_String after(int pos, int len=1) const
Part after pos+len.
EST_String before(int pos, int len=0) const
Part before position.
EST_Pathname as_directory(void) const