OSXMLStringClass Class Reference
XML string. More...
#include <rtxCppXmlString.h>
Inheritance diagram for OSXMLStringClass:
![](classOSXMLStringClass.png)
Public Member Functions | |
OSXMLStringClass () | |
The default constructor creates an empty string. | |
OSXMLStringClass (const OSUTF8CHAR *strval, OSBOOL cdata_=FALSE) | |
This constructor initializes the string to contain the value. | |
OSXMLStringClass (const OSUTF8CHAR *strval, size_t nbytes, OSBOOL cdata_=FALSE) | |
This constructor initializes the string to contain the value. | |
OSXMLStringClass (const char *strval, OSBOOL cdata_=FALSE) | |
This constructor initializes the string to contain the value. | |
OSXMLStringClass (const OSXMLSTRING &str) | |
Copy constructor. | |
OSXMLStringClass (const OSXMLStringClass &str) | |
Copy constructor. | |
virtual | ~OSXMLStringClass () |
The destructor frees string memory if the memory ownership flag is set. | |
void | appendValue (const OSUTF8CHAR *utf8str, size_t nbytes=0) |
This method copies the given string value to the end of internal string storage variable. | |
OSRTBaseType * | clone () const |
Clone method. | |
void | copyValue (const OSUTF8CHAR *utf8str, size_t nbytes=0) |
This method copies the given string value to the internal string storage variable. | |
void | copyValue (const char *cstring, size_t nbytes=0) |
This method copies the given string value to the internal string storage variable. | |
const char * | c_str () const |
This method returns the pointer to C null terminated string. | |
virtual int | decodeXML (OSCTXT *pctxt) |
This method decodes XML content at the current stream/buffer position into this string object. | |
virtual int | encodeXML (OSRTMessageBufferIF &msgbuf, const OSUTF8CHAR *elemName, OSXMLNamespace *pNS) |
This method encodes the data in this string object into XML content in the encode data stream. | |
const OSUTF8CHAR * | getValue () const |
This method returns a pointer to the UTF-8 null terminated string. | |
OSBOOL | isCDATA () const |
This method returns the value of the cdata member variable. | |
void | setCDATA (OSBOOL bvalue) |
This method sets the value of the cdata member variable. | |
void | print (const char *name) |
This method prints the string value to standard output. | |
void | setValue (const OSUTF8CHAR *utf8str, size_t nbytes=0) |
This method sets the string value to the given string. | |
void | setValue (const char *cstring, size_t nbytes=0) |
This method sets the string value to the given string. | |
void | setValue (OSRTMemBuf &membuf) |
This method sets the string value to the value of the data in the given memory buffer object. | |
OSXMLStringClass & | operator= (const OSXMLStringClass &original) |
Assignment operator. | |
OSXMLStringClass & | operator= (const char *original) |
Assignment operator for C strings. | |
OSXMLStringClass & | operator= (const OSUTF8CHAR *original) |
Assignment operator for C UTF-8 strings. | |
operator const char * () const | |
String to C const char* type conversion operator. | |
operator const OSUTF8CHAR * () const | |
String to C const OSUTF8CHAR* type conversion operator. | |
int | length () |
This method returns the number of characters. | |
int | size () |
This method returns the number of bytes. | |
Protected Member Functions | |
void | newString (const char *pString, size_t nbytes=0) |
void | xstrcat (OSUTF8CHAR *dststr, const OSUTF8CHAR *srcstr) |
Protected Attributes | |
OSUTF8CHAR * | value |
OSBOOL | cdata |
size_t | mCapacityIncrement |
size_t | mCurrentBufferSize |
size_t | mCurrentStringSize |
Detailed Description
XML string.This is the base class for generated C++ data type classes for XSD string types (string, token, NMTOKEN, etc.).
Definition at line 46 of file rtxCppXmlString.h.
Constructor & Destructor Documentation
OSXMLStringClass::OSXMLStringClass | ( | const OSUTF8CHAR * | strval, | |
OSBOOL | cdata_ = FALSE | |||
) |
This constructor initializes the string to contain the value.
A deep-copy of the given value is done.
- Parameters:
-
strval - String value cdata_ - Should string be encoded as a CDATA section?
OSXMLStringClass::OSXMLStringClass | ( | const OSUTF8CHAR * | strval, | |
size_t | nbytes, | |||
OSBOOL | cdata_ = FALSE | |||
) |
This constructor initializes the string to contain the value.
It copies up to the given number of bytes from the source string. A deep-copy of the given value is done.
- Parameters:
-
strval - String value nbytes - Number of bytes to copy from source string cdata_ - Should string be encoded as a CDATA section?
OSXMLStringClass::OSXMLStringClass | ( | const char * | strval, | |
OSBOOL | cdata_ = FALSE | |||
) |
This constructor initializes the string to contain the value.
A deep-copy of the given value is done.
- Parameters:
-
strval - String value cdata_ - Should string be encoded as a CDATA section?
OSXMLStringClass::OSXMLStringClass | ( | const OSXMLSTRING & | str | ) |
Copy constructor.
- Parameters:
-
str - C XML string structure.
OSXMLStringClass::OSXMLStringClass | ( | const OSXMLStringClass & | str | ) |
Copy constructor.
- Parameters:
-
str - C++ XML string class.
Member Function Documentation
void OSXMLStringClass::appendValue | ( | const OSUTF8CHAR * | utf8str, | |
size_t | nbytes = 0 | |||
) |
This method copies the given string value to the end of internal string storage variable.
A deep-copy of the given value is done; the class will delete this memory when the object is deleted.
- Parameters:
-
utf8str - C null-terminated string. nbytes - length of utf8str in bytes.
OSRTBaseType* OSXMLStringClass::clone | ( | ) | const [inline, virtual] |
Clone method.
Creates a copied instance and returns pointer to OSRTBaseType.
Reimplemented from OSRTBaseType.
Definition at line 144 of file rtxCppXmlString.h.
void OSXMLStringClass::copyValue | ( | const OSUTF8CHAR * | utf8str, | |
size_t | nbytes = 0 | |||
) |
This method copies the given string value to the internal string storage variable.
A deep-copy of the given value is done; the class will delete this memory when the object is deleted.
- Parameters:
-
utf8str - C null-terminated string. nbytes - length of utf8str in bytes.
void OSXMLStringClass::copyValue | ( | const char * | cstring, | |
size_t | nbytes = 0 | |||
) | [inline] |
This method copies the given string value to the internal string storage variable.
A deep-copy of the given value is done; the class will delete this memory when the object is deleted.
- Parameters:
-
cstring - C null-terminated string. nbytes - length of cstring in bytes.
Definition at line 166 of file rtxCppXmlString.h.
virtual int OSXMLStringClass::decodeXML | ( | OSCTXT * | pctxt | ) | [virtual] |
This method decodes XML content at the current stream/buffer position into this string object.
This method is normally overridden by a decodeXML method in a generated class.
- Parameters:
-
pctxt Pointer to context block structure.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
virtual int OSXMLStringClass::encodeXML | ( | OSRTMessageBufferIF & | msgbuf, | |
const OSUTF8CHAR * | elemName, | |||
OSXMLNamespace * | pNS | |||
) | [virtual] |
This method encodes the data in this string object into XML content in the encode data stream.
This method is normally overridden by an encodeXML method in a generated class.
- Parameters:
-
msgbuf Message buffer or stream object reference. elemName XML element name that should be added to encoded fragment. pNS Pointer to namespace structure.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
OSBOOL OSXMLStringClass::isCDATA | ( | ) | const [inline] |
This method returns the value of the cdata member variable.
This indicates if this string should be encoded as a CDATA section in an XML document.
- Returns:
- - True if string is to be encoded as CDATA section
Definition at line 219 of file rtxCppXmlString.h.
void OSXMLStringClass::setCDATA | ( | OSBOOL | bvalue | ) | [inline] |
This method sets the value of the cdata member variable.
This indicates if this string should be encoded as a CDATA section in an XML document.
- Parameters:
-
bvalue - Boolean value.
Definition at line 228 of file rtxCppXmlString.h.
void OSXMLStringClass::print | ( | const char * | name | ) | [inline] |
This method prints the string value to standard output.
- Parameters:
-
name - Name of generated string variable.
Definition at line 235 of file rtxCppXmlString.h.
void OSXMLStringClass::setValue | ( | const OSUTF8CHAR * | utf8str, | |
size_t | nbytes = 0 | |||
) |
This method sets the string value to the given string.
A deep-copy of the given value is done.
- Parameters:
-
utf8str - UTF8 null-terminated string. nbytes - Number of bytes to copy from the source string. If zero, bytes are copied up to the null-terminator.
void OSXMLStringClass::setValue | ( | const char * | cstring, | |
size_t | nbytes = 0 | |||
) | [inline] |
This method sets the string value to the given string.
A deep-copy of the given value is done.
- Parameters:
-
cstring - C null-terminated string. nbytes - Number of bytes to copy from the source string. If zero, bytes are copied up to the null-terminator.
Definition at line 255 of file rtxCppXmlString.h.
void OSXMLStringClass::setValue | ( | OSRTMemBuf & | membuf | ) | [inline] |
This method sets the string value to the value of the data in the given memory buffer object.
A deep-copy of the value is done.
- Parameters:
-
membuf - Reference to a memory buffer object.
Definition at line 266 of file rtxCppXmlString.h.
References OSRTMemBuf::getData(), and OSRTMemBuf::getDataLen().
The documentation for this class was generated from the following file: