@@ -44,11 +44,11 @@ - (id)object; /** * \return An error message for the exception as a C String */ -- (char*)cString; +- (const char*)cString; @end /** * An OFException indicating there is not enough memory available. */ @@ -56,12 +56,10 @@ { size_t req_size; } /** - * Creates a new no memory exception. - * * \param obj The object which caused the exception * \param size The size of the memory that couldn't be allocated * \return A new no memory exception */ + newWithObject: (id)obj @@ -78,11 +76,11 @@ andSize: (size_t)size; /** * \return An error message for the exception as a C String */ -- (char*)cString; +- (const char*)cString; /** * \return The size of the memoory that couldn't be allocated */ - (size_t)requestedSize; @@ -95,12 +93,10 @@ { void *pointer; } /** - * Creates a new memory not part of object exception. - * * \param obj The object which caused the exception * \param ptr A pointer to the memory that is not part of the object * \return A new memory not part of object exception */ + newWithObject: (id)obj @@ -117,11 +113,11 @@ andPointer: (void*)ptr; /** * \return An error message for the exception as a C String */ -- (char*)cString; +- (const char*)cString; /** * \return A pointer to the memory which is not part of the object */ - (void*)pointer; @@ -132,21 +128,21 @@ */ @interface OFOutOfRangeException: OFException {} /** * \return An error message for the exception as a C String */ -- (char*)cString; +- (const char*)cString; @end /** * An OFException indicating that the conversation between two charsets failed. */ @interface OFCharsetConversionFailedException: OFException {} /** * \return An error message for the exception as a C String */ -- (char*)cString; +- (const char*)cString; @end /** * An OFException indicating the file couldn't be opened. */ @@ -155,12 +151,10 @@ char *path; char *mode; } /** - * Creates a new open file failed exception. - * * \param obj The object which caused the exception * \param p A C string of the path to the file tried to open * \param m A C string of the mode in which the file should have been opened * \return A new open file failed exception */ @@ -183,11 +177,11 @@ - free; /** * \return An error message for the exception as a C String */ -- (char*)cString; +- (const char*)cString; /** * \return A C string of the path to the file which couldn't be opened */ - (char*)path; @@ -207,12 +201,10 @@ size_t req_items; BOOL has_items; } /** - * Creates a new read or write failed exception. - * * \param obj The object which caused the exception * \param size The requested size of the data that couldn't be read / written * \param nitems The requested number of items that couldn't be read / written * \return A new open file failed exception */ @@ -219,12 +211,10 @@ + newWithObject: (id)obj andSize: (size_t)size andNItems: (size_t)nitems; /** - * Creates a new read or write failed exception. - * * \param obj The object which caused the exception * \param size The requested size of the data that couldn't be read / written * \return A new open file failed exception */ + newWithObject: (id)obj @@ -259,40 +249,45 @@ /** * \return The requested number of items that coudln't be read / written */ - (size_t)requestedItems; + +/** + * \return Whether NItems was specified + */ +- (BOOL)hasNItems; @end /** * An OFException indicating a read to the file failed. */ @interface OFReadFailedException: OFReadOrWriteFailedException {} /** * \return An error message for the exception as a C String */ -- (char*)cString; +- (const char*)cString; @end /** * An OFException indicating a write to the file failed. */ @interface OFWriteFailedException: OFReadOrWriteFailedException {} /** * \return An error message for the exception as a C String */ -- (char*)cString; +- (const char*)cString; @end /** * An OFException indicating a socket is not connected or bound. */ @interface OFNotConnectedException: OFException {} /** * \return An error message for the exception as a C string. */ -- (char*)cString; +- (const char*)cString; @end /** * An OFException indicating an attempt to connect or bind an already connected * or bound socket @@ -299,17 +294,64 @@ */ @interface OFAlreadyConnectedException: OFException {} /** * \return An error message for the exception as a C string. */ -- (char*)cString; +- (const char*)cString; @end /** * An OFException indicating that the specified port is invalid. */ -@interface OFInvalidPortException: OFException +@interface OFInvalidPortException: OFException {} +/** + * \return An error message for the exception as a C string. + */ +- (const char*)cString; +@end + +/** + * An OFException indicating the translation of an address failed. + */ +@interface OFAddressTranslationFailedException: OFException +{ + char *node; + char *service; +} + +/** + * \param n The node for which translation was requested + * \param s The service of the node for which translation was requested + * \return A new address translation failed exception + */ ++ newWithObject: (id)obj + andNode: (const char*)n + andService: (const char*)s; + +/** + * Initializes an already allocated address translation failed exception. + * + * \param n The node for which translation was requested + * \param s The service of the node for which translation was requested + * \return An initialized address translation failed exception + */ +- initWithObject: (id)obj + andNode: (const char*)n + andService: (const char*)s; + +- free; + /** * \return An error message for the exception as a C string. */ -- (char*)cString; +- (const char*)cString; + +/** + * /return The node for which translation was requested + */ +- (const char*)node; + +/** + * \return The service of the node for which translation was requested + */ +- (const char*)service; @end