Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CEGUI::TextUtils Class Reference

Text utility support class. This class is all static members. You do not create instances of this class. More...

#include <CEGUITextUtils.h>

Collaboration diagram for CEGUI::TextUtils:

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

String getNextWord (const String &str, String::size_type start_idx=0, const String &delimiters=DefaultWhitespace)
 return a String containing the the next word in a String.
String::size_type getWordStartIdx (const String &str, String::size_type idx)
 Return the index of the first character of the word at idx.
String::size_type getNextWordStartIdx (const String &str, String::size_type idx)
 Return the index of the first character of the word after the word at idx.
void trimLeadingChars (String &str, const String &chars)
 Trim all characters from the set specified in chars from the begining of str.
void trimTrailingChars (String &str, const String &chars)
 Trim all characters from the set specified in chars from the end of str.

Static Public Attributes

const String DefaultWhitespace = (utf8*)" \n\t\r"
 The default set of whitespace.
const String DefaultAlphanumerical = (utf8*)"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
 default set of alphanumericals.
const String DefaultWrapDelimiters = (utf8*)" \n\t\r"
 The default set of word-wrap delimiters.

Detailed Description

Text utility support class. This class is all static members. You do not create instances of this class.

Definition at line 40 of file CEGUITextUtils.h.


Member Function Documentation

String CEGUI::TextUtils::getNextWord const String str,
String::size_type  start_idx = 0,
const String delimiters = DefaultWhitespace
[static]
 

return a String containing the the next word in a String.

This method returns a String object containing the the word, starting at index start_idx, of String str as delimited by the code points specified in string delimiters (or the ends of the input string).

Parameters:
str String object containing the input data.
start_idx index into str where the search for the next word is to begin. Defaults to start of str.
delimiters String object containing the set of delimiter code points to be used when determining the start and end points of a word in string str. Defaults to whitespace.
Returns:
String object containing the next delimiters delimited word from str, starting at index start_idx.

Definition at line 42 of file CEGUITextUtils.cpp.

References CEGUI::String::find_first_not_of(), CEGUI::String::find_first_of(), CEGUI::String::length(), and CEGUI::String::substr().

String::size_type CEGUI::TextUtils::getNextWordStartIdx const String str,
String::size_type  idx
[static]
 

Return the index of the first character of the word after the word at idx.

/note This currently uses DefaultWhitespace and DefaultAlphanumerical to determine groupings for what constitutes a 'word'.

Parameters:
str String containing text.
idx Index into str where search is to begin.
Returns:
Index into str which marks the begining of the word at after the word at index idx. If idx is within the last word, then the return is the last index in str.

Definition at line 103 of file CEGUITextUtils.cpp.

References DefaultAlphanumerical, DefaultWhitespace, CEGUI::String::find(), CEGUI::String::find_first_not_of(), CEGUI::String::find_first_of(), and CEGUI::String::length().

String::size_type CEGUI::TextUtils::getWordStartIdx const String str,
String::size_type  idx
[static]
 

Return the index of the first character of the word at idx.

/note This currently uses DefaultWhitespace and DefaultAlphanumerical to determine groupings for what constitutes a 'word'.

Parameters:
str String containing text.
idx Index into str where search for start of word is to begin.
Returns:
Index into str which marks the begining of the word at index idx.

Definition at line 65 of file CEGUITextUtils.cpp.

References DefaultAlphanumerical, DefaultWhitespace, CEGUI::String::find(), CEGUI::String::find_last_not_of(), CEGUI::String::find_last_of(), CEGUI::String::length(), CEGUI::String::substr(), and trimTrailingChars().

void CEGUI::TextUtils::trimLeadingChars String str,
const String chars
[static]
 

Trim all characters from the set specified in chars from the begining of str.

Parameters:
str String object to be trimmed.
chars String object containing the set of code points to be trimmed.

Definition at line 155 of file CEGUITextUtils.cpp.

References CEGUI::String::erase(), and CEGUI::String::find_first_not_of().

void CEGUI::TextUtils::trimTrailingChars String str,
const String chars
[static]
 

Trim all characters from the set specified in chars from the end of str.

Parameters:
str String object to be trimmed.
chars String object containing the set of code points to be trimmed.

Definition at line 175 of file CEGUITextUtils.cpp.

References CEGUI::String::erase(), CEGUI::String::find_last_not_of(), and CEGUI::String::resize().

Referenced by getWordStartIdx().


Member Data Documentation

const String CEGUI::TextUtils::DefaultAlphanumerical = (utf8*)"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" [static]
 

default set of alphanumericals.

Definition at line 35 of file CEGUITextUtils.cpp.

Referenced by getNextWordStartIdx(), and getWordStartIdx().

const String CEGUI::TextUtils::DefaultWhitespace = (utf8*)" \n\t\r" [static]
 

The default set of whitespace.

Definition at line 34 of file CEGUITextUtils.cpp.

Referenced by getNextWordStartIdx(), and getWordStartIdx().

const String CEGUI::TextUtils::DefaultWrapDelimiters = (utf8*)" \n\t\r" [static]
 

The default set of word-wrap delimiters.

Definition at line 36 of file CEGUITextUtils.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Feb 16 12:41:11 2005 for Crazy Eddies GUI System by  doxygen 1.3.9.1