@@ -29,11 +29,11 @@ * For security reasons, serialization and deserialization is only implemented * for OFDataArrays with item size 1. */ @interface OFDataArray: OFObject { - char *data; + uint8_t *data; size_t count; size_t itemSize; } #ifdef OF_HAVE_PROPERTIES @@ -73,10 +73,19 @@ * \param URL The URL to the contents for the OFDataArray * \return A new autoreleased OFDataArray */ + dataArrayWithContentsOfURL: (OFURL*)URL; +/** + * \brief Creates a new OFDataArray with an item size of 1, containing the data + * of the string representation. + * + * \param string The string representation of the data + * \return A new autoreleased OFDataArray + */ ++ dataArrayWithStringRepresentation: (OFString*)string; + /** * \brief Creates a new OFDataArray with an item size of 1, containing the data * of the Base64-encoded string. * * \param string The string with the Base64-encoded data @@ -116,10 +125,19 @@ * \param URL The URL to the contents for the OFDataArray * \return A new autoreleased OFDataArray */ - initWithContentsOfURL: (OFURL*)URL; +/** + * \brief Initializes an already allocated OFDataArray with an item size of 1, + * containing the data of the string representation. + * + * \param string The string representation of the data + * \return A new autoreleased OFDataArray + */ +- initWithStringRepresentation: (OFString*)string; + /** * \brief Initializes an already allocated OFDataArray with an item size of 1, * containing the data of the Base64-encoded string. * * \param string The string with the Base64-encoded data @@ -233,10 +251,17 @@ /** * \brief Removes all items. */ - (void)removeAllItems; +/** + * \brief Returns the string representation of the data array. + * + * \return The string representation of the data array. + */ +- (OFString*)stringRepresentation; + /** * \brief Returns a string containing the data in Base64 encoding. * * \return A string containing the data in Base64 encoding */