![]() |
VR-Link API Documentation for HLA 1.3
|
Instances of DtString are used to represent strings. More...
Inheritance diagram for DtString:
Collaboration diagram for DtString:Public Member Functions | |
| DtString () | |
| Default CTOR. More... | |
| DtString (const char *str) | |
| CTOR. More... | |
| DtString (const char *str, int length) | |
| CTOR (fixed length). More... | |
| DtString (const std::string &str) | |
| CTOR (std::string). More... | |
| DtString (const DtString &orig) | |
| Copy CTOR. More... | |
| virtual | ~DtString () |
| Virtual DTOR. More... | |
| virtual | operator const char * () const |
| Cast operator. More... | |
| virtual DtString * | clone () const |
| Clone operator. More... | |
| virtual void | tokenize (const char delimiter, std::vector< DtString > &tokens) const |
| Tokenize the string baseed on the input character. More... | |
| virtual int | toInt (bool *ok=0) const |
| Conversion to integer, if ok is provided ok is set if conversion succeeds. More... | |
| virtual unsigned int | toUInt (bool *ok=0) const |
| Conversion to unsigned integer, if ok is provided ok is set if conversion succeeds. More... | |
| virtual float | toFloat (bool *ok=0) const |
| Convert to floating point. More... | |
| virtual double | toDouble (bool *ok=0) const |
| Convert to double precision floating point. More... | |
| virtual bool | toBoolean (bool *ok=0) const |
| Convert to double precision floating point. More... | |
| virtual void | toUpper () |
| Convert this string's alphabetic characters to uppercase. More... | |
| virtual void | toLower () |
| Convert this string's alphabetic characters to lowercase. More... | |
| virtual int | findChar (const char ch) |
| Search the string for first occurrence of a character and return its index. More... | |
| virtual int | findLastChar (const char ch) |
| Search the string for the last occurrence of a character and return its index. More... | |
| virtual int | findString (const DtString &string) const |
| Search the string for the first occurrence of another string and return the starting index. More... | |
| virtual int | findLastString (const DtString &string) |
| Search the string for the last occurrence of another string and return the starting index. More... | |
| bool | snipFrontToLast (const char ch) |
| bool | snipBackToFirst (const char ch) |
| virtual int | count (const char ch) const |
| Returns the number of occurrences of the character. More... | |
| virtual int | length () const |
| length() - Exactly the same as size(): More... | |
| virtual int | size () const |
| size() - returns the length of the string not including the terminating '\0' More... | |
| virtual std::string | stdString () const |
| stdString() - returns a standard string representation of the DtString More... | |
| virtual const char * | string () const |
| string() - Returns a char * representation of the DtString: deprecated More... | |
| virtual const char * | c_str () const |
| Returns a char* representation of the DtString;. More... | |
| virtual bool | isEmpty () const |
| returns true if the string is empty, where empty is size() == 0 More... | |
| virtual DtString | section (const char sep, int start, int end=-1) const |
| returns a section of the string based on the separator. More... | |
| DtString (double val) | |
| Constructors for creating DtString representations of numbers. More... | |
| DtString (int val) | |
| Constructors for creating DtString representations of numbers. More... | |
| DtString (long val) | |
| Constructors for creating DtString representations of numbers. More... | |
| DtString (char val) | |
| Constructors for creating DtString representations of numbers. More... | |
| DtString (unsigned int val) | |
| Constructors for creating DtString representations of numbers. More... | |
| DtString (unsigned long val) | |
| Constructors for creating DtString representations of numbers. More... | |
Assignment operators. | |
| virtual DtString & | operator= (const char *orig) |
| virtual DtString & | operator= (const DtString &orig) |
| virtual bool | caseCompare (const char *str) const |
| Case-insensitive string compare. More... | |
| virtual bool | caseCompare (const DtString &str) const |
| Case-insensitive string compare. More... | |
Index operator. | |
| virtual char & | operator[] (int index) |
| virtual const char & | operator[] (int index) const |
| virtual bool | snipFront (const char ch, bool toLastCh=false) |
| Truncates everything before or after the character, including the character, respectively. More... | |
| virtual bool | snipBack (const char ch, bool fromFirstCh=false) |
| Truncates everything before or after the character, including the character, respectively. More... | |
| virtual bool | chompFront () |
| Remove all whitespace at front or back of a string. More... | |
| virtual bool | chompBack () |
| Remove all whitespace at front or back of a string. More... | |
Static Public Member Functions | |
| static const DtString & | nullString () |
| a Null representation of a string, which is the same as an empty string More... | |
| static const DtString & | nullId () |
| a Null representation of a string, which is the same as an empty string This is the same as nullString, but allows for a cross protocol DtGlobalObjectDesignator More... | |
Protected Types | |
| enum | { theDefaultBufferSize = 64 } |
Protected Member Functions | |
| void | clear () |
| Deletes the string, and sets the myString pointer to NULL. More... | |
| void | setString (const char *str) |
| Set/Get for myString - char pointer that holds the string. More... | |
Protected Attributes | |
| char | myDefaultBuffer [theDefaultBufferSize] |
| char * | myString |
| Use this buffer if possible. More... | |
| bool | myStringAlloced |
| &myDefaultBuffer[0], or a ptr to heap memory if needed More... | |
| unsigned int | myBufSize |
| Does myString need to be deleted when done? More... | |
Static Protected Attributes | |
| static const int | theMaxInsertionStringSize |
| current buffer size More... | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const DtString &str) |
| std::istream & | operator>> (std::istream &is, DtString &str) |
Comparison operators. | |
| virtual bool | operator< (const char *str) const |
| virtual bool | operator> (const char *str) const |
| virtual bool | operator== (const char *str) const |
| virtual bool | operator!= (const char *str) const |
| virtual bool | operator<= (const char *str) const |
| virtual bool | operator>= (const char *str) const |
| bool | operator< (const DtString &str1, const DtString &str2) |
| bool | operator> (const DtString &str1, const DtString &str2) |
| bool | operator== (const DtString &str1, const DtString &str2) |
| bool | operator!= (const DtString &str1, const DtString &str2) |
| bool | operator<= (const DtString &str1, const DtString &str2) |
| bool | operator>= (const DtString &str1, const DtString &str2) |
Concatenation operators. | |
| virtual DtString | operator+ (const char *str) const |
| virtual DtString & | operator+= (const char *str) |
| virtual DtString & | operator+= (const DtString &str) |
| DtString | operator+ (const char *str1, const DtString &str2) |
| DtString | operator+ (const DtString &str1, const DtString &str2) |
Instances of DtString are used to represent strings.
DtString is a robust string implementation which allows the developer to easily manipulate strings quickly.
| DtString::DtString | ( | ) |
Default CTOR.
| DtString::DtString | ( | const char * | str | ) |
CTOR.
| DtString::DtString | ( | const char * | str, |
| int | length | ||
| ) |
CTOR (fixed length).
| DtString::DtString | ( | const std::string & | str | ) |
CTOR (std::string).
| DtString::DtString | ( | const DtString & | orig | ) |
Copy CTOR.
| DtString::DtString | ( | double | val | ) |
Constructors for creating DtString representations of numbers.
For example, These constructors allow you to write statements such as DtString msg = DtString("The value is ") + DtString(5) + DtString("\n"); Above, msg.string() is "The value is 5\n";
| DtString::DtString | ( | int | val | ) |
Constructors for creating DtString representations of numbers.
For example, These constructors allow you to write statements such as DtString msg = DtString("The value is ") + DtString(5) + DtString("\n"); Above, msg.string() is "The value is 5\n";
| DtString::DtString | ( | long | val | ) |
Constructors for creating DtString representations of numbers.
For example, These constructors allow you to write statements such as DtString msg = DtString("The value is ") + DtString(5) + DtString("\n"); Above, msg.string() is "The value is 5\n";
| DtString::DtString | ( | char | val | ) |
Constructors for creating DtString representations of numbers.
For example, These constructors allow you to write statements such as DtString msg = DtString("The value is ") + DtString(5) + DtString("\n"); Above, msg.string() is "The value is 5\n";
| DtString::DtString | ( | unsigned int | val | ) |
Constructors for creating DtString representations of numbers.
For example, These constructors allow you to write statements such as DtString msg = DtString("The value is ") + DtString(5) + DtString("\n"); Above, msg.string() is "The value is 5\n";
| DtString::DtString | ( | unsigned long | val | ) |
Constructors for creating DtString representations of numbers.
For example, These constructors allow you to write statements such as DtString msg = DtString("The value is ") + DtString(5) + DtString("\n"); Above, msg.string() is "The value is 5\n";
|
virtual |
Virtual DTOR.
|
virtual |
Returns a char* representation of the DtString;.
Referenced by DtToWString(), DtF18EntityEncoder::encodeSpecialF18Attribute(), MakeCCompatibleString(), DtEntityStateRepository::markingText(), DtInterClassDesc::name(), DtObjClassDesc::name(), and DtMtlEnvironment::registerConfigVar().
|
virtual |
Case-insensitive string compare.
Returns true if the strings are equal except for differences in case.
Case-insensitive string compare.
Returns true if the strings are equal except for differences in case.
|
virtual |
Remove all whitespace at front or back of a string.
|
virtual |
Remove all whitespace at front or back of a string.
|
protected |
Deletes the string, and sets the myString pointer to NULL.
Non-virtual, because only called by destructor, and non-virtual members. myString is set to NULL, so it should be allocated some memory if operators are to be used on the string.
|
virtual |
Clone operator.
|
virtual |
Returns the number of occurrences of the character.
|
virtual |
Search the string for first occurrence of a character and return its index.
| -1 | if the character was not found. |
|
virtual |
Search the string for the last occurrence of a character and return its index.
| -1 | if the character was not found. |
Search the string for the last occurrence of another string and return the starting index.
| -1 | if the character was not found. |
Search the string for the first occurrence of another string and return the starting index.
| -1 | if the character was not found. |
|
inlinevirtual |
returns true if the string is empty, where empty is size() == 0
|
virtual |
length() - Exactly the same as size():
Referenced by MakeCCompatibleString().
|
static |
a Null representation of a string, which is the same as an empty string This is the same as nullString, but allows for a cross protocol DtGlobalObjectDesignator
|
static |
a Null representation of a string, which is the same as an empty string
|
virtual |
Cast operator.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Reimplemented in DtFilename.
Reimplemented in DtFilename.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
returns a section of the string based on the separator.
Based on QString section
|
protected |
Set/Get for myString - char pointer that holds the string.
Non-virtual, because only called by constructor.
|
virtual |
size() - returns the length of the string not including the terminating '\0'
Referenced by DtF18EntityEncoder::encodeSpecialF18Attribute().
Truncates everything before or after the character, including the character, respectively.
Normally, snipFront stops at the first occurrence of "ch", and snipBack stops at the last occurrence of "ch". The second argument flags reverse this. Return value is true if "ch" was found in the string. Does not include the null terminator (only searches characters counted by size).
|
inline |
Truncates everything before or after the character, including the character, respectively.
Normally, snipFront stops at the first occurrence of "ch", and snipBack stops at the last occurrence of "ch". The second argument flags reverse this. Return value is true if "ch" was found in the string. Does not include the null terminator (only searches characters counted by size).
Referenced by MakeCCompatibleString().
|
inline |
|
virtual |
stdString() - returns a standard string representation of the DtString
Referenced by DtEntityStateRepository::embeddedUnitListToString(), and DtEntityStateRepository::routeWaypointsToString().
|
virtual |
string() - Returns a char * representation of the DtString: deprecated
Referenced by MakeCCompatibleString().
Convert to double precision floating point.
If ok is provided ok is set if conversion succeeds.
| 0 | if unable to convert. |
Convert to double precision floating point.
If ok is provided ok is set if conversion succeeds.
| 0 | if unable to convert. |
Convert to floating point.
If ok is provided ok is set if conversion succeeds.
| 0 | if unable to convert. |
Conversion to integer, if ok is provided ok is set if conversion succeeds.
| 0 | if unable to convert. |
|
virtual |
Tokenize the string baseed on the input character.
Disregards trailing delimiter.
|
virtual |
Convert this string's alphabetic characters to lowercase.
Referenced by DtToLower().
Conversion to unsigned integer, if ok is provided ok is set if conversion succeeds.
| 0 | if unable to convert. |
|
virtual |
Convert this string's alphabetic characters to uppercase.
Referenced by DtToUpper(), and MakeCCompatibleString().
|
friend |
|
friend |
|
protected |
Does myString need to be deleted when done?
|
protected |
|
protected |
Use this buffer if possible.
|
protected |
&myDefaultBuffer[0], or a ptr to heap memory if needed
(for large strings)
|
staticprotected |
current buffer size