5 #ifndef __IRR_CORE_UTIL_H_INCLUDED__ 6 #define __IRR_CORE_UTIL_H_INCLUDED__ 74 while ( *
p !=
'/' && *
p !=
'\\' &&
p !=
s )
94 if ( filename[i] ==
'/' || filename[i] ==
'\\' )
96 if ( --pathCount <= 0 )
104 filename [ i + 1 ] = 0;
122 while ( (pos =
path.findNext (
'/', pos )) >= 0 )
129 while ( (pos = file.
findNext (
'/', pos )) >= 0 )
148 if (
name[i] ==
'.' )
152 *extension =
name.subString ( extpos + 1,
name.size() - (extpos + 1), make_lower );
155 if (
name[i] ==
'/' ||
name[i] ==
'\\' )
158 *filename =
name.subString ( i + 1, extpos - (i + 1), make_lower );
161 *
path =
name.subString ( 0, i + 1, make_lower );
162 path->replace (
'\\',
'/' );
169 *filename =
name.subString ( 0, extpos, make_lower );
183 if ( !filename.empty() )
185 if ( !extension.empty() )
198 inline s32 isspace(
s32 c) {
return c ==
' ' ||
c ==
'\f' ||
c ==
'\n' ||
c ==
'\r' ||
c ==
'\t' ||
c ==
'\v'; }
core::string< fschar_t > path
Type used for all file system related strings.
u32 size() const
Returns length of the string's content.
bool hasFileExtension(const io::path &filename, const io::path &ext0, const io::path &ext1="", const io::path &ext2="")
search if a filename has a proper extension
bool equals_substring_ignore_case(const string< T, TAlloc > &other, const s32 sourcePos=0) const
Compares the strings ignoring case.
s32 findLast(T c, s32 start=-1) const
finds last occurrence of character in string
s32 isdigit(s32 c)
some standard function ( to remove dependencies )
GLuint const GLchar * name
Everything in the Irrlicht Engine can be found in this namespace.
s32 isInSameDirectory(const io::path &path, const io::path &file)
io::path & getFileNameExtension(io::path &dest, const io::path &source)
get the filename extension from a file path
io::path & deletePathFromFilename(io::path &filename)
delete path from filename
signed int s32
32 bit signed variable.
const T * c_str() const
Returns character string.
GLsizei GLsizei GLchar * source
s32 isFileExtension(const io::path &filename, const io::path &ext0, const io::path &ext1, const io::path &ext2)
search if a filename has a proper extension
string< T > subString(u32 begin, s32 length, bool make_lower=false) const
Returns a substring.
GLsizei const GLchar *const * path
io::path & deletePathFromPath(io::path &filename, s32 pathCount)
trim paths
s32 findNext(T c, u32 startPos) const
finds next occurrence of character in string
string< T, TAlloc > & validate()
verify the existing string.
io::path & cutFilenameExtension(io::path &dest, const io::path &source)
cut the filename extension from a source file path and store it in a dest file path
char fschar_t
Type name for character type used by the file system.