|
|
The DataBlock holds a data buffer with no specific formatting.
| DataBlock ()
| DataBlock |
Constructs an empty data block
| DataBlock (const DataBlock& value)
| DataBlock |
Copy constructor
| DataBlock (void* value, unsigned int len, bool copyData = true)
| DataBlock |
Constructs an initialized data block
Parameters:
| value | Data to assign, may be NULL to fill with zeros |
| len | Length of data, may be zero (then value is ignored) |
| copyData | True to make a copy of the data, false to just insert the pointer |
| ~DataBlock ()
| ~DataBlock |
[virtual]
Destroys the data, disposes the memory.
| void* getObject (const String& name)
| getObject |
[const virtual]
Get a pointer to a derived class given that class name
Parameters:
| name | Name of the class we are asking for |
Returns: Pointer to the requested class or NULL if this object doesn't implement it
Reimplemented from GenObject.
| const DataBlock& empty ()
| empty |
[static]
A static empty data block
| inline void* data ()
| data |
[const]
Get a pointer to the stored data.
Returns: A pointer to the data or NULL.
| inline bool null ()
| null |
[const]
Checks if the block holds a NULL pointer.
Returns: True if the block holds NULL, false otherwise.
| inline unsigned int length ()
| length |
[const]
Get the length of the stored data.
Returns: The length of the stored data, zero for NULL.
| void clear (bool deleteData = true)
| clear |
Clear the data and optionally free the memory
Parameters:
| deleteData | True to free the deta block, false to just forget it |
| DataBlock& assign (void* value, unsigned int len, bool copyData = true)
| assign |
Assign data to the object
Parameters:
| value | Data to assign, may be NULL to fill with zeros |
| len | Length of data, may be zero (then value is ignored) |
| copyData | True to make a copy of the data, false to just insert the pointer |
| void append (const DataBlock& value)
| append |
Append data to the current block
Parameters:
| value | Data to append |
| void append (const String& value)
| append |
Append a String to the current block
Parameters:
| value | String to append |
| void insert (const DataBlock& value)
| insert |
Insert data before the current block
Parameters:
| value | Data to insert |
| void truncate (unsigned int len)
| truncate |
Truncate the data block
Parameters:
| len | The maximum length to keep |
| void cut (int len)
| cut |
Cut off a number of bytes from the data block
Parameters:
| len | Amount to cut, positive to cut from end, negative to cut from start of block |
| DataBlock& operator= (const DataBlock& value)
| operator= |
Assignment operator.
| inline DataBlock& operator+= (const DataBlock& value)
| operator+= |
Appending operator.
| inline DataBlock& operator+= (const String& value)
| operator+= |
Appending operator for Strings.
| bool convert (const DataBlock& src, const String& sFormat,
const String& dFormat, unsigned maxlen = 0)
| convert |
Convert data from a different format
Parameters:
| src | Source data block |
| sFormat | Name of the source format |
| dFormat | Name of the destination format |
| maxlen | Maximum amount to convert, 0 to use source |
Returns: True if converted successfully, false on failure
| Generated by: root on dragoshel on Fri Aug 24 11:49:48 2007, using kdoc 2.0a54. |