5#ifndef __IRR_CORE_UTIL_H_INCLUDED__
6#define __IRR_CORE_UTIL_H_INCLUDED__
51 dest = source.
subString ( 0, endPos < 0 ? source.
size () : endPos );
74 while ( *p !=
'/' && *p !=
'\\' && p != s )
94 if ( filename[i] ==
'/' || filename[i] ==
'\\' )
96 if ( --pathCount <= 0 )
104 filename [ i + 1 ] = 0;
124 while ( (pos = path.
findNext (
'/', pos )) >= 0 )
131 while ( (pos = file.
findNext (
'/', pos )) >= 0 )
150 if ( name[i] ==
'.' )
154 *extension = name.
subString ( extpos + 1, name.
size() - (extpos + 1), make_lower );
157 if ( name[i] ==
'/' || name[i] ==
'\\' )
160 *filename = name.
subString ( i + 1, extpos - (i + 1), make_lower );
163 *path = name.
subString ( 0, i + 1, make_lower );
171 *filename = name.
subString ( 0, extpos, make_lower );
179 if ( !result.empty() )
182 if ( last != _IRR_TEXT(
'/') && last != _IRR_TEXT(
'\\') )
183 result += _IRR_TEXT(
'/');
185 if ( !filename.empty() )
187 if ( !extension.empty() )
189 if ( !result.empty() && extension[0] != _IRR_TEXT(
'.') )
190 result += _IRR_TEXT(
'.');
203inline s32 isspace(
s32 c) {
return c ==
' ' || c ==
'\f' || c ==
'\n' || c ==
'\r' || c ==
'\t' || c ==
'\v'; }
204inline s32 isupper(
s32 c) {
return c >=
'A' && c <=
'Z'; }
u32 size() const
Returns length of the string's content.
Definition irrString.h:496
string< T, TAlloc > & validate()
verify the existing string.
Definition irrString.h:1262
string< T > subString(u32 begin, s32 length, bool make_lower=false) const
Returns a substring.
Definition irrString.h:906
s32 findLast(T c, s32 start=-1) const
finds last occurrence of character in string
Definition irrString.h:837
string< T, TAlloc > & replace(T toReplace, T replaceWith)
Replaces all characters of a special type with another one.
Definition irrString.h:1022
s32 findNext(T c, u32 startPos) const
finds next occurrence of character in string
Definition irrString.h:822
const T * c_str() const
Returns character string.
Definition irrString.h:510
bool equals_substring_ignore_case(const string< T, TAlloc > &other, const s32 sourcePos=0) const
Compares the strings ignoring case.
Definition irrString.h:550
bool equalsn(const string< T, TAlloc > &other, u32 n) const
compares the first n characters of the strings
Definition irrString.h:584
Basic classes such as vectors, planes, arrays, lists, and so on can be found in this namespace.
Definition aabbox3d.h:15
io::path & deletePathFromPath(io::path &filename, s32 pathCount)
trim paths
Definition coreutil.h:86
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
Definition coreutil.h:41
io::path & getFileNameExtension(io::path &dest, const io::path &source)
get the filename extension from a file path
Definition coreutil.h:56
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
Definition coreutil.h:23
s32 isdigit(s32 c)
some standard function ( to remove dependencies )
Definition coreutil.h:202
io::path & deletePathFromFilename(io::path &filename)
delete path from filename
Definition coreutil.h:67
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
Definition coreutil.h:48
s32 isInSameDirectory(const io::path &path, const io::path &file)
Definition coreutil.h:114
core::string< fschar_t > path
Type used for all file system related strings.
Definition path.h:17
Everything in the Irrlicht Engine can be found in this namespace.
Definition Skylicht.h:33
char fschar_t
Type name for character type used by the file system.
Definition irrTypes.h:158
signed int s32
32 bit signed variable.
Definition irrTypes.h:66