Index: src/OFConstCString.h ================================================================== --- src/OFConstCString.h +++ src/OFConstCString.h @@ -9,17 +9,47 @@ * the packaging of this file. */ #import "OFString.h" +/** + * An OFString using a constant C string as internal storage. + */ @interface OFConstCString: OFString { const char *string; size_t length; } +/** + * Initializes an already allocated OFConstCString. + * + * \param str A constant C string to initialize the OFConstCString with. + * \returns An initialized OFConstCString + */ - initAsConstCString: (const char*)str; + +/** + * \return The OFConstCString as a constant C string. + */ - (const char*)cString; + +/** + * \return The length of the OFConstCString. + */ - (size_t)length; + +/** + * Clones the OFConstCString, creating a new one. + * + * \return A copy of the OFConstCString + */ - (OFString*)clone; + +/** + * Compares the OFConstCString to another OFString. + * + * \param str An OFString in a compatible type to compare with + * \return An integer which is the result of the comparison, see strcmp. + */ - (int)compareTo: (OFString*)str; @end Index: src/OFConstWideCString.h ================================================================== --- src/OFConstWideCString.h +++ src/OFConstWideCString.h @@ -11,17 +11,48 @@ #import #import #import "OFString.h" +/** + * An OFString using a constant wide C string as internal storage. + */ @interface OFConstWideCString: OFString { const wchar_t *string; size_t length; } +/** + * Initializes an already allocated OFConstWideCString. + * + * \param str A constant wide C string to initialize the OFConstWideCString + * with. + * \returns An initialized OFConstWideCString + */ - initAsConstWideCString: (const wchar_t*)wstr; + +/** + * \return The OFConstWideCString as a constant wide C string. + */ - (const wchar_t*)wcString; + +/** + * \return The length of the OFConstWideCString. + */ - (size_t)length; + +/** + * Clones the OFConstWideCString, creating a new one. + * + * \return A copy of the OFConstWideCString + */ - (OFString*)clone; + +/** + * Compares the OFConstWideCString to another OFString. + * + * \param str An OFString in a compatible type to compare with + * \return An integer which is the result of the comparison, see wcscmp. + */ - (int)compareTo: (OFString*)str; @end Index: src/OFMacros.h ================================================================== --- src/OFMacros.h +++ src/OFMacros.h @@ -7,10 +7,11 @@ * This file is part of libobjfw. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ +/* Return is only to make the compiler happy - it is never reached */ #define OF_NOT_IMPLEMENTED(ret) \ [[OFNotImplementedException newWithObject: self \ andSelector: _cmd] raise]; \ return ret; Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -55,10 +55,11 @@ ofSize: (size_t)size; /** * Resize memory in the memory pool to a specified size. * + * \param ptr A pointer to the already allocated memory * \param size The new size for the memory chunk * \return A pointer to the resized memory chunk */ - (void*)resizeMem: (void*)ptr toSize: (size_t)size; @@ -65,10 +66,11 @@ /** * Resize memory in the memory pool to a specific number of items of a * specified size. * + * \param ptr A pointer to the already allocated memory * \param nitems The number of items to resize to * \param size The size of each item to resize to * \return A pointer to the resized memory chunk */ - (void*)resizeMem: (void*)ptr Index: src/OFWideCString.h ================================================================== --- src/OFWideCString.h +++ src/OFWideCString.h @@ -12,19 +12,61 @@ #import #import #import "OFString.h" +/** + * An OFString using a wide C string as internal storage. + */ @interface OFWideCString: OFString { wchar_t *string; size_t length; } +/** + * Initializes an already allocated OFWideCString. + * + * \param str A wide C string to initialize the OFWideCString with. + * \returns An initialized OFWideCString + */ - initAsWideCString: (wchar_t*)str; + +/** + * \return The OFWideCString as a wide C string. + */ - (wchar_t*)wcString; + +/** + * \return The length of the OFWideCString. + */ - (size_t)length; + +/** + * Clones the OFWideCString, creating a new one. + * + * \return A copy of the OFWideCString + */ - (OFString*)clone; + +/** + * Compares the OFWideCString to another OFString. + * + * \param str An OFString in a compatible type to compare with + * \return An integer which is the result of the comparison, see wcscmp. + */ - (int)compareTo: (OFString*)str; + +/** + * Append another OFString to the OFWideCString. + * + * \param str An OFString in a compatible type to append + */ - append: (OFString*)str; + +/** + * Append a wide C string to the OFWideCString. + * + * \param str A wide C string to append + */ - appendWideCString: (const wchar_t*)str; @end