#include <BxString.h>
Inheritance diagram for BxString:

Public Member Functions | |
| BxString () | |
| BxString (const char *str, int size) | |
| BxString (const char *str, BxInteger *sizeObj) | |
| BxString (const char *str) | |
| BxString (const BxString ©) | |
| char * | toString (bool xml) |
| bool | toStream (FILE *) |
| bool | toStreamBinary (FILE *) |
| void | setDelimiter (const char *s) |
| char * | getDelims () const |
There are three types of strings.
Examples:
The size() function returns the number of bytes.
Since: BinX version 1.1.
|
|
Default constructor. Constructs and initialises an instance of the class BxString. |
|
||||||||||||
|
Construct a fixed-length BxString instance and assign it a string. Constructs and initialises an instance of the class BxString. The length of the new string is either, the size of the string str if it is less than the parameter size, or the string is truncated to the parameter size.
|
|
||||||||||||
|
Construct a variable-length BxString instance and assign it a string. Constructs and initialises an instance of the class BxString. The length of the new string is either, the size of the string str if it is less than the parameter sizeObj, or the string is truncated to the parameter sizeObj.
|
|
|
Construct a BxString instance and assign it a specified C string (ASCII). Constructs and initialises an instance of the class BxString.
|
|
|
Construct a BxString instance by copying a specified BxString instance. Constructs and initialises an instance of the class BxString.
|
|
|
Return the delimiter as a string. The ASCII character that terminates the string can be specified in three ways:
|
|
|
Set the delimiter for the delimited string. The delimiter is a string representing one-character. The ASCII character that terminates the string can be specified in three ways:
#0-#255, ' '..'~', '\0','\a','\b','\f','\t','\n','\r','\1'..'\255',
(number values for these, same as #1-#255),
'\a'..'\~' are the same as 'a'..'~'.
|
|
|
Save the XML element containing the string in the given file. Example:
<string>aaaa</string>
Reimplemented from BxDataObject. |
|
|
Save the string in a binary file. A fixed-length string is saved in exactly the number of bytes given in sizeInBytes_. Variable-length strings are saved after the sizeObject is saved. Delimited strings are saved followed by the delimiter.
Reimplemented from BxDataObject. |
|
|
Return a string containing the DataBinX XML element (or printable value only ) for the value of this BxString object. The DataBinx representation of a BxString object value consists of:
Example Return Result:
This method allocates memory to hold the returned string. The caller is responsible for releasing the memory when the string is no longer needed. If the BinX XML tags are not required, then the input boolean flag can be used to request that only the converted binary data value be included in the result string. Only BinX primitive data types implement this method.
Reimplemented from BxDataObject. |
1.3.3