#include <VisualString.h>
Inherits VizKit::VisualObject.
Inherited by VizKit::VisualStyledString.
List of all members.
Detailed Description
Unicode string without styling or formatting information.
Member Typedef Documentation
VisualStringSubstringPointers can be collected in a vector of structs.
Constructor & Destructor Documentation
| VisualString::VisualString |
( |
|
) |
|
| VisualString::VisualString |
( |
const char *const |
aStringVal, |
|
|
sint32 |
numberOfBytes = -1 | |
|
) |
| | |
A constructor that constructs a VisualString with a pointer to an UTF-8 string and the number of bytes of the string.
- Parameters:
-
| aStringVal | A pointer to the UTF-8 encoded char string value. |
| numberOfBytes | Optional indication of number of bytes of the char string. |
| VisualString::VisualString |
( |
const uint16 *const |
aStringVal, |
|
|
sint32 |
aNumberOfCharacters = -1 | |
|
) |
| | |
A constructor that constructs a VisualString with a pointer to a wchar_t string and the number of characters of the string.
- Parameters:
-
| aStringVal | A pointer to the wchar_t string value. |
| aNumberOfCharacters | The number of characters of the char string. |
| VisualString::VisualString |
( |
ConstStringDataRef |
aStringVal |
) |
|
A constructor that constructs a VisualString from a ConstStringDataRef.
- Parameters:
-
| aStringVal | A string value in ConstStringDataRef data format. |
| VisualString::~VisualString |
( |
|
) |
|
Copy constructor.
- Parameters:
-
Member Function Documentation
| void VisualString::calcStatistics |
( |
void |
|
) |
[private] |
The number of lines and words are calculated and stored internally.
| bool VisualString::characterIsNewlineCharacter |
( |
uint16 |
character |
) |
[private] |
Returns true if character is new line character.
- Parameters:
-
| character | The character to inspect. |
- Returns:
- True if character is new line character, false if not.
| bool VisualString::characterIsWhitespaceCharacter |
( |
uint16 |
character |
) |
[private] |
Returns true if character is whitespace character.
- Parameters:
-
| character | The character to inspect. |
- Returns:
- True if character is whitespace character, false if not.
| void VisualString::clear |
( |
void |
|
) |
|
Resets internally used variables and releases allocated memory.
| void VisualString::copy |
( |
const VisualString & |
other |
) |
[protected] |
Copy method for assignment operator and copy constructor.
- Parameters:
-
Joins the strings of the vector to create a joined string. The items of the vector are separated by newline.
- Parameters:
-
| stringVector | The vector of strings. |
- Returns:
- A VisualString.
Returns one line of the string.
- Parameters:
-
| index | The requested line number. The first line has an index of 0. |
- Returns:
- One line of the string.
Returns one word of the string.
- Parameters:
-
| index | The requested index number. The first word has an index of 0. |
- Returns:
- One word of the string.
| VisualString * VisualString::createWithConstStringDataRef |
( |
ConstStringDataRef |
constStringDataRef |
) |
[static] |
Creates a VisualString with a platform native string data type (CFStringRef on Mac, wchar_t pointer on Windows).
- Parameters:
-
| constStringDataRef | On Mac a CFStringRef, on Windows a wchar_t pointer. |
Creates a VisualString from the contents of a file.
- Parameters:
-
| aFile | Reference to a file. |
Creates a VisualString with the contents of a URL.
- Parameters:
-
| aURL | A URL (aka URI). |
| anId | An identifier. |
| VisualString * VisualString::createWithUTF16Buffer |
( |
const uint16 *const |
aStringVal, |
|
|
uint32 |
aNumberOfCharacters | |
|
) |
| | [static] |
Creates a VisualString from a pointer to an UTF-16 string buffer.
- Parameters:
-
| aStringVal | A pointer to the UTF-16 encoded char string buffer. |
| aNumberOfCharacters | The number of characters of the UTF-16 encoded char string buffer. |
| VisualString * VisualString::createWithUTF16String |
( |
const uint16 *const |
aStringVal |
) |
[static] |
Creates a VisualString from a pointer to an UTF-16 string.
- Parameters:
-
| aStringVal | A pointer to the UTF-16 encoded char string value. |
| VisualString * VisualString::createWithUTF8Buffer |
( |
const char *const |
aStringVal, |
|
|
uint32 |
numberOfBytes | |
|
) |
| | [static] |
Creates a VisualString from a pointer to an UTF-8 string buffer.
- Parameters:
-
| aStringVal | A pointer to the UTF-8 encoded char string buffer. |
| numberOfBytes | The number of bytes of the UTF-8 encoded char string buffer. |
| VisualString * VisualString::createWithUTF8String |
( |
const char *const |
aStringVal |
) |
[static] |
Creates a VisualString from a pointer to an UTF-8 string.
- Parameters:
-
| aStringVal | A pointer to the UTF-8 encoded char string value. |
Notification that the loading of data ended.
- Parameters:
-
| identifier | The identifier of the data load request. |
Reimplemented from VizKit::VisualObject.
| uint16 VisualString::getCharacterAtIndex |
( |
uint32 |
index |
) |
const [private] |
Returns a single character of the string data.
- Parameters:
-
| index | The position of the character in the string. First position starts with 0. |
- Returns:
- A single character of the string data.
| ConstStringDataRef VisualString::getCharactersPointer |
( |
void |
|
) |
const |
Returns a pointer to the internal string data.
- Returns:
- A pointer to the internal string data.
| uint32 VisualString::getNumberOfCharacters |
( |
void |
|
) |
const |
Returns the number of characters of the string.
- Returns:
- The number of characters of the string.
| uint32 VisualString::getNumberOfLines |
( |
void |
|
) |
const |
Returns the number of lines of the string.
- Returns:
- The number of lines of the string.
| uint32 VisualString::getNumberOfNonWhitespaceCharacters |
( |
void |
|
) |
const |
Returns the number of non-whitespace characters of the string.
- Returns:
- The number of non-whitespace characters of the string.
| uint32 VisualString::getNumberOfWords |
( |
void |
|
) |
const |
Returns the number of words of the string.
- Returns:
- The number of words of the string.
Returns a substring of the VisualString.
- Parameters:
-
| startIdx | The 0-based start index of the requested substring. |
| numberOfSubstringCharacters | The number of characters to include in the substring. |
| const uint16 *const VisualString::getUtf16Representation |
( |
void |
|
) |
|
Returns a pointer to a 16-bit buffer with utf-16 encoded string data.
- Returns:
- A pointer to a 16-bit buffer with utf-16 encoded string data.
| const char *const VisualString::getUtf8Representation |
( |
void |
|
) |
|
Returns a pointer to a char buffer with utf-8 encoded string data.
- Returns:
- A pointer to a char buffer with utf-8 encoded string data.
| bool VisualString::initWithConstStringDataRef |
( |
ConstStringDataRef |
constStringDataRef |
) |
|
Initializes a VisualString with a platform native string data type (CFStringRef on Mac, wchar_t pointer on Windows).
- Parameters:
-
| constStringDataRef | On Mac a CFStringRef, on Windows a wchar_t pointer. |
| bool VisualString::initWithContentsOfFile |
( |
VisualFile & |
aFile |
) |
|
Initializes a VisualString from the contents of a file.
- Parameters:
-
| aFile | Reference to a file. |
- Returns:
- True on success, false on failure.
| bool VisualString::initWithContentsOfURL |
( |
const char *const |
aURL, |
|
|
const VisualItemIdentifier & |
anId | |
|
) |
| | |
Initializes a VisualString with the contents of a URL.
- Parameters:
-
| anId | An identifier. |
| aURL | A URL (aka URI). |
| void VisualString::initWithUTF16Buffer |
( |
const uint16 *const |
aStringVal, |
|
|
uint32 |
aNumberOfCharacters | |
|
) |
| | |
Initializes a VisualString with a pointer to an UTF-16 string buffer.
- Parameters:
-
| aStringVal | A pointer to the UTF-16 encoded char string buffer. |
| aNumberOfCharacters | The number of characters of the UTF-16 encoded char string buffer. |
| void VisualString::initWithUTF16String |
( |
const uint16 *const |
aStringVal |
) |
|
Initializes a VisualString with a pointer to an UTF-16 string.
- Parameters:
-
| aStringVal | A pointer to the UTF-16 encoded char string value. |
| void VisualString::initWithUTF8Buffer |
( |
const char *const |
aStringVal, |
|
|
uint32 |
numberOfBytes | |
|
) |
| | |
Initializes a VisualString with a pointer to an UTF-8 string buffer.
- Parameters:
-
| aStringVal | A pointer to the UTF-8 encoded char string buffer. |
| numberOfBytes | The number of bytes of the UTF-8 encoded char string buffer. |
| void VisualString::initWithUTF8String |
( |
const char *const |
aStringVal |
) |
|
Initializes a VisualString with a pointer to an UTF-8 string.
- Parameters:
-
| aStringVal | A pointer to the UTF-8 encoded char string value. |
| bool VisualString::isEmpty |
( |
void |
|
) |
const |
Returns true if the number of non-whitespace characters of the string is 0.
- Returns:
- True if the number of non-whitespace characters of the string is 0.
| void VisualString::normalizeLineEndings |
( |
|
) |
|
Normalizes the line endings of the string.
| bool VisualString::operator!= |
( |
const VisualString & |
other |
) |
const |
Inequality operator.
- Parameters:
-
Plus operator appends another string.
- Parameters:
-
| const VisualString & VisualString::operator+ |
( |
const char * |
charString |
) |
|
Plus operator appends an 8-bit char string.
- Parameters:
-
| charString | Pointer to 8-bit character string. |
| bool VisualString::operator< |
( |
const VisualString & |
other |
) |
const |
Less than operator.
- Parameters:
-
| bool VisualString::operator== |
( |
const VisualString & |
other |
) |
const |
Equality operator.
- Parameters:
-
Returns an array of strings by splitting the string with a separator string (delimiter).
- Parameters:
-
| delimiter | The string to use as separator. |
- Returns:
- An array with VisualStrings.
| void VisualString::trim |
( |
void |
|
) |
|
Remove whitespace characters from the start and end of the string.
| void VisualString::writeDebugLog |
( |
void |
|
) |
const |
Member Data Documentation
The lines (rows) of the VisualString collected as substrings.
The number of characters of the string.
The number of lines of the string.
The number of characters of the string.
The number of words of the string.
A pointer to the internally stored string data.
Optionally available utf-16 representation of string data.
Optionally available utf-8 representation of string data.
The documentation for this class was generated from the following files: