OGRE 2.1
Object-Oriented Graphics Rendering Engine
|
Utility class for manipulating Strings. More...
#include <OgreString.h>
Static Public Member Functions | |
static bool | endsWith (const String &str, const String &pattern, bool lowerCase=true) |
Returns whether the string ends with the pattern passed in. | |
static bool | match (const String &str, const String &pattern, bool caseSensitive=true) |
Simple pattern-matching routine allowing a wildcard pattern. | |
static String | normalizeFilePath (const String &init, bool makeLowerCase=true) |
Returns a normalized version of a file path This method can be used to make file path strings which point to the same directory but have different texts to be normalized to the same text. | |
static const String | replaceAll (const String &source, const String &replaceWhat, const String &replaceWithWhat) |
Replace all instances of a sub-string with a another sub-string. | |
static vector< String >::type | split (const String &str, const String &delims="\t\n ", unsigned int maxSplits=0, bool preserveDelims=false) |
Returns a StringVector that contains all the substrings delimited by the characters in the passed delims argument. | |
static void | splitBaseFilename (const Ogre::String &fullName, Ogre::String &outBasename, Ogre::String &outExtention) |
Method for splitting a filename into the base name and extension. | |
static void | splitFilename (const String &qualifiedName, String &outBasename, String &outPath) |
Method for splitting a fully qualified filename into the base name and path. | |
static void | splitFullFilename (const Ogre::String &qualifiedName, Ogre::String &outBasename, Ogre::String &outExtention, Ogre::String &outPath) |
Method for splitting a fully qualified filename into the base name, extension and path. | |
static String | standardisePath (const String &init) |
Method for standardising paths - use forward slashes only, end with slash. | |
static bool | startsWith (const String &str, const String &pattern, bool lowerCase=true) |
Returns whether the string begins with the pattern passed in. | |
static vector< String >::type | tokenise (const String &str, const String &delims="\t\n ", const String &doubleDelims="\"", unsigned int maxSplits=0) |
Returns a StringVector that contains all the substrings delimited by the characters in the passed delims argument, or in the doubleDelims argument, which is used to include (normal) delimeters in the tokenised string. | |
static void | toLowerCase (String &str) |
Lower-cases all the characters in the string. | |
static void | toTitleCase (String &str) |
Upper-cases the first letter of each word. | |
static void | toUpperCase (String &str) |
Upper-cases all the characters in the string. | |
static void | trim (String &str, bool left=true, bool right=true) |
Removes any whitespace characters, be it standard space or TABs and so on. | |
Utility class for manipulating Strings.
|
static |
Returns whether the string ends with the pattern passed in.
pattern | The pattern to compare with. |
lowerCase | If true, the end of the string will be lower cased before comparison, pattern should also be in lower case. |
|
static |
Simple pattern-matching routine allowing a wildcard pattern.
str | String to test |
pattern | Pattern to match against; can include simple '*' wildcards |
caseSensitive | Whether the match is case sensitive or not |
|
static |
Returns a normalized version of a file path This method can be used to make file path strings which point to the same directory but have different texts to be normalized to the same text.
The function:
init | The file path to normalize. |
makeLowerCase | If true, transforms all characters in the string to lowercase. |
|
static |
Replace all instances of a sub-string with a another sub-string.
source | Source string |
replaceWhat | Sub-string to find and replace |
replaceWithWhat | Sub-string to replace with (the new sub-string) |
|
static |
Returns a StringVector that contains all the substrings delimited by the characters in the passed delims
argument.
delims | A list of delimiter characters to split by |
maxSplits | The maximum number of splits to perform (0 for unlimited splits). If this parameters is > 0, the splitting process will stop after this many splits, left to right. |
preserveDelims | Flag to determine if delimiters should be saved as substrings |
Referenced by Ogre::DriverVersion::fromString().
|
static |
Method for splitting a filename into the base name and extension.
|
static |
Method for splitting a fully qualified filename into the base name and path.
|
static |
Method for splitting a fully qualified filename into the base name, extension and path.
Method for standardising paths - use forward slashes only, end with slash.
|
static |
Returns whether the string begins with the pattern passed in.
pattern | The pattern to compare with. |
lowerCase | If true, the start of the string will be lower cased before comparison, pattern should also be in lower case. |
|
static |
Returns a StringVector that contains all the substrings delimited by the characters in the passed delims
argument, or in the doubleDelims
argument, which is used to include (normal) delimeters in the tokenised string.
For example, "strings like this".
delims | A list of delimiter characters to split by |
doubleDelims | A list of double delimeters characters to tokenise by |
maxSplits | The maximum number of splits to perform (0 for unlimited splits). If this parameters is > 0, the splitting process will stop after this many splits, left to right. |
Lower-cases all the characters in the string.
Upper-cases the first letter of each word.
Upper-cases all the characters in the string.
Removes any whitespace characters, be it standard space or TABs and so on.