Index: src/OFApplication.h ================================================================== --- src/OFApplication.h +++ src/OFApplication.h @@ -36,20 +36,20 @@ @protocol OFApplicationDelegate #else @protocol OFApplicationDelegate #endif /** - * This method is called when the application was initialized and is running - * now. + * \brief A method which is called when the application was initialized and is + * running now. */ - (void)applicationDidFinishLaunching; #ifdef OF_HAVE_OPTIONAL_PROTOCOLS @optional #endif /** - * This method is called when the application will terminate. + * \brief A method which is called when the application will terminate. */ - (void)applicationWillTerminate; @end /** @@ -71,100 +71,118 @@ @property (readonly, copy) OFDictionary *environment; @property (retain) id delegate; #endif /** + * \brief Returns the only OFApplication instance in the application. + * * \return The only OFApplication instance in the application */ + sharedApplication; /** + * \brief Returns the name of the program (argv[0]). + * * \return The name of the program (argv[0]) */ + (OFString*)programName; /** + * \brief Returns the arguments passed to the application. + * * \return The arguments passed to the application */ + (OFArray*)arguments; /** + * \brief Returns the environment of the application. + * * \return The environment of the application */ + (OFDictionary*)environment; /** - * Terminates the application. + * \brief Terminates the application. */ + (void)terminate; /** - * Terminates the application with the specified status. + * \brief Terminates the application with the specified status. * * \param status The status with which the application will terminate */ + (void)terminateWithStatus: (int)status; /** - * Sets argc and argv. + * \brief Sets argc and argv. * - * You should not call this directly! Use of_application_main instead! + * You should not call this directly, but use OF_APPLICATION_DELEGATE instead! * * \param argc The number of arguments * \param argv The argument values */ - (void)setArgumentCount: (int*)argc andArgumentValues: (char**[])argv; /** - * Gets args and argv.o + * \brief Gets args and argv. * * \param argc A pointer where a pointer to argc should be stored * \param argv A pointer where a pointer to argv should be stored */ - (void)getArgumentCount: (int**)argc andArgumentValues: (char***[])argv; /** + * \brief Returns the name of the program (argv[0]). + * * \return The name of the program (argv[0]) */ - (OFString*)programName; /** + * \brief Returns the arguments passed to the application. + * * \return The arguments passed to the application */ - (OFArray*)arguments; /** + * \brief Returns the environment of the application. + * * \return The environment of the application */ - (OFDictionary*)environment; /** + * \brief Returns the delegate of the application. + * * \return The delegate of the application */ - (id )delegate; /** - * Sets the delegate of the application. + * \brief Sets the delegate of the application. * * \param delegate The delegate for the application */ - (void)setDelegate: (id )delegate; /** - * Starts the application after everything has been initialized. + * \brief Starts the application after everything has been initialized. + * + * You should not call this directly, but use OF_APPLICATION_DELEGATE instead! */ - (void)run; /** - * Terminates the application. + * \brief Terminates the application. */ - (void)terminate; /** - * Terminates the application with the specified status. + * \brief Terminates the application with the specified status. * * \param status The status with which the application will terminate */ - (void)terminateWithStatus: (int)status; @end Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -31,10 +31,12 @@ #import "OFDictionary.h" #import "OFAutoreleasePool.h" #import "OFNotImplementedException.h" +#import "macros.h" + #ifndef __MACH__ extern char **environ; #endif static OFApplication *app = nil; @@ -187,33 +189,31 @@ *argv_ = argv; } - (OFString*)programName { - return [[programName copy] autorelease]; + OF_GETTER(programName, YES) } - (OFArray*)arguments { - return [[arguments copy] autorelease]; + OF_GETTER(arguments, YES) } - (OFDictionary*)environment { - return [[environment copy] autorelease]; + OF_GETTER(environment, YES) } - (id )delegate { - return [[(id)delegate retain] autorelease]; + OF_GETTER(delegate, YES) } - (void)setDelegate: (id )delegate_ { - [(id)delegate_ retain]; - [(id)delegate release]; - delegate = delegate_; + OF_SETTER(delegate, delegate_, YES, NO) } - (void)run { [delegate applicationDidFinishLaunching]; Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -38,101 +38,105 @@ { OFDataArray *array; } /** + * \brief Creates a new OFArray. + * * \return A new autoreleased OFArray */ + array; /** - * Creates a new OFArray with the specified object. + * \brief Creates a new OFArray with the specified object. * * \param object An object * \return A new autoreleased OFArray */ + arrayWithObject: (id)object; /** - * Creates a new OFArray with the specified objects, terminated by nil. + * \brief Creates a new OFArray with the specified objects, terminated by nil. * * \param firstObject The first object in the array * \return A new autoreleased OFArray */ + arrayWithObjects: (id)firstObject, ...; /** - * Creates a new OFArray with the objects from the specified C array. + * \brief Creates a new OFArray with the objects from the specified C array. * * \param objects A C array of objects, terminated with nil * \return A new autoreleased OFArray */ + arrayWithCArray: (id*)objects; /** - * Creates a new OFArray with the objects from the specified C array of the - * specified length. + * \brief Creates a new OFArray with the objects from the specified C array of + * the specified length. * * \param objects A C array of objects * \param length The length of the C array * \return A new autoreleased OFArray */ + arrayWithCArray: (id*)objects length: (size_t)length; /** - * Initializes an OFArray with the specified object. + * \brief Initializes an OFArray with the specified object. * * \param object An object * \return An initialized OFArray */ - initWithObject: (id)object; /** - * Initializes an OFArray with the specified objects. + * \brief Initializes an OFArray with the specified objects. * * \param firstObject The first object * \return An initialized OFArray */ - initWithObjects: (id)firstObject, ...; /** - * Initializes an OFArray with the specified object and a va_list. + * \brief Initializes an OFArray with the specified object and a va_list. * * \param firstObject The first object * \param arguments A va_list * \return An initialized OFArray */ - initWithObject: (id)firstObject arguments: (va_list)arguments; /** - * Initializes an OFArray with the objects from the specified C array. + * \brief Initializes an OFArray with the objects from the specified C array. * * \param objects A C array of objects, terminated with nil * \return An initialized OFArray */ - initWithCArray: (id*)objects; /** - * Initializes an OFArray with the objects from the specified C array of the - * specified length. + * \brief Initializes an OFArray with the objects from the specified C array of + * the specified length. * * \param objects A C array of objects * \param length The length of the C array * \return An initialized OFArray */ - initWithCArray: (id*)objects length: (size_t)length; /** + * \brief Returns the objects of the array as a C array. + * * \return The objects of the array as a C array */ - (id*)cArray; /** - * Returns a specific object of the array. + * \brief Returns a specified object of the array. * * The returned object is not retained and autoreleased for performance * reasons! * * \param index The number of the object to return @@ -139,52 +143,52 @@ * \return The specified object of the OFArray */ - (id)objectAtIndex: (size_t)index; /** - * Returns the index of the first object that is equivalent to the specified - * object or OF_INVALID_INDEX if it was not found. + * \brief Returns the index of the first object that is equivalent to the + * specified object or OF_INVALID_INDEX if it was not found. * * \param object The object whose index is returned * \return The index of the first object equivalent to the specified object * or OF_INVALID_INDEX if it was not found */ - (size_t)indexOfObject: (id)object; /** - * Returns the index of the first object that has the same address as the - * specified object or OF_INVALID_INDEX if it was not found. + * \brief Returns the index of the first object that has the same address as the + * specified object or OF_INVALID_INDEX if it was not found. * * \param object The object whose index is returned * \return The index of the first object that has the same aaddress as * the specified object or OF_INVALID_INDEX if it was not found */ - (size_t)indexOfObjectIdenticalTo: (id)object; /** - * Returns the first object of the array or nil. + * \brief Returns the first object of the array or nil. * * The returned object is not retained and autoreleased for performance * reasons! * * \return The first object of the array or nil */ - (id)firstObject; /** - * Returns the last object of the array or nil. + * \brief Returns the last object of the array or nil. * * The returned object is not retained and autoreleased for performance * reasons! * * \return The last object of the array or nil */ - (id)lastObject; /** - * Returns the objects from the specified index to the specified index as a new - * OFArray. + * \brief Returns the objects from the specified index to the specified index as + * a new OFArray. * * \param start The index where the subarray starts * \param end The index where the subarray ends. * This points BEHIND the last object! * \return The subarray as a new autoreleased OFArray @@ -191,34 +195,35 @@ */ - (OFArray*)objectsFromIndex: (size_t)start toIndex: (size_t)end; /** - * Returns the objects in the specified range as a new OFArray. + * \brief Returns the objects in the specified range as a new OFArray. + * * \param range The range for the subarray * \return The subarray as a new autoreleased OFArray */ - (OFArray*)objectsInRange: (of_range_t)range; /** - * Creates a string by joining all objects of the array. + * \brief Creates a string by joining all objects of the array. * * \param separator The string with which the objects should be joined * \return A string containing all objects joined by the separator */ - (OFString*)componentsJoinedByString: (OFString*)separator; /** - * Performs the specified selector on all objects in the array. + * \brief Performs the specified selector on all objects in the array. * * \param selector The selector to perform on all objects in the array */ - (void)makeObjectsPerformSelector: (SEL)selector; /** - * Performs the specified selector on all objects in the array with the - * specified object. + * \brief Performs the specified selector on all objects in the array with the + * specified object. * * \param selector The selector to perform on all objects in the array * \param object The object to perform the selector with on all objects in the * array */ @@ -225,27 +230,27 @@ - (void)makeObjectsPerformSelector: (SEL)selector withObject: (id)object; #ifdef OF_HAVE_BLOCKS /** - * Executes a block for each object. + * \brief Executes a block for each object. * * \param block The block to execute for each object */ - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block; /** - * Returns a new array, mapping each object using the specified block. + * \brief Returns a new array, mapping each object using the specified block. * * \param block A block which maps an object for each object * \return A new, autoreleased OFArray */ - (OFArray*)mappedArrayUsingBlock: (of_array_map_block_t)block; /** - * Returns a new array, only containing the objects for which the block returns - * YES. + * \brief Returns a new array, only containing the objects for which the block + * returns YES. * * \param block A block which determines if the object should be in the new * array * \return A new, autoreleased OFArray */ Index: src/OFAutoreleasePool.h ================================================================== --- src/OFAutoreleasePool.h +++ src/OFAutoreleasePool.h @@ -24,34 +24,36 @@ * * Every thread has its own stack of autorelease pools. */ @interface OFAutoreleasePool: OFObject { - OFAutoreleasePool *next, *prev; + OFAutoreleasePool *nextPool, *previousPool; id *objects; size_t count, size; } /** - * Adds an object to the autorelease pool at the top of the thread-specific - * stack. + * \brief Adds an object to the autorelease pool at the top of the + * thread-specific autorelease pool stack. * - * \param obj The object to add to the autorelease pool + * \param object The object to add to the autorelease pool */ -+ (void)addObject: (id)obj; ++ (void)addObject: (id)object; +/// \cond internal + (void)releaseAll; +/// \endcond /** - * Adds an object to the specific autorelease pool. + * \brief Adds an object to the specific autorelease pool. * * \param obj The object to add to the autorelease pool */ -- (void)addObject: (id)obj; +- (void)addObject: (id)object; /** - * Releases all objects in the autorelease pool. + * \brief Releases all objects in the autorelease pool. * * This does not free the memory allocated to store pointers to the objects in * the pool, so reusing the pool does not allocate any memory until the previous * number of objects is exceeded. It behaves this way to optimize loops that * always work with the same or similar number of objects and call relaseObjects @@ -64,17 +66,17 @@ * of a loop, which adds objects again. Thus, it is usually a clean up call. */ - (void)releaseObjects; /** - * Releases all objects in the autorelease pool and deallocates the pool. + * \brief Releases all objects in the autorelease pool and deallocates the pool. */ - (void)release; /** - * Calling drain is equivalent to calling release. + * \brief Tells the garbage collector that now is a good time to clean up. * - * If a garbage collector is added in the future, it will tell the GC that now - * is a good time to clean up. + * If there is no garbage collector, calling drain is equivalent to calling + * release. */ - (void)drain; @end Index: src/OFAutoreleasePool.m ================================================================== --- src/OFAutoreleasePool.m +++ src/OFAutoreleasePool.m @@ -24,13 +24,13 @@ #import "OFInitializationFailedException.h" #import "OFNotImplementedException.h" #ifdef OF_THREADS # import "threading.h" -static of_tlskey_t first_key, last_key; +static of_tlskey_t firstKey, lastKey; #else -static OFAutoreleasePool *first = nil, *last = nil; +static OFAutoreleasePool *firstPool = nil, *lastPool = nil; #endif #define GROW_SIZE 16 @implementation OFAutoreleasePool @@ -38,87 +38,87 @@ + (void)initialize { if (self != [OFAutoreleasePool class]) return; - if (!of_tlskey_new(&first_key) || !of_tlskey_new(&last_key)) + if (!of_tlskey_new(&firstKey) || !of_tlskey_new(&lastKey)) @throw [OFInitializationFailedException newWithClass: self]; } #endif -+ (void)addObject: (id)obj ++ (void)addObject: (id)object { #ifdef OF_THREADS - id last = of_tlskey_get(last_key); + id lastPool = of_tlskey_get(lastKey); #endif - if (last == nil) { + if (lastPool == nil) { @try { [[self alloc] init]; } @catch (id e) { - [obj release]; + [object release]; @throw e; } #ifdef OF_THREADS - last = of_tlskey_get(last_key); + lastPool = of_tlskey_get(lastKey); #endif } - if (last == nil) { - [obj release]; + if (lastPool == nil) { + [object release]; @throw [OFInitializationFailedException newWithClass: self]; } @try { - [last addObject: obj]; + [lastPool addObject: object]; } @catch (id e) { - [obj release]; + [object release]; @throw e; } } + (void)releaseAll { #ifdef OF_THREADS - [of_tlskey_get(first_key) release]; + [of_tlskey_get(firstKey) release]; #else - [first release]; + [firstPool release]; #endif } - init { self = [super init]; @try { #ifdef OF_THREADS - id first = of_tlskey_get(first_key); - prev = of_tlskey_get(last_key); + id firstPool = of_tlskey_get(firstKey); + previousPool = of_tlskey_get(lastKey); - if (!of_tlskey_set(last_key, self)) + if (!of_tlskey_set(lastKey, self)) @throw [OFInitializationFailedException newWithClass: isa]; #else - prev = last; - last = self; + previousPool = lastPool; + lastPool = self; #endif - if (first == nil) { + if (firstPool == nil) { #ifdef OF_THREADS - if (!of_tlskey_set(first_key, self)) { - of_tlskey_set(last_key, prev); + if (!of_tlskey_set(firstKey, self)) { + of_tlskey_set(lastKey, previousPool); @throw [OFInitializationFailedException newWithClass: isa]; } #else - first = self; + firstPool = self; #endif } - if (prev != nil) - prev->next = self; + if (previousPool != nil) + previousPool->nextPool = self; size = GROW_SIZE; objects = [self allocMemoryForNItems: GROW_SIZE withSize: sizeof(id)]; } @catch (id e) { @@ -127,28 +127,28 @@ } return self; } -- (void)addObject: (id)obj +- (void)addObject: (id)object { if (count + 1 > size) { objects = [self resizeMemory: objects toNItems: size + GROW_SIZE withSize: sizeof(id)]; size += GROW_SIZE; } - objects[count] = obj; + objects[count] = object; count++; } - (void)releaseObjects { size_t i; - [next releaseObjects]; + [nextPool releaseObjects]; for (i = 0; i < count; i++) [objects[i] release]; count = 0; @@ -166,11 +166,11 @@ - (void)dealloc { size_t i; - [next dealloc]; + [nextPool dealloc]; for (i = 0; i < count; i++) [objects[i] release]; /* @@ -180,30 +180,30 @@ * pool, but released when the pool below gets released - and maybe * the pool itself will be released as well then, because maybe * of_tlskey_set will work this time. */ #ifdef OF_THREADS - if (!of_tlskey_set(last_key, prev)) + if (!of_tlskey_set(lastKey, previousPool)) return; #else - last = prev; + lastPool = previousPool; #endif - if (prev != nil) - prev->next = nil; + if (previousPool != nil) + previousPool->nextPool = nil; /* * If of_tlskey_set fails here, this is even worse, as this will * definitely be a memory leak. But this should never happen anyway. */ #ifdef OF_THREADS - if (of_tlskey_get(first_key) == self) - if (!of_tlskey_set(first_key, nil)) + if (of_tlskey_get(firstKey) == self) + if (!of_tlskey_set(firstKey, nil)) return; #else - if (first == self) - first = nil; + if (firstPool == self) + firstPool = nil; #endif [super dealloc]; } Index: src/OFBlock.h ================================================================== --- src/OFBlock.h +++ src/OFBlock.h @@ -44,10 +44,13 @@ #endif #ifndef Block_release # define Block_release(x) _Block_release((const void*)(x)) #endif +/** + * \brief The class for all blocks, since all blocks are also objects. + */ @interface OFBlock: OFObject @end @interface OFStackBlock: OFBlock @end Index: src/OFCollection.h ================================================================== --- src/OFCollection.h +++ src/OFCollection.h @@ -23,27 +23,38 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly) size_t count; #endif /** + * \brief Returns the number of objects in the collection. + * * \return The number of objects in the collection */ - (size_t)count; /** + * \brief Returns an OFEnumerator to enumerate through all objects of the + * collection. + * * \returns An OFEnumerator to enumerate through all objects of the collection */ - (OFEnumerator*)objectEnumerator; /** + * \brief Checks whether the collection contains an object equal to the + * specified object. + * * \param The object which is checked for being in the collection * \return A boolean whether the collection contains the specified object */ - (BOOL)containsObject: (id)object; /** + * \brief Checks whether the collection contains an object with the specified + * address. + * * \param The object which is checked for being in the collection * \return A boolean whether the collection contains an object with the * specified address. */ - (BOOL)containsObjectIdenticalTo: (id)object; @end Index: src/OFDataArray+Hashing.h ================================================================== --- src/OFDataArray+Hashing.h +++ src/OFDataArray+Hashing.h @@ -30,14 +30,18 @@ * The OFDataArray (Hashing) category provides methods to calculate hashes for * data arrays. */ @interface OFDataArray (Hashing) /** + * \brief Returns the MD5 hash of the data array as an autoreleased OFString. + * * \return The MD5 hash of the data array as an autoreleased OFString */ - (OFString*)MD5Hash; /** - * \return The SHA1 hash of the data array as an autoreleased OFString + * \brief Returns the SHA-1 hash of the data array as an autoreleased OFString. + * + * \return The SHA-1 hash of the data array as an autoreleased OFString */ - (OFString*)SHA1Hash; @end Index: src/OFDataArray.h ================================================================== --- src/OFDataArray.h +++ src/OFDataArray.h @@ -36,154 +36,164 @@ @property (readonly) size_t count; @property (readonly) size_t itemSize; #endif /** - * Creates a new OFDataArray with an item size of 1. + * \brief Creates a new OFDataArray with an item size of 1. * * \return A new autoreleased OFDataArray */ + dataArray; /** - * Creates a new OFDataArray whose items all have the same size. + * \brief Creates a new OFDataArray whose items all have the same size. * * \param itemSize The size of each element in the OFDataArray * \return A new autoreleased OFDataArray */ + dataArrayWithItemSize: (size_t)itemSize; /** - * Creates a new OFDataArary with an item size of 1, containing the data of the - * specified file. + * \brief Creates a new OFDataArary with an item size of 1, containing the data + * of the specified file. * * \param path The path of the file * \return A new autoreleased OFDataArray */ + dataArrayWithContentsOfFile: (OFString*)path; /** - * Creates a new OFDataArray with an item size of 1, containing the data of the - * specified URL. + * \brief Creates a new OFDataArray with an item size of 1, containing the data + * of the specified URL. * * \param URL The URL to the contents for the OFDataArray * \return A new autoreleased OFDataArray */ + dataArrayWithContentsOfURL: (OFURL*)URL; /** - * Creates a new OFDataArray with an item size of 1, containing the data of the - * Base64-encoded 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 * \return A new autoreleased OFDataArray */ + dataArrayWithBase64EncodedString: (OFString*)string; /** - * Initializes an already allocated OFDataArray with an item size of 1. + * \brief Initializes an already allocated OFDataArray with an item size of 1. * * \return A initialized OFDataArray */ - init; /** - * Initializes an already allocated OFDataArray whose items all have the same - * size. + * \brief Initializes an already allocated OFDataArray whose items all have the + * same size. * * \param itemSize The size of each element in the OFDataArray * \return An initialized OFDataArray */ - initWithItemSize: (size_t)itemSize; /** - * Initializes an already allocated OFDataArray with an item size of 1, - * containing the data of the specified file. + * \brief Initializes an already allocated OFDataArray with an item size of 1, + * containing the data of the specified file. * * \param path The path of the file * \return An initialized OFDataArray */ - initWithContentsOfFile: (OFString*)path; /** - * Initializes an already allocated OFDataArray with an item size of 1, - * containing the data of the specified URL. + * \brief Initializes an already allocated OFDataArray with an item size of 1, + * containing the data of the specified URL. * * \param URL The URL to the contents for the OFDataArray * \return A new autoreleased OFDataArray */ - initWithContentsOfURL: (OFURL*)URL; /** - * Initializes an already allocated OFDataArray with an item size of 1, - * containing the data of the Base64-encoded 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 * \return A initialized OFDataArray */ - initWithBase64EncodedString: (OFString*)string; /** + * \brief Returns the number of items in the OFDataArray. + * * \return The number of items in the OFDataArray */ - (size_t)count; /** + * \brief Returns the size of each item in the OFDataArray in bytes. + * * \return The size of each item in the OFDataArray in bytes */ - (size_t)itemSize; /** + * \brief Returns all elements of the OFDataArray as a C array. + * * \return All elements of the OFDataArray as a C array */ - (void*)cArray; /** - * Returns a specific item of the OFDataArray. + * \brief Returns a specific item of the OFDataArray. * * \param index The number of the item to return * \return The specified item of the OFDataArray */ - (void*)itemAtIndex: (size_t)index; /** + * \brief Returns the first item of the OFDataArray. + * * \return The first item of the OFDataArray or NULL */ - (void*)firstItem; /** + * \brief Returns the last item of the OFDataArray. + * * \return The last item of the OFDataArray or NULL */ - (void*)lastItem; /** - * Adds an item to the OFDataArray. + * \brief Adds an item to the OFDataArray. * * \param item A pointer to an arbitrary item */ - (void)addItem: (const void*)item; /** - * Adds an item to the OFDataArray at the specified index. + * \brief Adds an item to the OFDataArray at the specified index. * * \param item A pointer to an arbitrary item * \param index The index where the item should be added */ - (void)addItem: (const void*)item atIndex: (size_t)index; /** - * Adds items from a C array to the OFDataArray. + * \brief Adds items from a C array to the OFDataArray. * * \param nItems The number of items to add * \param cArray A C array containing the items to add */ - (void)addNItems: (size_t)nItems fromCArray: (const void*)cArray; /** - * Adds items from a C array to the OFDataArray at the specified index. + * \brief Adds items from a C array to the OFDataArray at the specified index. * * \param nItems The number of items to add * \param cArray A C array containing the items to add * \param index The index where the items should be added */ @@ -190,39 +200,41 @@ - (void)addNItems: (size_t)nItems fromCArray: (const void*)cArray atIndex: (size_t)index; /** - * Removes the item at the specified index. + * \brief Removes the item at the specified index. * * \param index The index of the item to remove */ - (void)removeItemAtIndex: (size_t)index; /** - * Removes the specified amount of items from the end of the OFDataArray. + * \brief Removes the specified amount of items from the end of the OFDataArray. * * \param nItems The number of items to remove */ - (void)removeNItems: (size_t)nItems; /** - * Removes the specified amount of items at the specified index. + * \brief Removes the specified amount of items at the specified index. * * \param nItems The number of items to remove * \param index The index at which the items are removed */ - (void)removeNItems: (size_t)nItems atIndex: (size_t)index; /** + * \brief Returns a string containing the data in Base64 encoding. + * * \return A string containing the data in Base64 encoding */ - (OFString*)stringByBase64Encoding; /** - * Writes the OFDataArray into the specified file. + * \brief Writes the OFDataArray into the specified file. * * \param path The path of the file to write to */ - (void)writeToFile: (OFString*)path; @end Index: src/OFDate.h ================================================================== --- src/OFDate.h +++ src/OFDate.h @@ -26,227 +26,289 @@ int64_t seconds; uint32_t microseconds; } /** + * \brief Creates a new OFDate with the current date and time. + * * \return A new, autoreleased OFDate with the current date and time */ + date; /** + * \brief Creates a new OFDate with the specified date and time since + * 1970-01-01T00:00:00Z. + * * \param seconds The seconds since 1970-01-01T00:00:00Z * \return A new, autoreleased OFDate with the specified date and time */ + dateWithTimeIntervalSince1970: (int64_t)seconds; /** + * \brief Creates a new OFDate with the specified date and time since + * 1970-01-01T00:00:00Z. + * * \param seconds The seconds since 1970-01-01T00:00:00Z * \param microseconds The microsecond part of the time * \return A new, autoreleased OFDate with the specified date and time */ + dateWithTimeIntervalSince1970: (int64_t)seconds microseconds: (uint32_t)microseconds; /** + * \brief Creates a new OFDate with the specified date and time since now. + * * \param seconds The seconds since now * \return A new, autoreleased OFDate with the specified date and time */ + dateWithTimeIntervalSinceNow: (int64_t)seconds; /** + * \brief Creates a new OFDate with the specified date and time since now. + * * \param seconds The seconds since now * \param microseconds The microsecond part of the time * \return A new, autoreleased OFDate with the specified date and time */ + dateWithTimeIntervalSinceNow: (int64_t)seconds microseconds: (uint32_t)microseconds; /** - * Returns a date in the distant future. The date is system-dependant. + * \brief Returns a date in the distant future. + * + * The date is system-dependant. * * \return A date in the distant future */ + distantFuture; /** - * Returns a date in the distant past. The date is system-dependant. + * \brief Returns a date in the distant past. + * + * The date is system-dependant. * * \return A date in the distant past */ + distantPast; /** - * Initializes an already allocated OFDate with the specified date and time. + * \brief Initializes an already allocated OFDate with the specified date and + * time since 1970-01-01T00:00:00Z. * * \param seconds The seconds since 1970-01-01T00:00:00Z * \return An initialized OFDate with the specified date and time */ - initWithTimeIntervalSince1970: (int64_t)seconds; /** - * Initializes an already allocated OFDate with the specified date and time. + * \brief Initializes an already allocated OFDate with the specified date and + * time since 1970-01-01T00:00:00Z. * * \param seconds The seconds since 1970-01-01T00:00:00Z * \param microseconds The microsecond part of the time * \return An initialized OFDate with the specified date and time */ - initWithTimeIntervalSince1970: (int64_t)seconds microseconds: (uint32_t)microseconds; /** - * Initializes an already allocated OFDate with the specified date and time. + * \brief Initializes an already allocated OFDate with the specified date and + * time since now. * * \param seconds The seconds since now * \return A new, autoreleased OFDate with the specified date and time */ - initWithTimeIntervalSinceNow: (int64_t)seconds; /** - * Initializes an already allocated OFDate with the specified date and time. + * \brief Initializes an already allocated OFDate with the specified date and + * time since now. * * \param seconds The seconds since now * \param microseconds The microsecond part of the time * \return A new, autoreleased OFDate with the specified date and time */ - initWithTimeIntervalSinceNow: (int64_t)seconds microseconds: (uint32_t)microseconds; /** + * \brief Returns the microsecond of the date. + * * \return The microsecond of the date */ - (uint32_t)microsecond; /** + * \brief Returns the second of the date. + * * \return The second of the date */ - (uint8_t)second; /** + * \brief Returns the minute of the date. + * * \return The minute of the date */ - (uint8_t)minute; /** + * \brief Returns the hour of the date. + * * \return The hour of the date */ - (uint8_t)hour; /** + * \brief Returns the hour of the date in local time. + * * \return The hour of the date in local time */ - (uint8_t)localHour; /** + * \brief Returns the day of the month. + * * \return The day of the month of the date */ - (uint8_t)dayOfMonth; /** + * \brief Returns the day of the month of the date in local time. + * * \return The day of the month of the date in local time */ - (uint8_t)localDayOfMonth; /** + * \brief Returns the month of the year of the date. + * * \return The month of the year of the date */ - (uint8_t)monthOfYear; /** + * \brief Returns the month of the year of the date in local time. + * * \return The month of the year of the date in local time */ - (uint8_t)localMonthOfYear; /** + * \brief Returns the year of the date. + * * \return The year of the date */ - (uint16_t)year; /** + * \brief Returns the day of the week of the date. + * * \return The day of the week of the date */ - (uint8_t)dayOfWeek; /** + * \brief Returns the day of the week of the date in local time. + * * \return The day of the week of the date in local time */ - (uint8_t)localDayOfWeek; /** + * \brief Returns the day of the year of the date. + * * \return The day of the year of the date */ - (uint16_t)dayOfYear; /** + * \brief Returns the day of the year of the date in local time. + * * \return The day of the year of the date in local time */ - (uint16_t)localDayOfYear; /** - * Creates a string of the date with the specified format. + * \brief Creates a string of the date with the specified format. * * See the manpage for strftime for information on the format. * * \param fmt The format for the date string * \return A new, autoreleased OFString */ - (OFString*)dateStringWithFormat: (OFString*)fmt; /** - * Creates a string of the local date with the specified format. + * \brief Creates a string of the local date with the specified format. * * See the manpage for strftime for information on the format. * * \param fmt The format for the date string * \return A new, autoreleased OFString */ - (OFString*)localDateStringWithFormat: (OFString*)fmt; /** + * \brief Returns the earlier of the two dates. + * * \param date Another date * \return The earlier date of the two dates */ - (OFDate*)earlierDate: (OFDate*)otherDate; /** + * \brief Returns the later of the two dates. + * * \param date Another date * \return The later date of the two dates */ - (OFDate*)laterDate: (OFDate*)otherDate; /** + * \brief Returns the seconds since 1970-01-01T00:00:00Z. + * * \return The seconds since 1970-01-01T00:00:00Z */ - (int64_t)timeIntervalSince1970; /** + * \brief Returns the microseconds part of the seconds since + * 1970-01-01T00:00:00Z. + * * \return The microseconds part of the seconds since 1970-01-01T00:00:00Z */ - (uint32_t)microsecondsOfTimeIntervalSince1970; /** + * \brief Returns the seconds the receiver is after the date. + * * \return The seconds the receiver is after the date. */ - (int64_t)timeIntervalSinceDate: (OFDate*)otherDate; /** + * \brief Returns the microseconds part of the seconds the receiver is after the + * date. + * * \return The microseconds part of the seconds the receiver is after the date */ - (uint32_t)microsecondsOfTimeIntervalSinceDate: (OFDate*)otherDate; /** - * Returns a new date with the specified time interval added. + * \brief Returns a new date with the specified time interval added. * * \param seconds The seconds after the date * \return A new, autoreleased OFDate */ - (OFDate*)dateByAddingTimeInterval: (int64_t)seconds; /** - * Returns a new date with the specified time interval added. + * \brief Returns a new date with the specified time interval added. * * \param seconds The seconds after the date * \param microseconds The microseconds after the date * \return A new, autoreleased OFDate */ - (OFDate*)dateByAddingTimeInterval: (int64_t)seconds withMicroseconds: (uint32_t)microseconds; @end Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -46,112 +46,112 @@ uint32_t size; size_t count; } /** - * Creates a new OFDictionary. + * \brief Creates a new OFDictionary. * * \return A new autoreleased OFDictionary */ + dictionary; /** - * Creates a new OFDictionary with the specified dictionary. + * \brief Creates a new OFDictionary with the specified dictionary. * * \param dictionary An OFDictionary * \return A new autoreleased OFDictionary */ + dictionaryWithDictionary: (OFDictionary*)dictionary; /** - * Creates a new OFDictionary with the specified key and object. + * \brief Creates a new OFDictionary with the specified key and object. * * \param key The key * \param object The object * \return A new autoreleased OFDictionary */ + dictionaryWithObject: (id)object forKey: (id )key; /** - * Creates a new OFDictionary with the specified keys and objects. + * \brief Creates a new OFDictionary with the specified keys and objects. * * \param keys An array of keys * \param objects An array of objects * \return A new autoreleased OFDictionary */ + dictionaryWithObjects: (OFArray*)objects forKeys: (OFArray*)keys; /** - * Creates a new OFDictionary with the specified keys objects. + * \brief Creates a new OFDictionary with the specified keys objects. * * \param firstKey The first key * \return A new autoreleased OFDictionary */ + dictionaryWithKeysAndObjects: (id )firstKey, ...; /** - * Initializes an already allocated OFDictionary. + * \brief Initializes an already allocated OFDictionary. * * \return An initialized OFDictionary */ - init; /** - * Initializes an already allocated OFDictionary with the specified - * OFDictionary. + * \brief Initializes an already allocated OFDictionary with the specified + * OFDictionary. * * \param dictionary An OFDictionary * \return An initialized OFDictionary */ - initWithDictionary: (OFDictionary*)dictionary; /** - * Initializes an already allocated OFDictionary with the specified key and - * object. + * \brief Initializes an already allocated OFDictionary with the specified key + * and object. * * \param key The key * \param object The object * \return A new initialized OFDictionary */ - initWithObject: (id)object forKey: (id )key; /** - * Initializes an already allocated OFDictionary with the specified keys and - * objects. + * \brief Initializes an already allocated OFDictionary with the specified keys + * and objects. * * \param keys An array of keys * \param objects An array of objects * \return A new initialized OFDictionary */ - initWithObjects: (OFArray*)objects forKeys: (OFArray*)keys; /** - * Initializes an already allocated OFDictionary with the specified keys and - * objects. + * \brief Initializes an already allocated OFDictionary with the specified keys + * and objects. * * \param firstKey The first key * \return A new initialized OFDictionary */ - initWithKeysAndObjects: (id )firstKey, ...; /** - * Initializes an already allocated OFDictionary with the specified key and - * va_list. + * \brief Initializes an already allocated OFDictionary with the specified key + * and va_list. * * \param firstKey The first key * \param arguments A va_list of the other arguments * \return A new initialized OFDictionary */ - initWithKey: (id )firstKey arguments: (va_list)arguments; /** - * Returns the object for the given key or nil if the key was not found. + * \brief Returns the object for the given key or nil if the key was not found. * * The returned object is not retained and autoreleased for performance * reasons! * * \param key The key whose object should be returned @@ -158,34 +158,37 @@ * \return The object for the given key or nil if the key was not found */ - (id)objectForKey: (id)key; /** + * \brief Returns an OFEnumerator to enumerate through the dictionary's keys. + * * \return An OFEnumerator to enumerate through the dictionary's keys */ - (OFEnumerator*)keyEnumerator; #ifdef OF_HAVE_BLOCKS /** - * Executes a block for each key / object pair. + * \brief Executes a block for each key / object pair. * * \param block The block to execute for each key / object pair. */ - (void)enumerateKeysAndObjectsUsingBlock: (of_dictionary_enumeration_block_t)block; /** - * Returns a new dictionary, mapping each object using the specified block. + * \brief Returns a new dictionary, mapping each object using the specified + * block. * * \param block A block which maps an object for each object * \return A new, autorelease OFDictionary */ - (OFDictionary*)mappedDictionaryUsingBlock: (of_dictionary_map_block_t)block; /** - * Returns a new dictionary, only containing the objects for which the block - * returns YES. + * \brief Returns a new dictionary, only containing the objects for which the + * block returns YES. * * \param block A block which determines if the object should be in the new * dictionary * \return A new, autoreleased OFDictionary */ Index: src/OFEnumerator.h ================================================================== --- src/OFEnumerator.h +++ src/OFEnumerator.h @@ -19,17 +19,19 @@ /** * \brief A class which provides methods to enumerate through collections. */ @interface OFEnumerator: OFObject /** + * \brief Returns the next object. + * * \return The next object */ - (id)nextObject; /** - * Resets the enumerator, so the next call to nextObject returns the first - * object again. + * \brief Resets the enumerator, so the next call to nextObject returns the + * first object again. */ - (void)reset; @end /*