ASN1C C/C++ Common Runtime
ASN1C v7.7.x
|
#include <OSRTString.h>
Public Member Functions | |
OSRTString () | |
OSRTString (const char *strval) | |
OSRTString (const OSUTF8CHAR *strval) | |
OSRTString (const OSRTString &str) | |
virtual | ~OSRTString () |
virtual OSRTStringIF * | clone () |
const char * | data () const |
virtual const char * | getValue () const |
virtual const OSUTF8CHAR * | getUTF8Value () const |
int | indexOf (char ch) const |
size_t | length () const |
virtual void | print (const char *name) |
virtual EXTRTMETHOD void | setValue (const char *strval) |
virtual EXTRTMETHOD void | setValue (const OSUTF8CHAR *strval) |
virtual EXTRTMETHOD void | setValuePtr (char *strval) |
bool | toInt (OSINT32 &value) const |
bool | toSize (OSSIZE &value) const |
bool | toUInt (OSUINT32 &value) const |
bool | toUInt64 (OSUINT64 &value) const |
EXTRTMETHOD OSRTString & | operator= (const OSRTString &original) |
operator const char * (void) const | |
Protected Attributes | |
char * | mpValue |
C++ string class definition. This can be used to hold standard ASCII or UTF-8 strings. The standard C++ 'new' and 'delete' operators are used to allocate/free memory for the strings. All strings are deep-copied.
OSRTString::OSRTString | ( | ) |
The default constructor creates an empty string.
OSRTString::OSRTString | ( | const char * | strval | ) |
This constructor initializes the string to contain the given standard ASCII string value.
strval | - Null-terminated C string value |
OSRTString::OSRTString | ( | const OSUTF8CHAR * | strval | ) |
This constructor initializes the string to contain the given UTF-8 string value.
strval | - Null-terminated C string value |
OSRTString::OSRTString | ( | const OSRTString & | str | ) |
Copy constructor.
str | - C++ string object to be copied. |
|
virtual |
The destructor frees string memory using the standard 'delete' operator.
|
inlinevirtual |
This method creates a copy of the given string object.
|
inline |
This method is a synonym for getValue().
|
inlinevirtual |
This method returns the pointer to UTF-8 null terminated string as a UTF-8 string.
|
inlinevirtual |
This method returns the pointer to UTF-8 null terminated string as a standard ASCII string.
int OSRTString::indexOf | ( | char | ch | ) | const |
This method returns the index of the first occurence of the given characetr within the string or -1 if the character is not found.
|
inline |
This method returns the length of the string.
EXTRTMETHOD OSRTString& OSRTString::operator= | ( | const OSRTString & | original | ) |
Assignment operator.
|
inlinevirtual |
This method prints the string value to standard output.
name | - Name of generated string variable. |
References rtxPrintCharStr().
|
virtual |
This method sets the string value to the given string.
str | - C null-terminated string. |
|
virtual |
This method sets the string value to the given UTF-8 string value.
str | - C null-terminated UTF-8 string. |
|
virtual |
This method sets the string value to the given string value pointer. This is assumed to be a mutable string allocated with the new operator. This class will assume ownership of the string memory.
str | - Mutable null-terminated string allocated with new. |
bool OSRTString::toInt | ( | OSINT32 & | value | ) | const |
This method converts the string to a signed 32-bit integer value.
value | Reference to variable to receive converted integer value. |
bool OSRTString::toSize | ( | OSSIZE & | value | ) | const |
This method converts the string to a size typed (site_t) value.
value | Reference to variable to receive converted integer value. |
bool OSRTString::toUInt | ( | OSUINT32 & | value | ) | const |
This method converts the string to an unsigned 32-bit integer value.
value | Reference to variable to receive converted integer value. |
bool OSRTString::toUInt64 | ( | OSUINT64 & | value | ) | const |
This method converts the string to an unsigned 64-bit integer value.
value | Reference to variable to receive converted integer value. |