00001 /* 00002 * Copyright (c) 2008 - 2009 00003 * Jonathan Schleifer <js@webkeks.org> 00004 * 00005 * All rights reserved. 00006 * 00007 * This file is part of ObjFW. It may be distributed under the terms of the 00008 * Q Public License 1.0, which can be found in the file LICENSE included in 00009 * the packaging of this file. 00010 */ 00011 00012 #import "OFObject.h" 00013 #import "OFString.h" 00014 #import "OFFile.h" 00015 00028 @interface OFAllocFailedException 00029 { 00030 Class isa; 00031 } 00032 00033 + (Class)class; 00034 00038 - (OFString*)string; 00039 @end 00040 00047 @interface OFException: OFObject 00048 { 00049 Class class_; 00050 OFString *string; 00051 } 00052 00059 + newWithClass: (Class)class_; 00060 00067 - initWithClass: (Class)class_; 00068 00072 - (Class)inClass; 00073 00077 - (OFString*)string; 00078 @end 00079 00083 @interface OFOutOfMemoryException: OFException 00084 { 00085 size_t req_size; 00086 } 00087 00093 + newWithClass: (Class)class_ 00094 size: (size_t)size; 00095 00103 - initWithClass: (Class)class_ 00104 size: (size_t)size; 00105 00109 - (size_t)requestedSize; 00110 @end 00111 00115 @interface OFMemoryNotPartOfObjectException: OFException 00116 { 00117 void *pointer; 00118 } 00119 00125 + newWithClass: (Class)class_ 00126 pointer: (void*)ptr; 00127 00135 - initWithClass: (Class)class_ 00136 pointer: (void*)ptr; 00137 00141 - (void*)pointer; 00142 @end 00143 00147 @interface OFNotImplementedException: OFException 00148 { 00149 SEL selector; 00150 } 00151 00157 + newWithClass: (Class)class_ 00158 selector: (SEL)selector; 00159 00167 - initWithClass: (Class)class_ 00168 selector: (SEL)selector; 00169 @end 00170 00174 @interface OFOutOfRangeException: OFException {} 00175 @end 00176 00180 @interface OFInvalidArgumentException: OFException 00181 { 00182 SEL selector; 00183 } 00184 00190 + newWithClass: (Class)class_ 00191 selector: (SEL)selector; 00192 00200 - initWithClass: (Class)class_ 00201 selector: (SEL)selector; 00202 @end 00203 00207 @interface OFInvalidEncodingException: OFException {} 00208 @end 00209 00213 @interface OFInvalidFormatException: OFException {} 00214 @end 00215 00219 @interface OFMalformedXMLException: OFException {} 00220 @end 00221 00225 @interface OFInitializationFailedException: OFException {} 00226 @end 00227 00231 @interface OFOpenFileFailedException: OFException 00232 { 00233 OFString *path; 00234 OFString *mode; 00235 int err; 00236 } 00237 00244 + newWithClass: (Class)class_ 00245 path: (OFString*)path 00246 mode: (OFString*)mode; 00247 00256 - initWithClass: (Class)class_ 00257 path: (OFString*)path 00258 mode: (OFString*)mode; 00259 00263 - (int)errNo; 00264 00268 - (OFString*)path; 00269 00273 - (OFString*)mode; 00274 @end 00275 00279 @interface OFReadOrWriteFailedException: OFException 00280 { 00281 size_t req_size; 00282 int err; 00283 } 00284 00290 + newWithClass: (Class)class_ 00291 size: (size_t)size; 00292 00300 - initWithClass: (Class)class_ 00301 size: (size_t)size; 00302 00306 - (int)errNo; 00307 00311 - (size_t)requestedSize; 00312 @end 00313 00317 @interface OFReadFailedException: OFReadOrWriteFailedException {} 00318 @end 00319 00323 @interface OFWriteFailedException: OFReadOrWriteFailedException {} 00324 @end 00325 00329 @interface OFChangeFileModeFailedException: OFException 00330 { 00331 OFString *path; 00332 mode_t mode; 00333 int err; 00334 } 00335 00342 + newWithClass: (Class)class_ 00343 path: (OFString*)path 00344 mode: (mode_t)mode; 00345 00354 - initWithClass: (Class)class_ 00355 path: (OFString*)path 00356 mode: (mode_t)mode; 00357 00361 - (int)errNo; 00362 00366 - (OFString*)path; 00367 00371 - (mode_t)mode; 00372 @end 00373 00377 @interface OFChangeFileOwnerFailedException: OFException 00378 { 00379 OFString *path; 00380 uid_t owner; 00381 gid_t group; 00382 int err; 00383 } 00384 00392 + newWithClass: (Class)class_ 00393 path: (OFString*)path 00394 owner: (uid_t)owner 00395 group: (gid_t)group; 00396 00406 - initWithClass: (Class)class_ 00407 path: (OFString*)path 00408 owner: (uid_t)owner 00409 group: (gid_t)group; 00410 00414 - (int)errNo; 00415 00419 - (OFString*)path; 00420 00424 - (uid_t)owner; 00425 00429 - (gid_t)group; 00430 @end 00431 00435 @interface OFRenameFileFailedException: OFException 00436 { 00437 OFString *from; 00438 OFString *to; 00439 int err; 00440 } 00441 00448 + newWithClass: (Class)class_ 00449 from: (OFString*)from 00450 to: (OFString*)to; 00451 00460 - initWithClass: (Class)class_ 00461 from: (OFString*)from 00462 to: (OFString*)to; 00463 00467 - (int)errNo; 00468 00472 - (OFString*)from; 00473 00477 - (OFString*)to; 00478 @end 00479 00483 @interface OFDeleteFileFailedException: OFException 00484 { 00485 OFString *path; 00486 int err; 00487 } 00488 00494 + newWithClass: (Class)class_ 00495 path: (OFString*)path; 00496 00504 - initWithClass: (Class)class_ 00505 path: (OFString*)path; 00506 00510 - (int)errNo; 00511 00515 - (OFString*)path; 00516 @end 00517 00521 @interface OFLinkFailedException: OFException 00522 { 00523 OFString *src; 00524 OFString *dest; 00525 int err; 00526 } 00527 00534 + newWithClass: (Class)class_ 00535 source: (OFString*)src 00536 destination: (OFString*)dest; 00537 00546 - initWithClass: (Class)class_ 00547 source: (OFString*)src 00548 destination: (OFString*)dest; 00549 00553 - (int)errNo; 00554 00558 - (OFString*)source; 00559 00563 - (OFString*)destination; 00564 @end 00565 00569 @interface OFSymlinkFailedException: OFException 00570 { 00571 OFString *src; 00572 OFString *dest; 00573 int err; 00574 } 00575 00582 + newWithClass: (Class)class_ 00583 source: (OFString*)src 00584 destination: (OFString*)dest; 00585 00594 - initWithClass: (Class)class_ 00595 source: (OFString*)src 00596 destination: (OFString*)dest; 00597 00601 - (int)errNo; 00602 00606 - (OFString*)source; 00607 00611 - (OFString*)destination; 00612 @end 00613 00617 @interface OFSetOptionFailedException: OFException {} 00618 @end 00619 00623 @interface OFNotConnectedException: OFException {} 00624 @end 00625 00630 @interface OFAlreadyConnectedException: OFException {} 00631 @end 00632 00636 @interface OFAddressTranslationFailedException: OFException 00637 { 00638 OFString *node; 00639 OFString *service; 00640 int err; 00641 } 00642 00649 + newWithClass: (Class)class_ 00650 node: (OFString*)node 00651 service: (OFString*)service; 00652 00661 - initWithClass: (Class)class_ 00662 node: (OFString*)node 00663 service: (OFString*)service; 00664 00668 - (int)errNo; 00669 00673 - (OFString*)node; 00674 00678 - (OFString*)service; 00679 @end 00680 00684 @interface OFConnectionFailedException: OFException 00685 { 00686 OFString *node; 00687 OFString *service; 00688 int err; 00689 } 00690 00697 + newWithClass: (Class)class_ 00698 node: (OFString*)node 00699 service: (OFString*)service; 00700 00709 - initWithClass: (Class)class_ 00710 node: (OFString*)node 00711 service: (OFString*)service; 00712 00716 - (int)errNo; 00717 00721 - (OFString*)node; 00722 00726 - (OFString*)service; 00727 @end 00728 00732 @interface OFBindFailedException: OFException 00733 { 00734 OFString *node; 00735 OFString *service; 00736 int family; 00737 int err; 00738 } 00739 00747 + newWithClass: (Class)class_ 00748 node: (OFString*)node 00749 service: (OFString*)service 00750 family: (int)family; 00751 00761 - initWithClass: (Class)class_ 00762 node: (OFString*)node 00763 service: (OFString*)service 00764 family: (int)family; 00765 00769 - (int)errNo; 00770 00774 - (OFString*)node; 00775 00779 - (OFString*)service; 00780 00784 - (int)family; 00785 @end 00786 00790 @interface OFListenFailedException: OFException 00791 { 00792 int backlog; 00793 int err; 00794 } 00795 00801 + newWithClass: (Class)class_ 00802 backLog: (int)backlog; 00803 00811 - initWithClass: (Class)class_ 00812 backLog: (int)backlog; 00813 00817 - (int)errNo; 00818 00822 - (int)backLog; 00823 @end 00824 00828 @interface OFAcceptFailedException: OFException 00829 { 00830 int err; 00831 } 00832 00836 - (int)errNo; 00837 @end 00838 00842 @interface OFThreadJoinFailedException: OFException {} 00843 @end 00844 00848 @interface OFMutexLockFailedException: OFException {} 00849 @end 00850 00854 @interface OFMutexUnlockFailedException: OFException {} 00855 @end 00856 00860 @interface OFHashAlreadyCalculatedException: OFException {} 00861 @end