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 #include <sys/stat.h> 00013 00014 #import "OFObject.h" 00015 00016 @class OFString; 00017 00030 @interface OFAllocFailedException 00031 { 00032 Class isa; 00033 } 00034 00035 + (Class)class; 00036 00040 - (OFString*)string; 00041 @end 00042 00049 @interface OFException: OFObject 00050 { 00051 Class class_; 00052 OFString *string; 00053 } 00054 00061 + newWithClass: (Class)class_; 00062 00069 - initWithClass: (Class)class_; 00070 00074 - (Class)inClass; 00075 00079 - (OFString*)string; 00080 @end 00081 00085 @interface OFOutOfMemoryException: OFException 00086 { 00087 size_t req_size; 00088 } 00089 00095 + newWithClass: (Class)class_ 00096 size: (size_t)size; 00097 00105 - initWithClass: (Class)class_ 00106 size: (size_t)size; 00107 00111 - (size_t)requestedSize; 00112 @end 00113 00117 @interface OFEnumerationMutationException: OFException {} 00118 @end 00119 00123 @interface OFMemoryNotPartOfObjectException: OFException 00124 { 00125 void *pointer; 00126 } 00127 00133 + newWithClass: (Class)class_ 00134 pointer: (void*)ptr; 00135 00143 - initWithClass: (Class)class_ 00144 pointer: (void*)ptr; 00145 00149 - (void*)pointer; 00150 @end 00151 00155 @interface OFNotImplementedException: OFException 00156 { 00157 SEL selector; 00158 } 00159 00165 + newWithClass: (Class)class_ 00166 selector: (SEL)selector; 00167 00175 - initWithClass: (Class)class_ 00176 selector: (SEL)selector; 00177 @end 00178 00182 @interface OFOutOfRangeException: OFException {} 00183 @end 00184 00188 @interface OFInvalidArgumentException: OFException 00189 { 00190 SEL selector; 00191 } 00192 00198 + newWithClass: (Class)class_ 00199 selector: (SEL)selector; 00200 00208 - initWithClass: (Class)class_ 00209 selector: (SEL)selector; 00210 @end 00211 00215 @interface OFInvalidEncodingException: OFException {} 00216 @end 00217 00221 @interface OFInvalidFormatException: OFException {} 00222 @end 00223 00227 @interface OFMalformedXMLException: OFException {} 00228 @end 00229 00233 @interface OFInitializationFailedException: OFException {} 00234 @end 00235 00239 @interface OFOpenFileFailedException: OFException 00240 { 00241 OFString *path; 00242 OFString *mode; 00243 int err; 00244 } 00245 00252 + newWithClass: (Class)class_ 00253 path: (OFString*)path 00254 mode: (OFString*)mode; 00255 00264 - initWithClass: (Class)class_ 00265 path: (OFString*)path 00266 mode: (OFString*)mode; 00267 00271 - (int)errNo; 00272 00276 - (OFString*)path; 00277 00281 - (OFString*)mode; 00282 @end 00283 00287 @interface OFReadOrWriteFailedException: OFException 00288 { 00289 size_t req_size; 00290 int err; 00291 } 00292 00298 + newWithClass: (Class)class_ 00299 size: (size_t)size; 00300 00308 - initWithClass: (Class)class_ 00309 size: (size_t)size; 00310 00314 - (int)errNo; 00315 00319 - (size_t)requestedSize; 00320 @end 00321 00325 @interface OFReadFailedException: OFReadOrWriteFailedException {} 00326 @end 00327 00331 @interface OFWriteFailedException: OFReadOrWriteFailedException {} 00332 @end 00333 00337 @interface OFChangeFileModeFailedException: OFException 00338 { 00339 OFString *path; 00340 mode_t mode; 00341 int err; 00342 } 00343 00350 + newWithClass: (Class)class_ 00351 path: (OFString*)path 00352 mode: (mode_t)mode; 00353 00362 - initWithClass: (Class)class_ 00363 path: (OFString*)path 00364 mode: (mode_t)mode; 00365 00369 - (int)errNo; 00370 00374 - (OFString*)path; 00375 00379 - (mode_t)mode; 00380 @end 00381 00382 #ifndef _WIN32 00383 00386 @interface OFChangeFileOwnerFailedException: OFException 00387 { 00388 OFString *path; 00389 uid_t owner; 00390 gid_t group; 00391 int err; 00392 } 00393 00401 + newWithClass: (Class)class_ 00402 path: (OFString*)path 00403 owner: (uid_t)owner 00404 group: (gid_t)group; 00405 00415 - initWithClass: (Class)class_ 00416 path: (OFString*)path 00417 owner: (uid_t)owner 00418 group: (gid_t)group; 00419 00423 - (int)errNo; 00424 00428 - (OFString*)path; 00429 00433 - (uid_t)owner; 00434 00438 - (gid_t)group; 00439 @end 00440 #endif 00441 00445 @interface OFRenameFileFailedException: OFException 00446 { 00447 OFString *from; 00448 OFString *to; 00449 int err; 00450 } 00451 00458 + newWithClass: (Class)class_ 00459 from: (OFString*)from 00460 to: (OFString*)to; 00461 00470 - initWithClass: (Class)class_ 00471 from: (OFString*)from 00472 to: (OFString*)to; 00473 00477 - (int)errNo; 00478 00482 - (OFString*)from; 00483 00487 - (OFString*)to; 00488 @end 00489 00493 @interface OFDeleteFileFailedException: OFException 00494 { 00495 OFString *path; 00496 int err; 00497 } 00498 00504 + newWithClass: (Class)class_ 00505 path: (OFString*)path; 00506 00514 - initWithClass: (Class)class_ 00515 path: (OFString*)path; 00516 00520 - (int)errNo; 00521 00525 - (OFString*)path; 00526 @end 00527 00528 #ifndef _WIN32 00529 00532 @interface OFLinkFailedException: OFException 00533 { 00534 OFString *src; 00535 OFString *dest; 00536 int err; 00537 } 00538 00545 + newWithClass: (Class)class_ 00546 source: (OFString*)src 00547 destination: (OFString*)dest; 00548 00557 - initWithClass: (Class)class_ 00558 source: (OFString*)src 00559 destination: (OFString*)dest; 00560 00564 - (int)errNo; 00565 00569 - (OFString*)source; 00570 00574 - (OFString*)destination; 00575 @end 00576 00580 @interface OFSymlinkFailedException: OFException 00581 { 00582 OFString *src; 00583 OFString *dest; 00584 int err; 00585 } 00586 00593 + newWithClass: (Class)class_ 00594 source: (OFString*)src 00595 destination: (OFString*)dest; 00596 00605 - initWithClass: (Class)class_ 00606 source: (OFString*)src 00607 destination: (OFString*)dest; 00608 00612 - (int)errNo; 00613 00617 - (OFString*)source; 00618 00622 - (OFString*)destination; 00623 @end 00624 #endif 00625 00629 @interface OFSetOptionFailedException: OFException {} 00630 @end 00631 00635 @interface OFNotConnectedException: OFException {} 00636 @end 00637 00642 @interface OFAlreadyConnectedException: OFException {} 00643 @end 00644 00648 @interface OFAddressTranslationFailedException: OFException 00649 { 00650 OFString *node; 00651 OFString *service; 00652 int err; 00653 } 00654 00661 + newWithClass: (Class)class_ 00662 node: (OFString*)node 00663 service: (OFString*)service; 00664 00673 - initWithClass: (Class)class_ 00674 node: (OFString*)node 00675 service: (OFString*)service; 00676 00680 - (int)errNo; 00681 00685 - (OFString*)node; 00686 00690 - (OFString*)service; 00691 @end 00692 00696 @interface OFConnectionFailedException: OFException 00697 { 00698 OFString *node; 00699 OFString *service; 00700 int err; 00701 } 00702 00709 + newWithClass: (Class)class_ 00710 node: (OFString*)node 00711 service: (OFString*)service; 00712 00721 - initWithClass: (Class)class_ 00722 node: (OFString*)node 00723 service: (OFString*)service; 00724 00728 - (int)errNo; 00729 00733 - (OFString*)node; 00734 00738 - (OFString*)service; 00739 @end 00740 00744 @interface OFBindFailedException: OFException 00745 { 00746 OFString *node; 00747 OFString *service; 00748 int family; 00749 int err; 00750 } 00751 00759 + newWithClass: (Class)class_ 00760 node: (OFString*)node 00761 service: (OFString*)service 00762 family: (int)family; 00763 00773 - initWithClass: (Class)class_ 00774 node: (OFString*)node 00775 service: (OFString*)service 00776 family: (int)family; 00777 00781 - (int)errNo; 00782 00786 - (OFString*)node; 00787 00791 - (OFString*)service; 00792 00796 - (int)family; 00797 @end 00798 00802 @interface OFListenFailedException: OFException 00803 { 00804 int backlog; 00805 int err; 00806 } 00807 00813 + newWithClass: (Class)class_ 00814 backLog: (int)backlog; 00815 00823 - initWithClass: (Class)class_ 00824 backLog: (int)backlog; 00825 00829 - (int)errNo; 00830 00834 - (int)backLog; 00835 @end 00836 00840 @interface OFAcceptFailedException: OFException 00841 { 00842 int err; 00843 } 00844 00848 - (int)errNo; 00849 @end 00850 00854 @interface OFThreadJoinFailedException: OFException {} 00855 @end 00856 00860 @interface OFMutexLockFailedException: OFException {} 00861 @end 00862 00866 @interface OFMutexUnlockFailedException: OFException {} 00867 @end 00868 00872 @interface OFHashAlreadyCalculatedException: OFException {} 00873 @end