00001 /* 00002 * Copyright (c) 2008 - 2010 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 00052 @interface OFException: OFObject 00053 { 00054 Class class_; 00055 OFString *string; 00056 } 00057 00064 + newWithClass: (Class)class_; 00065 00072 - initWithClass: (Class)class_; 00073 00077 - (Class)inClass; 00078 00082 - (OFString*)string; 00083 @end 00084 00088 @interface OFOutOfMemoryException: OFException 00089 { 00090 size_t req_size; 00091 } 00092 00098 + newWithClass: (Class)class_ 00099 size: (size_t)size; 00100 00108 - initWithClass: (Class)class_ 00109 size: (size_t)size; 00110 00114 - (size_t)requestedSize; 00115 @end 00116 00121 @interface OFEnumerationMutationException: OFException {} 00122 @end 00123 00127 @interface OFMemoryNotPartOfObjectException: OFException 00128 { 00129 void *pointer; 00130 } 00131 00137 + newWithClass: (Class)class_ 00138 pointer: (void*)ptr; 00139 00147 - initWithClass: (Class)class_ 00148 pointer: (void*)ptr; 00149 00153 - (void*)pointer; 00154 @end 00155 00160 @interface OFNotImplementedException: OFException 00161 { 00162 SEL selector; 00163 } 00164 00170 + newWithClass: (Class)class_ 00171 selector: (SEL)selector; 00172 00180 - initWithClass: (Class)class_ 00181 selector: (SEL)selector; 00182 @end 00183 00187 @interface OFOutOfRangeException: OFException {} 00188 @end 00189 00193 @interface OFInvalidArgumentException: OFException 00194 { 00195 SEL selector; 00196 } 00197 00203 + newWithClass: (Class)class_ 00204 selector: (SEL)selector; 00205 00213 - initWithClass: (Class)class_ 00214 selector: (SEL)selector; 00215 @end 00216 00220 @interface OFInvalidEncodingException: OFException {} 00221 @end 00222 00226 @interface OFInvalidFormatException: OFException {} 00227 @end 00228 00233 @interface OFMalformedXMLException: OFException {} 00234 @end 00235 00239 @interface OFInitializationFailedException: OFException {} 00240 @end 00241 00245 @interface OFOpenFileFailedException: OFException 00246 { 00247 OFString *path; 00248 OFString *mode; 00249 int err; 00250 } 00251 00258 + newWithClass: (Class)class_ 00259 path: (OFString*)path 00260 mode: (OFString*)mode; 00261 00270 - initWithClass: (Class)class_ 00271 path: (OFString*)path 00272 mode: (OFString*)mode; 00273 00277 - (int)errNo; 00278 00282 - (OFString*)path; 00283 00287 - (OFString*)mode; 00288 @end 00289 00293 @interface OFReadOrWriteFailedException: OFException 00294 { 00295 size_t req_size; 00296 int err; 00297 } 00298 00304 + newWithClass: (Class)class_ 00305 size: (size_t)size; 00306 00314 - initWithClass: (Class)class_ 00315 size: (size_t)size; 00316 00320 - (int)errNo; 00321 00325 - (size_t)requestedSize; 00326 @end 00327 00331 @interface OFReadFailedException: OFReadOrWriteFailedException {} 00332 @end 00333 00337 @interface OFWriteFailedException: OFReadOrWriteFailedException {} 00338 @end 00339 00343 @interface OFChangeFileModeFailedException: OFException 00344 { 00345 OFString *path; 00346 mode_t mode; 00347 int err; 00348 } 00349 00356 + newWithClass: (Class)class_ 00357 path: (OFString*)path 00358 mode: (mode_t)mode; 00359 00368 - initWithClass: (Class)class_ 00369 path: (OFString*)path 00370 mode: (mode_t)mode; 00371 00375 - (int)errNo; 00376 00380 - (OFString*)path; 00381 00385 - (mode_t)mode; 00386 @end 00387 00388 #ifndef _WIN32 00389 00392 @interface OFChangeFileOwnerFailedException: OFException 00393 { 00394 OFString *path; 00395 uid_t owner; 00396 gid_t group; 00397 int err; 00398 } 00399 00407 + newWithClass: (Class)class_ 00408 path: (OFString*)path 00409 owner: (uid_t)owner 00410 group: (gid_t)group; 00411 00421 - initWithClass: (Class)class_ 00422 path: (OFString*)path 00423 owner: (uid_t)owner 00424 group: (gid_t)group; 00425 00429 - (int)errNo; 00430 00434 - (OFString*)path; 00435 00439 - (uid_t)owner; 00440 00444 - (gid_t)group; 00445 @end 00446 #endif 00447 00451 @interface OFRenameFileFailedException: OFException 00452 { 00453 OFString *from; 00454 OFString *to; 00455 int err; 00456 } 00457 00464 + newWithClass: (Class)class_ 00465 from: (OFString*)from 00466 to: (OFString*)to; 00467 00476 - initWithClass: (Class)class_ 00477 from: (OFString*)from 00478 to: (OFString*)to; 00479 00483 - (int)errNo; 00484 00488 - (OFString*)from; 00489 00493 - (OFString*)to; 00494 @end 00495 00499 @interface OFDeleteFileFailedException: OFException 00500 { 00501 OFString *path; 00502 int err; 00503 } 00504 00510 + newWithClass: (Class)class_ 00511 path: (OFString*)path; 00512 00520 - initWithClass: (Class)class_ 00521 path: (OFString*)path; 00522 00526 - (int)errNo; 00527 00531 - (OFString*)path; 00532 @end 00533 00534 #ifndef _WIN32 00535 00538 @interface OFLinkFailedException: OFException 00539 { 00540 OFString *src; 00541 OFString *dest; 00542 int err; 00543 } 00544 00551 + newWithClass: (Class)class_ 00552 source: (OFString*)src 00553 destination: (OFString*)dest; 00554 00563 - initWithClass: (Class)class_ 00564 source: (OFString*)src 00565 destination: (OFString*)dest; 00566 00570 - (int)errNo; 00571 00575 - (OFString*)source; 00576 00580 - (OFString*)destination; 00581 @end 00582 00586 @interface OFSymlinkFailedException: OFException 00587 { 00588 OFString *src; 00589 OFString *dest; 00590 int err; 00591 } 00592 00599 + newWithClass: (Class)class_ 00600 source: (OFString*)src 00601 destination: (OFString*)dest; 00602 00611 - initWithClass: (Class)class_ 00612 source: (OFString*)src 00613 destination: (OFString*)dest; 00614 00618 - (int)errNo; 00619 00623 - (OFString*)source; 00624 00628 - (OFString*)destination; 00629 @end 00630 #endif 00631 00635 @interface OFSetOptionFailedException: OFException {} 00636 @end 00637 00641 @interface OFNotConnectedException: OFException {} 00642 @end 00643 00648 @interface OFAlreadyConnectedException: OFException {} 00649 @end 00650 00654 @interface OFAddressTranslationFailedException: OFException 00655 { 00656 OFString *node; 00657 OFString *service; 00658 int err; 00659 } 00660 00667 + newWithClass: (Class)class_ 00668 node: (OFString*)node 00669 service: (OFString*)service; 00670 00679 - initWithClass: (Class)class_ 00680 node: (OFString*)node 00681 service: (OFString*)service; 00682 00686 - (int)errNo; 00687 00691 - (OFString*)node; 00692 00696 - (OFString*)service; 00697 @end 00698 00702 @interface OFConnectionFailedException: OFException 00703 { 00704 OFString *node; 00705 OFString *service; 00706 int err; 00707 } 00708 00715 + newWithClass: (Class)class_ 00716 node: (OFString*)node 00717 service: (OFString*)service; 00718 00727 - initWithClass: (Class)class_ 00728 node: (OFString*)node 00729 service: (OFString*)service; 00730 00734 - (int)errNo; 00735 00739 - (OFString*)node; 00740 00744 - (OFString*)service; 00745 @end 00746 00750 @interface OFBindFailedException: OFException 00751 { 00752 OFString *node; 00753 OFString *service; 00754 int family; 00755 int err; 00756 } 00757 00765 + newWithClass: (Class)class_ 00766 node: (OFString*)node 00767 service: (OFString*)service 00768 family: (int)family; 00769 00779 - initWithClass: (Class)class_ 00780 node: (OFString*)node 00781 service: (OFString*)service 00782 family: (int)family; 00783 00787 - (int)errNo; 00788 00792 - (OFString*)node; 00793 00797 - (OFString*)service; 00798 00802 - (int)family; 00803 @end 00804 00808 @interface OFListenFailedException: OFException 00809 { 00810 int backlog; 00811 int err; 00812 } 00813 00819 + newWithClass: (Class)class_ 00820 backLog: (int)backlog; 00821 00829 - initWithClass: (Class)class_ 00830 backLog: (int)backlog; 00831 00835 - (int)errNo; 00836 00840 - (int)backLog; 00841 @end 00842 00846 @interface OFAcceptFailedException: OFException 00847 { 00848 int err; 00849 } 00850 00854 - (int)errNo; 00855 @end 00856 00860 @interface OFThreadJoinFailedException: OFException {} 00861 @end 00862 00866 @interface OFMutexLockFailedException: OFException {} 00867 @end 00868 00872 @interface OFMutexUnlockFailedException: OFException {} 00873 @end 00874 00878 @interface OFHashAlreadyCalculatedException: OFException {} 00879 @end