Index: ObjFW.xcodeproj/project.pbxproj ================================================================== --- ObjFW.xcodeproj/project.pbxproj +++ ObjFW.xcodeproj/project.pbxproj @@ -31,13 +31,73 @@ productName = configure; }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 4B17FF73133A2A76003E6DCD /* OFException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FF71133A28FC003E6DCD /* OFException.m */; }; + 4B17FF74133A2AAB003E6DCD /* OFException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FF70133A28FC003E6DCD /* OFException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FF77133A2B18003E6DCD /* OFNotImplementedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FF75133A2B18003E6DCD /* OFNotImplementedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FF78133A2B18003E6DCD /* OFNotImplementedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FF76133A2B18003E6DCD /* OFNotImplementedException.m */; }; + 4B17FF7B133A2C15003E6DCD /* OFOutOfRangeException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FF79133A2C14003E6DCD /* OFOutOfRangeException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FF7C133A2C15003E6DCD /* OFOutOfRangeException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FF7A133A2C15003E6DCD /* OFOutOfRangeException.m */; }; + 4B17FF7F133A2D17003E6DCD /* OFAllocFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FF7D133A2D16003E6DCD /* OFAllocFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FF80133A2D17003E6DCD /* OFAllocFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FF7E133A2D17003E6DCD /* OFAllocFailedException.m */; }; + 4B17FF83133A2DFB003E6DCD /* OFOutOfMemoryException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FF81133A2DFB003E6DCD /* OFOutOfMemoryException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FF84133A2DFB003E6DCD /* OFOutOfMemoryException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FF82133A2DFB003E6DCD /* OFOutOfMemoryException.m */; }; + 4B17FF87133A2E7B003E6DCD /* OFEnumerationMutationException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FF85133A2E7A003E6DCD /* OFEnumerationMutationException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FF88133A2E7B003E6DCD /* OFEnumerationMutationException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FF86133A2E7A003E6DCD /* OFEnumerationMutationException.m */; }; + 4B17FF8F133A3036003E6DCD /* OFMemoryNotPartOfObjectException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FF8D133A3034003E6DCD /* OFMemoryNotPartOfObjectException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FF90133A3036003E6DCD /* OFMemoryNotPartOfObjectException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FF8E133A3034003E6DCD /* OFMemoryNotPartOfObjectException.m */; }; + 4B17FF93133A317C003E6DCD /* OFInvalidArgumentException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FF91133A317A003E6DCD /* OFInvalidArgumentException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FF94133A317C003E6DCD /* OFInvalidArgumentException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FF92133A317B003E6DCD /* OFInvalidArgumentException.m */; }; + 4B17FF99133A3245003E6DCD /* OFInvalidEncodingException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FF97133A3242003E6DCD /* OFInvalidEncodingException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FF9A133A3245003E6DCD /* OFInvalidEncodingException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FF98133A3243003E6DCD /* OFInvalidEncodingException.m */; }; + 4B17FF9D133A32BA003E6DCD /* OFInvalidFormatException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FF9B133A32B7003E6DCD /* OFInvalidFormatException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FF9E133A32BA003E6DCD /* OFInvalidFormatException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FF9C133A32B8003E6DCD /* OFInvalidFormatException.m */; }; + 4B17FFA1133A3335003E6DCD /* OFMalformedXMLException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FF9F133A3331003E6DCD /* OFMalformedXMLException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FFA2133A3335003E6DCD /* OFMalformedXMLException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FFA0133A3332003E6DCD /* OFMalformedXMLException.m */; }; + 4B17FFA5133A3411003E6DCD /* OFInitializationFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FFA3133A340B003E6DCD /* OFInitializationFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FFA6133A3411003E6DCD /* OFInitializationFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FFA4133A340D003E6DCD /* OFInitializationFailedException.m */; }; + 4B17FFA9133A34E7003E6DCD /* OFTruncatedDataException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FFA7133A34DF003E6DCD /* OFTruncatedDataException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FFAA133A34E7003E6DCD /* OFTruncatedDataException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FFA8133A34E1003E6DCD /* OFTruncatedDataException.m */; }; + 4B17FFAD133A3591003E6DCD /* OFHTTPRequestFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FFAB133A3586003E6DCD /* OFHTTPRequestFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FFAE133A3591003E6DCD /* OFHTTPRequestFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FFAC133A3589003E6DCD /* OFHTTPRequestFailedException.m */; }; + 4B17FFB1133A3664003E6DCD /* OFUnsupportedProtocolException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FFAF133A3658003E6DCD /* OFUnsupportedProtocolException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FFB2133A3664003E6DCD /* OFUnsupportedProtocolException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FFB0133A365C003E6DCD /* OFUnsupportedProtocolException.m */; }; + 4B17FFB5133A375B003E6DCD /* OFUnboundNamespaceException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FFB3133A374C003E6DCD /* OFUnboundNamespaceException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FFB6133A375B003E6DCD /* OFUnboundNamespaceException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FFB4133A3750003E6DCD /* OFUnboundNamespaceException.m */; }; + 4B17FFB9133A381D003E6DCD /* OFInvalidServerReplyException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B17FFB7133A380F003E6DCD /* OFInvalidServerReplyException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B17FFBA133A381D003E6DCD /* OFInvalidServerReplyException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B17FFB8133A3813003E6DCD /* OFInvalidServerReplyException.m */; }; 4B23CA92133811DC0047A1D9 /* TestPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B6EF684123535B60076B512 /* TestPlugin.m */; }; 4B23CA93133811E20047A1D9 /* ObjFW.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B3D23761337FBC800DD29B8 /* ObjFW.framework */; }; 4B23CA941338121C0047A1D9 /* TestPlugin.impl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4B23CA8A133811610047A1D9 /* TestPlugin.impl */; }; + 4B29BC3B133AC4E80004B236 /* OFChangeDirectoryFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC33133AC4E80004B236 /* OFChangeDirectoryFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC3C133AC4E80004B236 /* OFChangeDirectoryFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC34133AC4E80004B236 /* OFChangeDirectoryFailedException.m */; }; + 4B29BC3D133AC4E80004B236 /* OFChangeFileModeFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC35133AC4E80004B236 /* OFChangeFileModeFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC3E133AC4E80004B236 /* OFChangeFileModeFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC36133AC4E80004B236 /* OFChangeFileModeFailedException.m */; }; + 4B29BC3F133AC4E80004B236 /* OFCreateDirectoryFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC37133AC4E80004B236 /* OFCreateDirectoryFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC40133AC4E80004B236 /* OFCreateDirectoryFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC38133AC4E80004B236 /* OFCreateDirectoryFailedException.m */; }; + 4B29BC41133AC4E80004B236 /* OFSeekFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC39133AC4E80004B236 /* OFSeekFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC42133AC4E80004B236 /* OFSeekFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC3A133AC4E80004B236 /* OFSeekFailedException.m */; }; + 4B29BC4C133AC7DD0004B236 /* OFChangeFileOwnerFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC44133AC7DB0004B236 /* OFChangeFileOwnerFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC4D133AC7DD0004B236 /* OFChangeFileOwnerFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC45133AC7DB0004B236 /* OFChangeFileOwnerFailedException.m */; }; + 4B29BC4E133AC7DD0004B236 /* OFCopyFileFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC46133AC7DB0004B236 /* OFCopyFileFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC4F133AC7DD0004B236 /* OFCopyFileFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC47133AC7DB0004B236 /* OFCopyFileFailedException.m */; }; + 4B29BC50133AC7DD0004B236 /* OFDeleteDirectoryFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC48133AC7DB0004B236 /* OFDeleteDirectoryFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC51133AC7DD0004B236 /* OFDeleteDirectoryFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC49133AC7DC0004B236 /* OFDeleteDirectoryFailedException.m */; }; + 4B29BC52133AC7DD0004B236 /* OFDeleteFileFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC4A133AC7DC0004B236 /* OFDeleteFileFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC53133AC7DD0004B236 /* OFDeleteFileFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC4B133AC7DC0004B236 /* OFDeleteFileFailedException.m */; }; + 4B29BC57133AC8420004B236 /* OFRenameFileFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC55133AC81B0004B236 /* OFRenameFileFailedException.m */; }; + 4B29BC58133AC8540004B236 /* OFConditionBroadcastFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B1701133A3B8E007CD8B3 /* OFConditionBroadcastFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC59133AC8540004B236 /* OFConditionSignalFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B1703133A3B8E007CD8B3 /* OFConditionSignalFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC5A133AC8540004B236 /* OFConditionWaitFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B1705133A3B8E007CD8B3 /* OFConditionWaitFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC5B133AC8540004B236 /* OFConditionWaitingException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B1707133A3B8E007CD8B3 /* OFConditionWaitingException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC5C133AC8540004B236 /* OFRenameFileFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC54133AC81B0004B236 /* OFRenameFileFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC61133AC9CB0004B236 /* OFLinkFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC5D133AC9C40004B236 /* OFLinkFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC62133AC9CB0004B236 /* OFLinkFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC5E133AC9C40004B236 /* OFLinkFailedException.m */; }; + 4B29BC63133AC9CB0004B236 /* OFSymlinkFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC5F133AC9C60004B236 /* OFSymlinkFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B29BC64133AC9CB0004B236 /* OFSymlinkFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC60133AC9C90004B236 /* OFSymlinkFailedException.m */; }; 4B3D238B1337FC0D00DD29B8 /* OFApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B175C1E116D130B003C99CB /* OFApplication.m */; }; 4B3D238C1337FC0D00DD29B8 /* OFArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B67995B1099E7C50041064A /* OFArray.m */; }; 4B3D238D1337FC0D00DD29B8 /* OFAutoreleasePool.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B67995D1099E7C50041064A /* OFAutoreleasePool.m */; }; 4B3D238E1337FC0D00DD29B8 /* OFBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD86D811237A6C600ED9912 /* OFBlock.m */; }; 4B3D238F1337FC0D00DD29B8 /* OFConstantString.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BE5F0D812DF4225005C7A0C /* OFConstantString.m */; }; @@ -44,11 +104,10 @@ 4B3D23901337FC0D00DD29B8 /* OFDataArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B6799611099E7C50041064A /* OFDataArray.m */; }; 4B3D23911337FC0D00DD29B8 /* OFDataArray+Hashing.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BE17ADA12FD746D002CEB0B /* OFDataArray+Hashing.m */; }; 4B3D23921337FC0D00DD29B8 /* OFDate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BE5F0DA12DF4225005C7A0C /* OFDate.m */; }; 4B3D23931337FC0D00DD29B8 /* OFDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B6799631099E7C50041064A /* OFDictionary.m */; }; 4B3D23941337FC0D00DD29B8 /* OFEnumerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B0108CA10EB8C9300631877 /* OFEnumerator.m */; }; - 4B3D23951337FC0D00DD29B8 /* OFExceptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B6799651099E7C50041064A /* OFExceptions.m */; }; 4B3D23961337FC0D00DD29B8 /* OFFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B6799671099E7C50041064A /* OFFile.m */; }; 4B3D23971337FC0D00DD29B8 /* OFHash.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BF1BCC111C9663F0025511F /* OFHash.m */; }; 4B3D23981337FC0D00DD29B8 /* OFHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B99251012E0780000215DBE /* OFHTTPRequest.m */; }; 4B3D23991337FC0D00DD29B8 /* OFList.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B67996D1099E7C50041064A /* OFList.m */; }; 4B3D239A1337FC0D00DD29B8 /* OFMD5Hash.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BF1BCC311C9663F0025511F /* OFMD5Hash.m */; }; @@ -127,10 +186,53 @@ 4B3D23E81337FCB000DD29B8 /* macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BBA36C511406AB700CBA3AC /* macros.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B3D23E91337FCB000DD29B8 /* of_asprintf.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BB50DCF12F863C700C9393F /* of_asprintf.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B3D23EA1337FCB000DD29B8 /* threading.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B67998B1099E7C50041064A /* threading.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B3D23EB1337FCB000DD29B8 /* unicode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B67998C1099E7C50041064A /* unicode.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B3D23EE1337FFD000DD29B8 /* of_asprintf.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB50DD012F863C700C9393F /* of_asprintf.m */; }; + 4B55A0FF133ABEA900B58A93 /* OFThreadJoinFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A0F9133ABEA900B58A93 /* OFThreadJoinFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B55A100133ABEA900B58A93 /* OFThreadJoinFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A0FA133ABEA900B58A93 /* OFThreadJoinFailedException.m */; }; + 4B55A101133ABEA900B58A93 /* OFThreadStartFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A0FB133ABEA900B58A93 /* OFThreadStartFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B55A102133ABEA900B58A93 /* OFThreadStartFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A0FC133ABEA900B58A93 /* OFThreadStartFailedException.m */; }; + 4B55A103133ABEA900B58A93 /* OFThreadStillRunningException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A0FD133ABEA900B58A93 /* OFThreadStillRunningException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B55A104133ABEA900B58A93 /* OFThreadStillRunningException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A0FE133ABEA900B58A93 /* OFThreadStillRunningException.m */; }; + 4B55A109133AC05100B58A93 /* common.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A106133AC05100B58A93 /* common.h */; }; + 4B55A10A133AC05100B58A93 /* OFOpenFileFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A107133AC05100B58A93 /* OFOpenFileFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B55A10B133AC05100B58A93 /* OFOpenFileFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A108133AC05100B58A93 /* OFOpenFileFailedException.m */; }; + 4B55A112133AC24600B58A93 /* OFReadFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A10C133AC24500B58A93 /* OFReadFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B55A113133AC24600B58A93 /* OFReadFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A10D133AC24500B58A93 /* OFReadFailedException.m */; }; + 4B55A114133AC24600B58A93 /* OFReadOrWriteFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A10E133AC24500B58A93 /* OFReadOrWriteFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B55A115133AC24600B58A93 /* OFReadOrWriteFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A10F133AC24500B58A93 /* OFReadOrWriteFailedException.m */; }; + 4B55A116133AC24600B58A93 /* OFWriteFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A110133AC24500B58A93 /* OFWriteFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B55A117133AC24600B58A93 /* OFWriteFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A111133AC24600B58A93 /* OFWriteFailedException.m */; }; + 4B8B16FE133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B16FC133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B8B16FF133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B16FD133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.m */; }; + 4B8B170D133A3C11007CD8B3 /* OFConditionBroadcastFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B1702133A3B8E007CD8B3 /* OFConditionBroadcastFailedException.m */; }; + 4B8B170E133A3C11007CD8B3 /* OFConditionSignalFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B1704133A3B8E007CD8B3 /* OFConditionSignalFailedException.m */; }; + 4B8B170F133A3C11007CD8B3 /* OFConditionWaitFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B1706133A3B8E007CD8B3 /* OFConditionWaitFailedException.m */; }; + 4B8B1710133A3C11007CD8B3 /* OFConditionWaitingException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B1708133A3B8E007CD8B3 /* OFConditionWaitingException.m */; }; + 4B8B1717133A3D04007CD8B3 /* OFMutexLockedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B1711133A3D04007CD8B3 /* OFMutexLockedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B8B1718133A3D04007CD8B3 /* OFMutexLockedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B1712133A3D04007CD8B3 /* OFMutexLockedException.m */; }; + 4B8B1719133A3D04007CD8B3 /* OFMutexLockFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B1713133A3D04007CD8B3 /* OFMutexLockFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B8B171A133A3D04007CD8B3 /* OFMutexLockFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B1714133A3D04007CD8B3 /* OFMutexLockFailedException.m */; }; + 4B8B171B133A3D04007CD8B3 /* OFMutexUnlockFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B1715133A3D04007CD8B3 /* OFMutexUnlockFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B8B171C133A3D04007CD8B3 /* OFMutexUnlockFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B1716133A3D04007CD8B3 /* OFMutexUnlockFailedException.m */; }; + 4B90B78D133AD46700BD33CB /* OFAlreadyConnectedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B90B787133AD46700BD33CB /* OFAlreadyConnectedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B90B78E133AD46700BD33CB /* OFAlreadyConnectedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90B788133AD46700BD33CB /* OFAlreadyConnectedException.m */; }; + 4B90B78F133AD46700BD33CB /* OFNotConnectedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B90B789133AD46700BD33CB /* OFNotConnectedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B90B790133AD46700BD33CB /* OFNotConnectedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90B78A133AD46700BD33CB /* OFNotConnectedException.m */; }; + 4B90B791133AD46700BD33CB /* OFSetOptionFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B90B78B133AD46700BD33CB /* OFSetOptionFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B90B792133AD46700BD33CB /* OFSetOptionFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90B78C133AD46700BD33CB /* OFSetOptionFailedException.m */; }; + 4B90B79E133AD87D00BD33CB /* OFAcceptFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B90B794133AD87D00BD33CB /* OFAcceptFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B90B79F133AD87D00BD33CB /* OFAcceptFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90B795133AD87D00BD33CB /* OFAcceptFailedException.m */; }; + 4B90B7A0133AD87D00BD33CB /* OFAddressTranslationFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B90B796133AD87D00BD33CB /* OFAddressTranslationFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B90B7A1133AD87D00BD33CB /* OFAddressTranslationFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90B797133AD87D00BD33CB /* OFAddressTranslationFailedException.m */; }; + 4B90B7A2133AD87D00BD33CB /* OFBindFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B90B798133AD87D00BD33CB /* OFBindFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B90B7A3133AD87D00BD33CB /* OFBindFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90B799133AD87D00BD33CB /* OFBindFailedException.m */; }; + 4B90B7A4133AD87D00BD33CB /* OFConnectionFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B90B79A133AD87D00BD33CB /* OFConnectionFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B90B7A5133AD87D00BD33CB /* OFConnectionFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90B79B133AD87D00BD33CB /* OFConnectionFailedException.m */; }; + 4B90B7A6133AD87D00BD33CB /* OFListenFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B90B79C133AD87D00BD33CB /* OFListenFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B90B7A7133AD87D00BD33CB /* OFListenFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90B79D133AD87D00BD33CB /* OFListenFailedException.m */; }; 4BD98C03133814220048DD5B /* objfw-defs.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD98C011338140B0048DD5B /* objfw-defs.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4BDF37B51338055600F9A81A /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDF37B41338055600F9A81A /* config.h */; }; 4BF33AFB133807590059CEF7 /* ObjFW.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B3D23761337FBC800DD29B8 /* ObjFW.framework */; }; 4BF33AFC133807A20059CEF7 /* OFArrayTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B6EF66E1235358D0076B512 /* OFArrayTests.m */; }; 4BF33AFD133807A20059CEF7 /* OFBlockTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BE5F0E412DF4259005C7A0C /* OFBlockTests.m */; }; @@ -227,22 +329,94 @@ 4B0108CA10EB8C9300631877 /* OFEnumerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFEnumerator.m; path = src/OFEnumerator.m; sourceTree = ""; }; 4B0D249411DFAA3D00ED6FFC /* OFXMLElementBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFXMLElementBuilder.h; path = src/OFXMLElementBuilder.h; sourceTree = ""; }; 4B0D249511DFAA3D00ED6FFC /* OFXMLElementBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFXMLElementBuilder.m; path = src/OFXMLElementBuilder.m; sourceTree = ""; }; 4B175C1D116D130B003C99CB /* OFApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFApplication.h; path = src/OFApplication.h; sourceTree = ""; }; 4B175C1E116D130B003C99CB /* OFApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFApplication.m; path = src/OFApplication.m; sourceTree = ""; }; + 4B17FF70133A28FC003E6DCD /* OFException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFException.h; path = src/exceptions/OFException.h; sourceTree = ""; }; + 4B17FF71133A28FC003E6DCD /* OFException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFException.m; path = src/exceptions/OFException.m; sourceTree = ""; }; + 4B17FF75133A2B18003E6DCD /* OFNotImplementedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFNotImplementedException.h; path = src/exceptions/OFNotImplementedException.h; sourceTree = ""; }; + 4B17FF76133A2B18003E6DCD /* OFNotImplementedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFNotImplementedException.m; path = src/exceptions/OFNotImplementedException.m; sourceTree = ""; }; + 4B17FF79133A2C14003E6DCD /* OFOutOfRangeException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFOutOfRangeException.h; path = src/exceptions/OFOutOfRangeException.h; sourceTree = ""; }; + 4B17FF7A133A2C15003E6DCD /* OFOutOfRangeException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFOutOfRangeException.m; path = src/exceptions/OFOutOfRangeException.m; sourceTree = ""; }; + 4B17FF7D133A2D16003E6DCD /* OFAllocFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFAllocFailedException.h; path = src/exceptions/OFAllocFailedException.h; sourceTree = ""; }; + 4B17FF7E133A2D17003E6DCD /* OFAllocFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFAllocFailedException.m; path = src/exceptions/OFAllocFailedException.m; sourceTree = ""; }; + 4B17FF81133A2DFB003E6DCD /* OFOutOfMemoryException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFOutOfMemoryException.h; path = src/exceptions/OFOutOfMemoryException.h; sourceTree = ""; }; + 4B17FF82133A2DFB003E6DCD /* OFOutOfMemoryException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFOutOfMemoryException.m; path = src/exceptions/OFOutOfMemoryException.m; sourceTree = ""; }; + 4B17FF85133A2E7A003E6DCD /* OFEnumerationMutationException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFEnumerationMutationException.h; path = src/exceptions/OFEnumerationMutationException.h; sourceTree = ""; }; + 4B17FF86133A2E7A003E6DCD /* OFEnumerationMutationException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFEnumerationMutationException.m; path = src/exceptions/OFEnumerationMutationException.m; sourceTree = ""; }; + 4B17FF8D133A3034003E6DCD /* OFMemoryNotPartOfObjectException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMemoryNotPartOfObjectException.h; path = src/exceptions/OFMemoryNotPartOfObjectException.h; sourceTree = ""; }; + 4B17FF8E133A3034003E6DCD /* OFMemoryNotPartOfObjectException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMemoryNotPartOfObjectException.m; path = src/exceptions/OFMemoryNotPartOfObjectException.m; sourceTree = ""; }; + 4B17FF91133A317A003E6DCD /* OFInvalidArgumentException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFInvalidArgumentException.h; path = src/exceptions/OFInvalidArgumentException.h; sourceTree = ""; }; + 4B17FF92133A317B003E6DCD /* OFInvalidArgumentException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFInvalidArgumentException.m; path = src/exceptions/OFInvalidArgumentException.m; sourceTree = ""; }; + 4B17FF96133A3211003E6DCD /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = src/exceptions/Makefile; sourceTree = ""; }; + 4B17FF97133A3242003E6DCD /* OFInvalidEncodingException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFInvalidEncodingException.h; path = src/exceptions/OFInvalidEncodingException.h; sourceTree = ""; }; + 4B17FF98133A3243003E6DCD /* OFInvalidEncodingException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFInvalidEncodingException.m; path = src/exceptions/OFInvalidEncodingException.m; sourceTree = ""; }; + 4B17FF9B133A32B7003E6DCD /* OFInvalidFormatException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFInvalidFormatException.h; path = src/exceptions/OFInvalidFormatException.h; sourceTree = ""; }; + 4B17FF9C133A32B8003E6DCD /* OFInvalidFormatException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFInvalidFormatException.m; path = src/exceptions/OFInvalidFormatException.m; sourceTree = ""; }; + 4B17FF9F133A3331003E6DCD /* OFMalformedXMLException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMalformedXMLException.h; path = src/exceptions/OFMalformedXMLException.h; sourceTree = ""; }; + 4B17FFA0133A3332003E6DCD /* OFMalformedXMLException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMalformedXMLException.m; path = src/exceptions/OFMalformedXMLException.m; sourceTree = ""; }; + 4B17FFA3133A340B003E6DCD /* OFInitializationFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFInitializationFailedException.h; path = src/exceptions/OFInitializationFailedException.h; sourceTree = ""; }; + 4B17FFA4133A340D003E6DCD /* OFInitializationFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFInitializationFailedException.m; path = src/exceptions/OFInitializationFailedException.m; sourceTree = ""; }; + 4B17FFA7133A34DF003E6DCD /* OFTruncatedDataException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFTruncatedDataException.h; path = src/exceptions/OFTruncatedDataException.h; sourceTree = ""; }; + 4B17FFA8133A34E1003E6DCD /* OFTruncatedDataException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFTruncatedDataException.m; path = src/exceptions/OFTruncatedDataException.m; sourceTree = ""; }; + 4B17FFAB133A3586003E6DCD /* OFHTTPRequestFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFHTTPRequestFailedException.h; path = src/exceptions/OFHTTPRequestFailedException.h; sourceTree = ""; }; + 4B17FFAC133A3589003E6DCD /* OFHTTPRequestFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFHTTPRequestFailedException.m; path = src/exceptions/OFHTTPRequestFailedException.m; sourceTree = ""; }; + 4B17FFAF133A3658003E6DCD /* OFUnsupportedProtocolException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFUnsupportedProtocolException.h; path = src/exceptions/OFUnsupportedProtocolException.h; sourceTree = ""; }; + 4B17FFB0133A365C003E6DCD /* OFUnsupportedProtocolException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFUnsupportedProtocolException.m; path = src/exceptions/OFUnsupportedProtocolException.m; sourceTree = ""; }; + 4B17FFB3133A374C003E6DCD /* OFUnboundNamespaceException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFUnboundNamespaceException.h; path = src/exceptions/OFUnboundNamespaceException.h; sourceTree = ""; }; + 4B17FFB4133A3750003E6DCD /* OFUnboundNamespaceException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFUnboundNamespaceException.m; path = src/exceptions/OFUnboundNamespaceException.m; sourceTree = ""; }; + 4B17FFB7133A380F003E6DCD /* OFInvalidServerReplyException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFInvalidServerReplyException.h; path = src/exceptions/OFInvalidServerReplyException.h; sourceTree = ""; }; + 4B17FFB8133A3813003E6DCD /* OFInvalidServerReplyException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFInvalidServerReplyException.m; path = src/exceptions/OFInvalidServerReplyException.m; sourceTree = ""; }; 4B19023A1338D6A2000374C9 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = src/Makefile; sourceTree = SOURCE_ROOT; }; 4B19023D1338D6D5000374C9 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = tests/Makefile; sourceTree = ""; }; 4B23CA8A133811610047A1D9 /* TestPlugin.impl */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = TestPlugin.impl; sourceTree = BUILT_PRODUCTS_DIR; }; + 4B29BC33133AC4E80004B236 /* OFChangeDirectoryFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFChangeDirectoryFailedException.h; path = src/exceptions/OFChangeDirectoryFailedException.h; sourceTree = ""; }; + 4B29BC34133AC4E80004B236 /* OFChangeDirectoryFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFChangeDirectoryFailedException.m; path = src/exceptions/OFChangeDirectoryFailedException.m; sourceTree = ""; }; + 4B29BC35133AC4E80004B236 /* OFChangeFileModeFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFChangeFileModeFailedException.h; path = src/exceptions/OFChangeFileModeFailedException.h; sourceTree = ""; }; + 4B29BC36133AC4E80004B236 /* OFChangeFileModeFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFChangeFileModeFailedException.m; path = src/exceptions/OFChangeFileModeFailedException.m; sourceTree = ""; }; + 4B29BC37133AC4E80004B236 /* OFCreateDirectoryFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFCreateDirectoryFailedException.h; path = src/exceptions/OFCreateDirectoryFailedException.h; sourceTree = ""; }; + 4B29BC38133AC4E80004B236 /* OFCreateDirectoryFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFCreateDirectoryFailedException.m; path = src/exceptions/OFCreateDirectoryFailedException.m; sourceTree = ""; }; + 4B29BC39133AC4E80004B236 /* OFSeekFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFSeekFailedException.h; path = src/exceptions/OFSeekFailedException.h; sourceTree = ""; }; + 4B29BC3A133AC4E80004B236 /* OFSeekFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSeekFailedException.m; path = src/exceptions/OFSeekFailedException.m; sourceTree = ""; }; + 4B29BC44133AC7DB0004B236 /* OFChangeFileOwnerFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFChangeFileOwnerFailedException.h; path = src/exceptions/OFChangeFileOwnerFailedException.h; sourceTree = ""; }; + 4B29BC45133AC7DB0004B236 /* OFChangeFileOwnerFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFChangeFileOwnerFailedException.m; path = src/exceptions/OFChangeFileOwnerFailedException.m; sourceTree = ""; }; + 4B29BC46133AC7DB0004B236 /* OFCopyFileFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFCopyFileFailedException.h; path = src/exceptions/OFCopyFileFailedException.h; sourceTree = ""; }; + 4B29BC47133AC7DB0004B236 /* OFCopyFileFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFCopyFileFailedException.m; path = src/exceptions/OFCopyFileFailedException.m; sourceTree = ""; }; + 4B29BC48133AC7DB0004B236 /* OFDeleteDirectoryFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFDeleteDirectoryFailedException.h; path = src/exceptions/OFDeleteDirectoryFailedException.h; sourceTree = ""; }; + 4B29BC49133AC7DC0004B236 /* OFDeleteDirectoryFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDeleteDirectoryFailedException.m; path = src/exceptions/OFDeleteDirectoryFailedException.m; sourceTree = ""; }; + 4B29BC4A133AC7DC0004B236 /* OFDeleteFileFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFDeleteFileFailedException.h; path = src/exceptions/OFDeleteFileFailedException.h; sourceTree = ""; }; + 4B29BC4B133AC7DC0004B236 /* OFDeleteFileFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDeleteFileFailedException.m; path = src/exceptions/OFDeleteFileFailedException.m; sourceTree = ""; }; + 4B29BC54133AC81B0004B236 /* OFRenameFileFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFRenameFileFailedException.h; path = src/exceptions/OFRenameFileFailedException.h; sourceTree = ""; }; + 4B29BC55133AC81B0004B236 /* OFRenameFileFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFRenameFileFailedException.m; path = src/exceptions/OFRenameFileFailedException.m; sourceTree = ""; }; + 4B29BC5D133AC9C40004B236 /* OFLinkFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFLinkFailedException.h; path = src/exceptions/OFLinkFailedException.h; sourceTree = ""; }; + 4B29BC5E133AC9C40004B236 /* OFLinkFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFLinkFailedException.m; path = src/exceptions/OFLinkFailedException.m; sourceTree = ""; }; + 4B29BC5F133AC9C60004B236 /* OFSymlinkFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFSymlinkFailedException.h; path = src/exceptions/OFSymlinkFailedException.h; sourceTree = ""; }; + 4B29BC60133AC9C90004B236 /* OFSymlinkFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSymlinkFailedException.m; path = src/exceptions/OFSymlinkFailedException.m; sourceTree = ""; }; 4B3D236D1337FB5800DD29B8 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = base64.h; path = src/base64.h; sourceTree = ""; }; 4B3D236E1337FB5800DD29B8 /* base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = base64.m; path = src/base64.m; sourceTree = ""; }; 4B3D23701337FB7500DD29B8 /* OFHTTPRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFHTTPRequestTests.m; path = tests/OFHTTPRequestTests.m; sourceTree = ""; }; 4B3D23761337FBC800DD29B8 /* ObjFW.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ObjFW.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4B3D23BB1337FC5800DD29B8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; }; 4B3D23EF1338008000DD29B8 /* mach_alias_list */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = mach_alias_list; path = src/mach_alias_list; sourceTree = SOURCE_ROOT; }; 4B4986DF1101F64500A2CFDA /* objc_properties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = objc_properties.m; path = src/objc_properties.m; sourceTree = ""; }; 4B4A61F212DF5EA20048F3F2 /* OFURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFURL.h; path = src/OFURL.h; sourceTree = SOURCE_ROOT; }; 4B4A61F312DF5EA20048F3F2 /* OFURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFURL.m; path = src/OFURL.m; sourceTree = SOURCE_ROOT; }; + 4B55A0F9133ABEA900B58A93 /* OFThreadJoinFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFThreadJoinFailedException.h; path = src/exceptions/OFThreadJoinFailedException.h; sourceTree = ""; }; + 4B55A0FA133ABEA900B58A93 /* OFThreadJoinFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFThreadJoinFailedException.m; path = src/exceptions/OFThreadJoinFailedException.m; sourceTree = ""; }; + 4B55A0FB133ABEA900B58A93 /* OFThreadStartFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFThreadStartFailedException.h; path = src/exceptions/OFThreadStartFailedException.h; sourceTree = ""; }; + 4B55A0FC133ABEA900B58A93 /* OFThreadStartFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFThreadStartFailedException.m; path = src/exceptions/OFThreadStartFailedException.m; sourceTree = ""; }; + 4B55A0FD133ABEA900B58A93 /* OFThreadStillRunningException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFThreadStillRunningException.h; path = src/exceptions/OFThreadStillRunningException.h; sourceTree = ""; }; + 4B55A0FE133ABEA900B58A93 /* OFThreadStillRunningException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFThreadStillRunningException.m; path = src/exceptions/OFThreadStillRunningException.m; sourceTree = ""; }; + 4B55A106133AC05100B58A93 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = common.h; path = src/exceptions/common.h; sourceTree = ""; }; + 4B55A107133AC05100B58A93 /* OFOpenFileFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFOpenFileFailedException.h; path = src/exceptions/OFOpenFileFailedException.h; sourceTree = ""; }; + 4B55A108133AC05100B58A93 /* OFOpenFileFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFOpenFileFailedException.m; path = src/exceptions/OFOpenFileFailedException.m; sourceTree = ""; }; + 4B55A10C133AC24500B58A93 /* OFReadFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFReadFailedException.h; path = src/exceptions/OFReadFailedException.h; sourceTree = ""; }; + 4B55A10D133AC24500B58A93 /* OFReadFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFReadFailedException.m; path = src/exceptions/OFReadFailedException.m; sourceTree = ""; }; + 4B55A10E133AC24500B58A93 /* OFReadOrWriteFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFReadOrWriteFailedException.h; path = src/exceptions/OFReadOrWriteFailedException.h; sourceTree = ""; }; + 4B55A10F133AC24500B58A93 /* OFReadOrWriteFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFReadOrWriteFailedException.m; path = src/exceptions/OFReadOrWriteFailedException.m; sourceTree = ""; }; + 4B55A110133AC24500B58A93 /* OFWriteFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFWriteFailedException.h; path = src/exceptions/OFWriteFailedException.h; sourceTree = ""; }; + 4B55A111133AC24600B58A93 /* OFWriteFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFWriteFailedException.m; path = src/exceptions/OFWriteFailedException.m; sourceTree = ""; }; 4B6799561099E7C50041064A /* asprintf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = asprintf.h; path = src/asprintf.h; sourceTree = ""; }; 4B6799581099E7C50041064A /* objc_sync.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = objc_sync.m; path = src/objc_sync.m; sourceTree = ""; }; 4B67995A1099E7C50041064A /* OFArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFArray.h; path = src/OFArray.h; sourceTree = ""; }; 4B67995B1099E7C50041064A /* OFArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFArray.m; path = src/OFArray.m; sourceTree = ""; }; 4B67995C1099E7C50041064A /* OFAutoreleasePool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFAutoreleasePool.h; path = src/OFAutoreleasePool.h; sourceTree = ""; }; @@ -250,11 +424,10 @@ 4B6799601099E7C50041064A /* OFDataArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFDataArray.h; path = src/OFDataArray.h; sourceTree = ""; }; 4B6799611099E7C50041064A /* OFDataArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDataArray.m; path = src/OFDataArray.m; sourceTree = ""; }; 4B6799621099E7C50041064A /* OFDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFDictionary.h; path = src/OFDictionary.h; sourceTree = ""; }; 4B6799631099E7C50041064A /* OFDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDictionary.m; path = src/OFDictionary.m; sourceTree = ""; }; 4B6799641099E7C50041064A /* OFExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFExceptions.h; path = src/OFExceptions.h; sourceTree = ""; }; - 4B6799651099E7C50041064A /* OFExceptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFExceptions.m; path = src/OFExceptions.m; sourceTree = ""; }; 4B6799661099E7C50041064A /* OFFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFFile.h; path = src/OFFile.h; sourceTree = ""; }; 4B6799671099E7C50041064A /* OFFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFFile.m; path = src/OFFile.m; sourceTree = ""; }; 4B67996C1099E7C50041064A /* OFList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFList.h; path = src/OFList.h; sourceTree = ""; }; 4B67996D1099E7C50041064A /* OFList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFList.m; path = src/OFList.m; sourceTree = ""; }; 4B67996F1099E7C50041064A /* OFMutableArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMutableArray.h; path = src/OFMutableArray.h; sourceTree = ""; }; @@ -306,10 +479,42 @@ 4B6EF67F1235358D0076B512 /* PropertiesTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PropertiesTests.m; path = tests/PropertiesTests.m; sourceTree = SOURCE_ROOT; }; 4B6EF6801235358D0076B512 /* TestsAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestsAppDelegate.h; path = tests/TestsAppDelegate.h; sourceTree = SOURCE_ROOT; }; 4B6EF6811235358D0076B512 /* TestsAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestsAppDelegate.m; path = tests/TestsAppDelegate.m; sourceTree = SOURCE_ROOT; }; 4B6EF684123535B60076B512 /* TestPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestPlugin.m; path = tests/plugin/TestPlugin.m; sourceTree = SOURCE_ROOT; }; 4B6EF685123535C80076B512 /* test.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = test.m; path = tests/objc_sync/test.m; sourceTree = SOURCE_ROOT; }; + 4B8B16FC133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFHashAlreadyCalculatedException.h; path = src/exceptions/OFHashAlreadyCalculatedException.h; sourceTree = ""; }; + 4B8B16FD133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFHashAlreadyCalculatedException.m; path = src/exceptions/OFHashAlreadyCalculatedException.m; sourceTree = ""; }; + 4B8B1701133A3B8E007CD8B3 /* OFConditionBroadcastFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFConditionBroadcastFailedException.h; path = src/exceptions/OFConditionBroadcastFailedException.h; sourceTree = ""; }; + 4B8B1702133A3B8E007CD8B3 /* OFConditionBroadcastFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFConditionBroadcastFailedException.m; path = src/exceptions/OFConditionBroadcastFailedException.m; sourceTree = ""; }; + 4B8B1703133A3B8E007CD8B3 /* OFConditionSignalFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFConditionSignalFailedException.h; path = src/exceptions/OFConditionSignalFailedException.h; sourceTree = ""; }; + 4B8B1704133A3B8E007CD8B3 /* OFConditionSignalFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFConditionSignalFailedException.m; path = src/exceptions/OFConditionSignalFailedException.m; sourceTree = ""; }; + 4B8B1705133A3B8E007CD8B3 /* OFConditionWaitFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFConditionWaitFailedException.h; path = src/exceptions/OFConditionWaitFailedException.h; sourceTree = ""; }; + 4B8B1706133A3B8E007CD8B3 /* OFConditionWaitFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFConditionWaitFailedException.m; path = src/exceptions/OFConditionWaitFailedException.m; sourceTree = ""; }; + 4B8B1707133A3B8E007CD8B3 /* OFConditionWaitingException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFConditionWaitingException.h; path = src/exceptions/OFConditionWaitingException.h; sourceTree = ""; }; + 4B8B1708133A3B8E007CD8B3 /* OFConditionWaitingException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFConditionWaitingException.m; path = src/exceptions/OFConditionWaitingException.m; sourceTree = ""; }; + 4B8B1711133A3D04007CD8B3 /* OFMutexLockedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMutexLockedException.h; path = src/exceptions/OFMutexLockedException.h; sourceTree = ""; }; + 4B8B1712133A3D04007CD8B3 /* OFMutexLockedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMutexLockedException.m; path = src/exceptions/OFMutexLockedException.m; sourceTree = ""; }; + 4B8B1713133A3D04007CD8B3 /* OFMutexLockFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMutexLockFailedException.h; path = src/exceptions/OFMutexLockFailedException.h; sourceTree = ""; }; + 4B8B1714133A3D04007CD8B3 /* OFMutexLockFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMutexLockFailedException.m; path = src/exceptions/OFMutexLockFailedException.m; sourceTree = ""; }; + 4B8B1715133A3D04007CD8B3 /* OFMutexUnlockFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMutexUnlockFailedException.h; path = src/exceptions/OFMutexUnlockFailedException.h; sourceTree = ""; }; + 4B8B1716133A3D04007CD8B3 /* OFMutexUnlockFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMutexUnlockFailedException.m; path = src/exceptions/OFMutexUnlockFailedException.m; sourceTree = ""; }; + 4B90B787133AD46700BD33CB /* OFAlreadyConnectedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFAlreadyConnectedException.h; path = src/exceptions/OFAlreadyConnectedException.h; sourceTree = ""; }; + 4B90B788133AD46700BD33CB /* OFAlreadyConnectedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFAlreadyConnectedException.m; path = src/exceptions/OFAlreadyConnectedException.m; sourceTree = ""; }; + 4B90B789133AD46700BD33CB /* OFNotConnectedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFNotConnectedException.h; path = src/exceptions/OFNotConnectedException.h; sourceTree = ""; }; + 4B90B78A133AD46700BD33CB /* OFNotConnectedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFNotConnectedException.m; path = src/exceptions/OFNotConnectedException.m; sourceTree = ""; }; + 4B90B78B133AD46700BD33CB /* OFSetOptionFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFSetOptionFailedException.h; path = src/exceptions/OFSetOptionFailedException.h; sourceTree = ""; }; + 4B90B78C133AD46700BD33CB /* OFSetOptionFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSetOptionFailedException.m; path = src/exceptions/OFSetOptionFailedException.m; sourceTree = ""; }; + 4B90B794133AD87D00BD33CB /* OFAcceptFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFAcceptFailedException.h; path = src/exceptions/OFAcceptFailedException.h; sourceTree = ""; }; + 4B90B795133AD87D00BD33CB /* OFAcceptFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFAcceptFailedException.m; path = src/exceptions/OFAcceptFailedException.m; sourceTree = ""; }; + 4B90B796133AD87D00BD33CB /* OFAddressTranslationFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFAddressTranslationFailedException.h; path = src/exceptions/OFAddressTranslationFailedException.h; sourceTree = ""; }; + 4B90B797133AD87D00BD33CB /* OFAddressTranslationFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFAddressTranslationFailedException.m; path = src/exceptions/OFAddressTranslationFailedException.m; sourceTree = ""; }; + 4B90B798133AD87D00BD33CB /* OFBindFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFBindFailedException.h; path = src/exceptions/OFBindFailedException.h; sourceTree = ""; }; + 4B90B799133AD87D00BD33CB /* OFBindFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFBindFailedException.m; path = src/exceptions/OFBindFailedException.m; sourceTree = ""; }; + 4B90B79A133AD87D00BD33CB /* OFConnectionFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFConnectionFailedException.h; path = src/exceptions/OFConnectionFailedException.h; sourceTree = ""; }; + 4B90B79B133AD87D00BD33CB /* OFConnectionFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFConnectionFailedException.m; path = src/exceptions/OFConnectionFailedException.m; sourceTree = ""; }; + 4B90B79C133AD87D00BD33CB /* OFListenFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFListenFailedException.h; path = src/exceptions/OFListenFailedException.h; sourceTree = ""; }; + 4B90B79D133AD87D00BD33CB /* OFListenFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFListenFailedException.m; path = src/exceptions/OFListenFailedException.m; sourceTree = ""; }; 4B981CDE116F71DD00294DB7 /* OFSeekableStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFSeekableStream.h; path = src/OFSeekableStream.h; sourceTree = ""; }; 4B981CDF116F71DD00294DB7 /* OFSeekableStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSeekableStream.m; path = src/OFSeekableStream.m; sourceTree = ""; }; 4B99250F12E0780000215DBE /* OFHTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFHTTPRequest.h; path = src/OFHTTPRequest.h; sourceTree = ""; }; 4B99251012E0780000215DBE /* OFHTTPRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFHTTPRequest.m; path = src/OFHTTPRequest.m; sourceTree = ""; }; 4BAF5F46123460C900F4E111 /* OFCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFCollection.h; path = src/OFCollection.h; sourceTree = ""; }; @@ -393,10 +598,129 @@ 4BF33B1A13380A800059CEF7 /* Frameworks */, 4B3D23771337FBC800DD29B8 /* Products */, ); name = ObjFW; sourceTree = ""; + }; + 4B17FF6E133A28E0003E6DCD /* Exceptions */ = { + isa = PBXGroup; + children = ( + 4B17FF95133A31F9003E6DCD /* Supporting Files */, + 4B90B794133AD87D00BD33CB /* OFAcceptFailedException.h */, + 4B90B795133AD87D00BD33CB /* OFAcceptFailedException.m */, + 4B90B796133AD87D00BD33CB /* OFAddressTranslationFailedException.h */, + 4B90B797133AD87D00BD33CB /* OFAddressTranslationFailedException.m */, + 4B17FF7D133A2D16003E6DCD /* OFAllocFailedException.h */, + 4B17FF7E133A2D17003E6DCD /* OFAllocFailedException.m */, + 4B90B787133AD46700BD33CB /* OFAlreadyConnectedException.h */, + 4B90B788133AD46700BD33CB /* OFAlreadyConnectedException.m */, + 4B90B798133AD87D00BD33CB /* OFBindFailedException.h */, + 4B90B799133AD87D00BD33CB /* OFBindFailedException.m */, + 4B29BC33133AC4E80004B236 /* OFChangeDirectoryFailedException.h */, + 4B29BC34133AC4E80004B236 /* OFChangeDirectoryFailedException.m */, + 4B29BC44133AC7DB0004B236 /* OFChangeFileOwnerFailedException.h */, + 4B29BC45133AC7DB0004B236 /* OFChangeFileOwnerFailedException.m */, + 4B29BC35133AC4E80004B236 /* OFChangeFileModeFailedException.h */, + 4B29BC36133AC4E80004B236 /* OFChangeFileModeFailedException.m */, + 4B8B1701133A3B8E007CD8B3 /* OFConditionBroadcastFailedException.h */, + 4B8B1702133A3B8E007CD8B3 /* OFConditionBroadcastFailedException.m */, + 4B8B1703133A3B8E007CD8B3 /* OFConditionSignalFailedException.h */, + 4B8B1704133A3B8E007CD8B3 /* OFConditionSignalFailedException.m */, + 4B8B1705133A3B8E007CD8B3 /* OFConditionWaitFailedException.h */, + 4B8B1706133A3B8E007CD8B3 /* OFConditionWaitFailedException.m */, + 4B8B1707133A3B8E007CD8B3 /* OFConditionWaitingException.h */, + 4B8B1708133A3B8E007CD8B3 /* OFConditionWaitingException.m */, + 4B90B79A133AD87D00BD33CB /* OFConnectionFailedException.h */, + 4B90B79B133AD87D00BD33CB /* OFConnectionFailedException.m */, + 4B29BC46133AC7DB0004B236 /* OFCopyFileFailedException.h */, + 4B29BC47133AC7DB0004B236 /* OFCopyFileFailedException.m */, + 4B29BC37133AC4E80004B236 /* OFCreateDirectoryFailedException.h */, + 4B29BC38133AC4E80004B236 /* OFCreateDirectoryFailedException.m */, + 4B29BC48133AC7DB0004B236 /* OFDeleteDirectoryFailedException.h */, + 4B29BC49133AC7DC0004B236 /* OFDeleteDirectoryFailedException.m */, + 4B29BC4A133AC7DC0004B236 /* OFDeleteFileFailedException.h */, + 4B29BC4B133AC7DC0004B236 /* OFDeleteFileFailedException.m */, + 4B17FF85133A2E7A003E6DCD /* OFEnumerationMutationException.h */, + 4B17FF86133A2E7A003E6DCD /* OFEnumerationMutationException.m */, + 4B17FF70133A28FC003E6DCD /* OFException.h */, + 4B17FF71133A28FC003E6DCD /* OFException.m */, + 4B8B16FC133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.h */, + 4B8B16FD133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.m */, + 4B17FFAB133A3586003E6DCD /* OFHTTPRequestFailedException.h */, + 4B17FFAC133A3589003E6DCD /* OFHTTPRequestFailedException.m */, + 4B17FFA3133A340B003E6DCD /* OFInitializationFailedException.h */, + 4B17FFA4133A340D003E6DCD /* OFInitializationFailedException.m */, + 4B17FF91133A317A003E6DCD /* OFInvalidArgumentException.h */, + 4B17FF92133A317B003E6DCD /* OFInvalidArgumentException.m */, + 4B17FF97133A3242003E6DCD /* OFInvalidEncodingException.h */, + 4B17FF98133A3243003E6DCD /* OFInvalidEncodingException.m */, + 4B17FF9B133A32B7003E6DCD /* OFInvalidFormatException.h */, + 4B17FF9C133A32B8003E6DCD /* OFInvalidFormatException.m */, + 4B17FFB7133A380F003E6DCD /* OFInvalidServerReplyException.h */, + 4B17FFB8133A3813003E6DCD /* OFInvalidServerReplyException.m */, + 4B29BC5D133AC9C40004B236 /* OFLinkFailedException.h */, + 4B29BC5E133AC9C40004B236 /* OFLinkFailedException.m */, + 4B90B79C133AD87D00BD33CB /* OFListenFailedException.h */, + 4B90B79D133AD87D00BD33CB /* OFListenFailedException.m */, + 4B17FF9F133A3331003E6DCD /* OFMalformedXMLException.h */, + 4B17FFA0133A3332003E6DCD /* OFMalformedXMLException.m */, + 4B17FF8D133A3034003E6DCD /* OFMemoryNotPartOfObjectException.h */, + 4B17FF8E133A3034003E6DCD /* OFMemoryNotPartOfObjectException.m */, + 4B8B1711133A3D04007CD8B3 /* OFMutexLockedException.h */, + 4B8B1712133A3D04007CD8B3 /* OFMutexLockedException.m */, + 4B8B1713133A3D04007CD8B3 /* OFMutexLockFailedException.h */, + 4B8B1714133A3D04007CD8B3 /* OFMutexLockFailedException.m */, + 4B8B1715133A3D04007CD8B3 /* OFMutexUnlockFailedException.h */, + 4B8B1716133A3D04007CD8B3 /* OFMutexUnlockFailedException.m */, + 4B90B789133AD46700BD33CB /* OFNotConnectedException.h */, + 4B90B78A133AD46700BD33CB /* OFNotConnectedException.m */, + 4B17FF75133A2B18003E6DCD /* OFNotImplementedException.h */, + 4B17FF76133A2B18003E6DCD /* OFNotImplementedException.m */, + 4B55A107133AC05100B58A93 /* OFOpenFileFailedException.h */, + 4B55A108133AC05100B58A93 /* OFOpenFileFailedException.m */, + 4B17FF81133A2DFB003E6DCD /* OFOutOfMemoryException.h */, + 4B17FF82133A2DFB003E6DCD /* OFOutOfMemoryException.m */, + 4B17FF79133A2C14003E6DCD /* OFOutOfRangeException.h */, + 4B17FF7A133A2C15003E6DCD /* OFOutOfRangeException.m */, + 4B55A10C133AC24500B58A93 /* OFReadFailedException.h */, + 4B55A10D133AC24500B58A93 /* OFReadFailedException.m */, + 4B55A10E133AC24500B58A93 /* OFReadOrWriteFailedException.h */, + 4B55A10F133AC24500B58A93 /* OFReadOrWriteFailedException.m */, + 4B29BC54133AC81B0004B236 /* OFRenameFileFailedException.h */, + 4B29BC55133AC81B0004B236 /* OFRenameFileFailedException.m */, + 4B29BC39133AC4E80004B236 /* OFSeekFailedException.h */, + 4B29BC3A133AC4E80004B236 /* OFSeekFailedException.m */, + 4B90B78B133AD46700BD33CB /* OFSetOptionFailedException.h */, + 4B90B78C133AD46700BD33CB /* OFSetOptionFailedException.m */, + 4B29BC5F133AC9C60004B236 /* OFSymlinkFailedException.h */, + 4B29BC60133AC9C90004B236 /* OFSymlinkFailedException.m */, + 4B55A0F9133ABEA900B58A93 /* OFThreadJoinFailedException.h */, + 4B55A0FA133ABEA900B58A93 /* OFThreadJoinFailedException.m */, + 4B55A0FB133ABEA900B58A93 /* OFThreadStartFailedException.h */, + 4B55A0FC133ABEA900B58A93 /* OFThreadStartFailedException.m */, + 4B55A0FD133ABEA900B58A93 /* OFThreadStillRunningException.h */, + 4B55A0FE133ABEA900B58A93 /* OFThreadStillRunningException.m */, + 4B17FFA7133A34DF003E6DCD /* OFTruncatedDataException.h */, + 4B17FFA8133A34E1003E6DCD /* OFTruncatedDataException.m */, + 4B17FFB3133A374C003E6DCD /* OFUnboundNamespaceException.h */, + 4B17FFB4133A3750003E6DCD /* OFUnboundNamespaceException.m */, + 4B17FFAF133A3658003E6DCD /* OFUnsupportedProtocolException.h */, + 4B17FFB0133A365C003E6DCD /* OFUnsupportedProtocolException.m */, + 4B55A110133AC24500B58A93 /* OFWriteFailedException.h */, + 4B55A111133AC24600B58A93 /* OFWriteFailedException.m */, + 4B55A106133AC05100B58A93 /* common.h */, + ); + name = Exceptions; + sourceTree = ""; + }; + 4B17FF95133A31F9003E6DCD /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 4B17FF96133A3211003E6DCD /* Makefile */, + ); + name = "Supporting Files"; + sourceTree = ""; }; 4B3D23771337FBC800DD29B8 /* Products */ = { isa = PBXGroup; children = ( 4BF33AF0133807310059CEF7 /* Tests */, @@ -419,10 +743,11 @@ sourceTree = ""; }; 4B6EF66C123535340076B512 /* ObjFW */ = { isa = PBXGroup; children = ( + 4B17FF6E133A28E0003E6DCD /* Exceptions */, 4B3D23801337FBC800DD29B8 /* Supporting Files */, 4B175C1D116D130B003C99CB /* OFApplication.h */, 4B175C1E116D130B003C99CB /* OFApplication.m */, 4B67995A1099E7C50041064A /* OFArray.h */, 4B67995B1099E7C50041064A /* OFArray.m */, @@ -442,11 +767,10 @@ 4B6799621099E7C50041064A /* OFDictionary.h */, 4B6799631099E7C50041064A /* OFDictionary.m */, 4B0108C910EB8C9300631877 /* OFEnumerator.h */, 4B0108CA10EB8C9300631877 /* OFEnumerator.m */, 4B6799641099E7C50041064A /* OFExceptions.h */, - 4B6799651099E7C50041064A /* OFExceptions.m */, 4B6799661099E7C50041064A /* OFFile.h */, 4B6799671099E7C50041064A /* OFFile.m */, 4BF1BCC011C9663F0025511F /* OFHash.h */, 4BF1BCC111C9663F0025511F /* OFHash.m */, 4B99250F12E0780000215DBE /* OFHTTPRequest.h */, @@ -613,10 +937,11 @@ 4B3D23C21337FC8300DD29B8 /* OFDataArray.h in Headers */, 4B3D23C31337FC8300DD29B8 /* OFDataArray+Hashing.h in Headers */, 4B3D23C41337FC8300DD29B8 /* OFDate.h in Headers */, 4B3D23C51337FCB000DD29B8 /* OFDictionary.h in Headers */, 4B3D23C61337FCB000DD29B8 /* OFEnumerator.h in Headers */, + 4B17FF74133A2AAB003E6DCD /* OFException.h in Headers */, 4B3D23C71337FCB000DD29B8 /* OFExceptions.h in Headers */, 4B3D23C81337FCB000DD29B8 /* OFFile.h in Headers */, 4B3D23C91337FCB000DD29B8 /* OFHash.h in Headers */, 4B3D23CA1337FCB000DD29B8 /* OFHTTPRequest.h in Headers */, 4B3D23CB1337FCB000DD29B8 /* OFList.h in Headers */, @@ -651,11 +976,62 @@ 4B3D23E81337FCB000DD29B8 /* macros.h in Headers */, 4BD98C03133814220048DD5B /* objfw-defs.h in Headers */, 4B3D23E91337FCB000DD29B8 /* of_asprintf.h in Headers */, 4B3D23EA1337FCB000DD29B8 /* threading.h in Headers */, 4B3D23EB1337FCB000DD29B8 /* unicode.h in Headers */, + 4B90B79E133AD87D00BD33CB /* OFAcceptFailedException.h in Headers */, + 4B90B7A0133AD87D00BD33CB /* OFAddressTranslationFailedException.h in Headers */, + 4B17FF7F133A2D17003E6DCD /* OFAllocFailedException.h in Headers */, + 4B90B78D133AD46700BD33CB /* OFAlreadyConnectedException.h in Headers */, + 4B90B7A2133AD87D00BD33CB /* OFBindFailedException.h in Headers */, + 4B29BC3B133AC4E80004B236 /* OFChangeDirectoryFailedException.h in Headers */, + 4B29BC3D133AC4E80004B236 /* OFChangeFileModeFailedException.h in Headers */, + 4B29BC4C133AC7DD0004B236 /* OFChangeFileOwnerFailedException.h in Headers */, + 4B29BC58133AC8540004B236 /* OFConditionBroadcastFailedException.h in Headers */, + 4B29BC59133AC8540004B236 /* OFConditionSignalFailedException.h in Headers */, + 4B29BC5A133AC8540004B236 /* OFConditionWaitFailedException.h in Headers */, + 4B29BC5B133AC8540004B236 /* OFConditionWaitingException.h in Headers */, + 4B90B7A4133AD87D00BD33CB /* OFConnectionFailedException.h in Headers */, + 4B29BC4E133AC7DD0004B236 /* OFCopyFileFailedException.h in Headers */, + 4B29BC3F133AC4E80004B236 /* OFCreateDirectoryFailedException.h in Headers */, + 4B29BC50133AC7DD0004B236 /* OFDeleteDirectoryFailedException.h in Headers */, + 4B29BC52133AC7DD0004B236 /* OFDeleteFileFailedException.h in Headers */, + 4B17FF87133A2E7B003E6DCD /* OFEnumerationMutationException.h in Headers */, + 4B8B16FE133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.h in Headers */, + 4B17FFAD133A3591003E6DCD /* OFHTTPRequestFailedException.h in Headers */, + 4B17FFA5133A3411003E6DCD /* OFInitializationFailedException.h in Headers */, + 4B17FF93133A317C003E6DCD /* OFInvalidArgumentException.h in Headers */, + 4B17FF99133A3245003E6DCD /* OFInvalidEncodingException.h in Headers */, + 4B17FF9D133A32BA003E6DCD /* OFInvalidFormatException.h in Headers */, + 4B17FFB9133A381D003E6DCD /* OFInvalidServerReplyException.h in Headers */, + 4B29BC61133AC9CB0004B236 /* OFLinkFailedException.h in Headers */, + 4B90B7A6133AD87D00BD33CB /* OFListenFailedException.h in Headers */, + 4B17FFA1133A3335003E6DCD /* OFMalformedXMLException.h in Headers */, + 4B17FF8F133A3036003E6DCD /* OFMemoryNotPartOfObjectException.h in Headers */, + 4B8B1717133A3D04007CD8B3 /* OFMutexLockedException.h in Headers */, + 4B8B1719133A3D04007CD8B3 /* OFMutexLockFailedException.h in Headers */, + 4B8B171B133A3D04007CD8B3 /* OFMutexUnlockFailedException.h in Headers */, + 4B90B78F133AD46700BD33CB /* OFNotConnectedException.h in Headers */, + 4B17FF77133A2B18003E6DCD /* OFNotImplementedException.h in Headers */, + 4B29BC5C133AC8540004B236 /* OFRenameFileFailedException.h in Headers */, + 4B55A10A133AC05100B58A93 /* OFOpenFileFailedException.h in Headers */, + 4B17FF83133A2DFB003E6DCD /* OFOutOfMemoryException.h in Headers */, + 4B17FF7B133A2C15003E6DCD /* OFOutOfRangeException.h in Headers */, + 4B55A112133AC24600B58A93 /* OFReadFailedException.h in Headers */, + 4B55A114133AC24600B58A93 /* OFReadOrWriteFailedException.h in Headers */, + 4B29BC41133AC4E80004B236 /* OFSeekFailedException.h in Headers */, + 4B90B791133AD46700BD33CB /* OFSetOptionFailedException.h in Headers */, + 4B29BC63133AC9CB0004B236 /* OFSymlinkFailedException.h in Headers */, + 4B17FFA9133A34E7003E6DCD /* OFTruncatedDataException.h in Headers */, + 4B17FFB5133A375B003E6DCD /* OFUnboundNamespaceException.h in Headers */, + 4B17FFB1133A3664003E6DCD /* OFUnsupportedProtocolException.h in Headers */, + 4B55A0FF133ABEA900B58A93 /* OFThreadJoinFailedException.h in Headers */, + 4B55A101133ABEA900B58A93 /* OFThreadStartFailedException.h in Headers */, + 4B55A103133ABEA900B58A93 /* OFThreadStillRunningException.h in Headers */, + 4B55A116133AC24600B58A93 /* OFWriteFailedException.h in Headers */, 4BDF37B51338055600F9A81A /* config.h in Headers */, + 4B55A109133AC05100B58A93 /* common.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ @@ -737,12 +1113,12 @@ productRefGroup = 4B3D23771337FBC800DD29B8 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 4BF33AEF133807310059CEF7 /* Tests */, - 4B23CA89133811610047A1D9 /* TestPlugin */, 4B3D23751337FBC800DD29B8 /* ObjFW */, + 4B23CA89133811610047A1D9 /* TestPlugin */, 4B5D8DDD1099E1B0000896FF /* autogen.sh */, 4BDF37AD1338047700F9A81A /* configure */, ); }; /* End PBXProject section */ @@ -811,11 +1187,10 @@ 4B3D23901337FC0D00DD29B8 /* OFDataArray.m in Sources */, 4B3D23911337FC0D00DD29B8 /* OFDataArray+Hashing.m in Sources */, 4B3D23921337FC0D00DD29B8 /* OFDate.m in Sources */, 4B3D23931337FC0D00DD29B8 /* OFDictionary.m in Sources */, 4B3D23941337FC0D00DD29B8 /* OFEnumerator.m in Sources */, - 4B3D23951337FC0D00DD29B8 /* OFExceptions.m in Sources */, 4B3D23961337FC0D00DD29B8 /* OFFile.m in Sources */, 4B3D23971337FC0D00DD29B8 /* OFHash.m in Sources */, 4B3D23981337FC0D00DD29B8 /* OFHTTPRequest.m in Sources */, 4B3D23991337FC0D00DD29B8 /* OFList.m in Sources */, 4B3D239A1337FC0D00DD29B8 /* OFMD5Hash.m in Sources */, @@ -846,10 +1221,61 @@ 4B3D23B41337FC0D00DD29B8 /* iso_8859_15.m in Sources */, 4B3D23B51337FC0D00DD29B8 /* foundation-compat.m in Sources */, 4B3D23EE1337FFD000DD29B8 /* of_asprintf.m in Sources */, 4B3D23B91337FC0D00DD29B8 /* unicode.m in Sources */, 4B3D23BA1337FC0D00DD29B8 /* windows_1252.m in Sources */, + 4B90B79F133AD87D00BD33CB /* OFAcceptFailedException.m in Sources */, + 4B90B7A1133AD87D00BD33CB /* OFAddressTranslationFailedException.m in Sources */, + 4B17FF80133A2D17003E6DCD /* OFAllocFailedException.m in Sources */, + 4B90B78E133AD46700BD33CB /* OFAlreadyConnectedException.m in Sources */, + 4B90B7A3133AD87D00BD33CB /* OFBindFailedException.m in Sources */, + 4B29BC3C133AC4E80004B236 /* OFChangeDirectoryFailedException.m in Sources */, + 4B29BC3E133AC4E80004B236 /* OFChangeFileModeFailedException.m in Sources */, + 4B29BC4D133AC7DD0004B236 /* OFChangeFileOwnerFailedException.m in Sources */, + 4B8B170D133A3C11007CD8B3 /* OFConditionBroadcastFailedException.m in Sources */, + 4B8B170E133A3C11007CD8B3 /* OFConditionSignalFailedException.m in Sources */, + 4B8B170F133A3C11007CD8B3 /* OFConditionWaitFailedException.m in Sources */, + 4B8B1710133A3C11007CD8B3 /* OFConditionWaitingException.m in Sources */, + 4B90B7A5133AD87D00BD33CB /* OFConnectionFailedException.m in Sources */, + 4B29BC4F133AC7DD0004B236 /* OFCopyFileFailedException.m in Sources */, + 4B29BC40133AC4E80004B236 /* OFCreateDirectoryFailedException.m in Sources */, + 4B29BC51133AC7DD0004B236 /* OFDeleteDirectoryFailedException.m in Sources */, + 4B29BC53133AC7DD0004B236 /* OFDeleteFileFailedException.m in Sources */, + 4B17FF88133A2E7B003E6DCD /* OFEnumerationMutationException.m in Sources */, + 4B17FF73133A2A76003E6DCD /* OFException.m in Sources */, + 4B8B16FF133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.m in Sources */, + 4B17FFAE133A3591003E6DCD /* OFHTTPRequestFailedException.m in Sources */, + 4B17FFA6133A3411003E6DCD /* OFInitializationFailedException.m in Sources */, + 4B17FF94133A317C003E6DCD /* OFInvalidArgumentException.m in Sources */, + 4B17FF9A133A3245003E6DCD /* OFInvalidEncodingException.m in Sources */, + 4B17FF9E133A32BA003E6DCD /* OFInvalidFormatException.m in Sources */, + 4B17FFBA133A381D003E6DCD /* OFInvalidServerReplyException.m in Sources */, + 4B29BC62133AC9CB0004B236 /* OFLinkFailedException.m in Sources */, + 4B90B7A7133AD87D00BD33CB /* OFListenFailedException.m in Sources */, + 4B17FFA2133A3335003E6DCD /* OFMalformedXMLException.m in Sources */, + 4B17FF90133A3036003E6DCD /* OFMemoryNotPartOfObjectException.m in Sources */, + 4B8B1718133A3D04007CD8B3 /* OFMutexLockedException.m in Sources */, + 4B8B171A133A3D04007CD8B3 /* OFMutexLockFailedException.m in Sources */, + 4B8B171C133A3D04007CD8B3 /* OFMutexUnlockFailedException.m in Sources */, + 4B90B790133AD46700BD33CB /* OFNotConnectedException.m in Sources */, + 4B17FF78133A2B18003E6DCD /* OFNotImplementedException.m in Sources */, + 4B55A10B133AC05100B58A93 /* OFOpenFileFailedException.m in Sources */, + 4B17FF84133A2DFB003E6DCD /* OFOutOfMemoryException.m in Sources */, + 4B17FF7C133A2C15003E6DCD /* OFOutOfRangeException.m in Sources */, + 4B55A113133AC24600B58A93 /* OFReadFailedException.m in Sources */, + 4B55A115133AC24600B58A93 /* OFReadOrWriteFailedException.m in Sources */, + 4B29BC57133AC8420004B236 /* OFRenameFileFailedException.m in Sources */, + 4B29BC42133AC4E80004B236 /* OFSeekFailedException.m in Sources */, + 4B90B792133AD46700BD33CB /* OFSetOptionFailedException.m in Sources */, + 4B29BC64133AC9CB0004B236 /* OFSymlinkFailedException.m in Sources */, + 4B55A100133ABEA900B58A93 /* OFThreadJoinFailedException.m in Sources */, + 4B55A102133ABEA900B58A93 /* OFThreadStartFailedException.m in Sources */, + 4B55A104133ABEA900B58A93 /* OFThreadStillRunningException.m in Sources */, + 4B17FFAA133A34E7003E6DCD /* OFTruncatedDataException.m in Sources */, + 4B17FFB6133A375B003E6DCD /* OFUnboundNamespaceException.m in Sources */, + 4B17FFB2133A3664003E6DCD /* OFUnsupportedProtocolException.m in Sources */, + 4B55A117133AC24600B58A93 /* OFWriteFailedException.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 4BF33AEC133807310059CEF7 /* Sources */ = { isa = PBXSourcesBuildPhase; Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -175,21 +175,25 @@ AC_CHECK_FUNC(objc_enumerationMutation, [ AC_DEFINE(HAVE_OBJC_ENUMERATIONMUTATION, 1, [Whether we have objc_enumerationMutation]) ]) +AC_PATH_TOOL(AR, ar) +AC_PROG_RANLIB AC_ARG_ENABLE(shared, AS_HELP_STRING([--disable-shared], [don't build shared library])) AS_IF([test x"$enable_shared" != x"no"], [ BUILDSYS_SHARED_LIB AC_SUBST(OBJFW_SHARED_LIB, "${LIB_PREFIX}objfw${LIB_SUFFIX}") + AC_SUBST(EXCEPTIONS_LIB_A, "exceptions.lib.a") + AC_SUBST(EXCEPTIONS_EXCEPTIONS_LIB_A, "exceptions/exceptions.lib.a") ]) AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [build static library])) AS_IF([test x"$enable_static" = x"yes" -o x"$enable_shared" = x"no"], [ - AC_REQUIRE([AC_PROG_RANLIB]) - AC_PATH_TOOL(AR, ar) AC_SUBST(OBJFW_STATIC_LIB, "libobjfw.a") + AC_SUBST(EXCEPTIONS_A, "exceptions.a") + AC_SUBST(EXCEPTIONS_EXCEPTIONS_A, "exceptions/exceptions.a") ]) AC_DEFINE_UNQUOTED(PLUGIN_SUFFIX, "$PLUGIN_SUFFIX", [Suffix for plugins]) AS_IF([test x"$PLUGIN_SUFFIX" != "x"], [ AC_SUBST(OFPLUGIN_M, "OFPlugin.m") Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -5,10 +5,14 @@ OBJFW_LIB_MAJOR_MINOR = ${OBJFW_LIB_MAJOR}.${OBJFW_LIB_MINOR} ASPRINTF_M = @ASPRINTF_M@ ATOMIC_H = @ATOMIC_H@ BIN_PREFIX = @BIN_PREFIX@ +EXCEPTIONS_A = @EXCEPTIONS_A@ +EXCEPTIONS_EXCEPTIONS_A = @EXCEPTIONS_EXCEPTIONS_A@ +EXCEPTIONS_EXCEPTIONS_LIB_A = @EXCEPTIONS_EXCEPTIONS_LIB_A@ +EXCEPTIONS_LIB_A = @EXCEPTIONS_LIB_A@ FOUNDATION_COMPAT_M = @FOUNDATION_COMPAT_M@ MACH_ALIAS_LIST = @MACH_ALIAS_LIST@ OFBLOCKTESTS_M = @OFBLOCKTESTS_M@ OBJC_PROPERTIES_M = @OBJC_PROPERTIES_M@ OBJC_SYNC_M = @OBJC_SYNC_M@ Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -1,6 +1,8 @@ include ../extra.mk + +SUBDIRS = exceptions LIB = ${OBJFW_SHARED_LIB} LIB_MAJOR = ${OBJFW_LIB_MAJOR} LIB_MINOR = ${OBJFW_LIB_MINOR} STATIC_LIB = ${OBJFW_STATIC_LIB} @@ -12,11 +14,10 @@ OFConstantString.m \ OFDataArray.m \ OFDataArray+Hashing.m \ OFDate.m \ OFDictionary.m \ - OFExceptions.m \ OFFile.m \ OFHash.m \ OFHTTPRequest.m \ OFEnumerator.m \ OFList.m \ @@ -48,10 +49,11 @@ of_asprintf.m \ unicode.m INCLUDES := ${SRCS:.m=.h} \ OFCollection.h \ + OFExceptions.h \ ObjFW.h \ asprintf.h \ ${ATOMIC_H} \ macros.h \ objfw-defs.h \ @@ -64,8 +66,11 @@ ${OBJC_PROPERTIES_M} \ ${OBJC_SYNC_M} include ../buildsys.mk -CPPFLAGS += -I.. +CPPFLAGS += -I. -I.. -Iexceptions LD = ${OBJC} LDFLAGS += ${REEXPORT_LIBOBJC} ${MACH_ALIAS_LIST} + +LIB_OBJS += ${EXCEPTIONS_EXCEPTIONS_LIB_A} +OBJS += ${EXCEPTIONS_EXCEPTIONS_A} Index: src/OFExceptions.h ================================================================== --- src/OFExceptions.h +++ src/OFExceptions.h @@ -12,1357 +12,56 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#include - -#import "OFObject.h" - -@class OFString; -@class OFURL; -@class OFHTTPRequest; - -/** - * \brief An exception indicating an object could not be allocated. - * - * This exception is preallocated, as if there's no memory, no exception can - * be allocated of course. That's why you shouldn't and even can't deallocate - * it. - * - * This is the only exception that is not an OFException as it's special. - * It does not know for which class allocation failed and it should not be - * handled like other exceptions, as the exception handling code is not - * allowed to allocate ANY memory. - */ -@interface OFAllocFailedException: OFObject -/** - * \return A description of the exception - */ -- (OFString*)description; -@end - -/** - * \brief The base class for all exceptions in ObjFW - * - * The OFException class is the base class for all exceptions in ObjFW, except - * the OFAllocFailedException. - * - * IMPORTANT: Exceptions do NOT use OFAutoreleasePools and can't be autoreleased - * either! You have to make sure to dealloc the exception in your \@catch block! - */ -@interface OFException: OFObject -{ - Class inClass; - OFString *description; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) Class inClass; -#endif - -/** - * Creates a new exception. - * - * \param class_ The class of the object which caused the exception - * \return A new exception - */ -+ newWithClass: (Class)class_; - -/** - * Initializes an already allocated OFException. - * - * \param class_ The class of the object which caused the exception - * \return An initialized OFException - */ -- initWithClass: (Class)class_; - -/** - * \return The class of the object in which the exception happened - */ -- (Class)inClass; - -/** - * \return A description of the exception - */ -- (OFString*)description; -@end - -/** - * \brief An exception indicating there is not enough memory available. - */ -@interface OFOutOfMemoryException: OFException -{ - size_t requestedSize; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly) size_t requestedSize; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param size The size of the memory that couldn't be allocated - * \return A new no memory exception - */ -+ newWithClass: (Class)class_ - requestedSize: (size_t)size; - -/** - * Initializes an already allocated no memory exception. - * - * \param class_ The class of the object which caused the exception - * \param size The size of the memory that couldn't be allocated - * \return An initialized no memory exception - */ -- initWithClass: (Class)class_ - requestedSize: (size_t)size; - -/** - * \return The size of the memoory that couldn't be allocated - */ -- (size_t)requestedSize; -@end - -/** - * \brief An exception indicating that a mutation was detected during - * enumeration. - */ -@interface OFEnumerationMutationException: OFException -@end - -/** - * \brief An exception indicating the given memory is not part of the object. - */ -@interface OFMemoryNotPartOfObjectException: OFException -{ - void *pointer; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly) void *pointer; -#endif - -/** - * \param class_ The class of 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 - */ -+ newWithClass: (Class)class_ - pointer: (void*)ptr; - -/** - * Initializes an already allocated memory not part of object exception. - * - * \param class_ The class of the object which caused the exception - * \param ptr A pointer to the memory that is not part of the object - * \return An initialized memory not part of object exception - */ -- initWithClass: (Class)class_ - pointer: (void*)ptr; - -/** - * \return A pointer to the memory which is not part of the object - */ -- (void*)pointer; -@end - -/** - * \brief An exception indicating that a method or part of it is not - * implemented. - */ -@interface OFNotImplementedException: OFException -{ - SEL selector; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly) SEL selector; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param selector The selector which is not or not fully implemented - * \return A new not implemented exception - */ -+ newWithClass: (Class)class_ - selector: (SEL)selector; - -/** - * Initializes an already allocated not implemented exception. - * - * \param class_ The class of the object which caused the exception - * \param selector The selector which is not or not fully implemented - * \return An initialized not implemented exception - */ -- initWithClass: (Class)class_ - selector: (SEL)selector; - -/** - * \return The selector which is not or not fully implemented - */ -- (SEL)selector; -@end - -/** - * \brief An exception indicating the given value is out of range. - */ -@interface OFOutOfRangeException: OFException -@end - -/** - * \brief An exception indicating that the argument is invalid for this method. - */ -@interface OFInvalidArgumentException: OFException -{ - SEL selector; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly) SEL selector; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param selector The selector which doesn't accept the argument - * \return A new invalid argument exception - */ -+ newWithClass: (Class)class_ - selector: (SEL)selector; - -/** - * Initializes an already allocated invalid argument exception - * - * \param class_ The class of the object which caused the exception - * \param selector The selector which doesn't accept the argument - * \return An initialized invalid argument exception - */ -- initWithClass: (Class)class_ - selector: (SEL)selector; - -/** - * \return The selector to which an invalid argument was passed - */ -- (SEL)selector; -@end - -/** - * \brief An exception indicating that the encoding is invalid for this object. - */ -@interface OFInvalidEncodingException: OFException -@end - -/** - * \brief An exception indicating that the format is invalid. - */ -@interface OFInvalidFormatException: OFException -@end - -/** - * \brief An exception indicating that a parser encountered malformed or - * invalid XML. - */ -@interface OFMalformedXMLException: OFException -@end - -/** - * \brief An exception indicating that initializing something failed. - */ -@interface OFInitializationFailedException: OFException -@end - -/** - * \brief An exception indicating a file couldn't be opened. - */ -@interface OFOpenFileFailedException: OFException -{ - OFString *path; - OFString *mode; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *path; -@property (readonly, nonatomic) OFString *mode; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param path A string with the path of the file tried to open - * \param mode A string with the mode in which the file should have been opened - * \return A new open file failed exception - */ -+ newWithClass: (Class)class_ - path: (OFString*)path - mode: (OFString*)mode; - -/** - * Initializes an already allocated open file failed exception. - * - * \param class_ The class of the object which caused the exception - * \param path A string with the path of the file which couldn't be opened - * \param mode A string with the mode in which the file should have been opened - * \return An initialized open file failed exception - */ -- initWithClass: (Class)class_ - path: (OFString*)path - mode: (OFString*)mode; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return A string with the path of the file which couldn't be opened - */ -- (OFString*)path; - -/** - * \return A string with the mode in which the file should have been opened - */ -- (OFString*)mode; -@end - -/** - * \brief An exception indicating a read or write to a stream failed. - */ -@interface OFReadOrWriteFailedException: OFException -{ - size_t requestedSize; -@public - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly) size_t requestedSize; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of 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 - */ -+ newWithClass: (Class)class_ - requestedSize: (size_t)size; - -/** - * Initializes an already allocated read or write failed exception. - * - * \param class_ The class of 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 - */ -- initWithClass: (Class)class_ - requestedSize: (size_t)size; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return The requested size of the data that couldn't be read / written - */ -- (size_t)requestedSize; -@end - -/** - * \brief An exception indicating a read on a stream failed. - */ -@interface OFReadFailedException: OFReadOrWriteFailedException -@end - -/** - * \brief An exception indicating a write to a stream failed. - */ -@interface OFWriteFailedException: OFReadOrWriteFailedException -@end - -/** - * \brief An exception indicating that seeking in a stream failed. - */ -@interface OFSeekFailedException: OFException -{ - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly) int errNo; -#endif - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; -@end - -/** - * \brief An exception indicating a directory couldn't be created. - */ -@interface OFCreateDirectoryFailedException: OFException -{ - OFString *path; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *path; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param path A string with the path of the directory which couldn't be created - * \return A new create directory failed exception - */ -+ newWithClass: (Class)class_ - path: (OFString*)path; - -/** - * Initializes an already allocated create directory failed exception. - * - * \param class_ The class of the object which caused the exception - * \param path A string with the path of the directory which couldn't be created - * \return An initialized create directory failed exception - */ -- initWithClass: (Class)class_ - path: (OFString*)path; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return A string with the path of the directory which couldn't be created - */ -- (OFString*)path; -@end - -/** - * \brief An exception indicating changing to a directory failed - */ -@interface OFChangeDirectoryFailedException: OFException -{ - OFString *path; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *path; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param path A string with the path of the directory to which couldn't be - * changed - * \return A new change directory failed exception - */ -+ newWithClass: (Class)class_ - path: (OFString*)path; - -/** - * Initializes an already allocated change directory failed exception. - * - * \param class_ The class of the object which caused the exception - * \param path A string with the path of the directory to which couldn't be - * changed - * \return An initialized change directory failed exception - */ -- initWithClass: (Class)class_ - path: (OFString*)path; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return A string with the path of the directory to which couldn't changed - */ -- (OFString*)path; -@end - -/** - * \brief An exception indicating that changing the mode of a file failed. - */ -@interface OFChangeFileModeFailedException: OFException -{ - OFString *path; - mode_t mode; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *path; -@property (readonly) mode_t mode; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param path The path of the file - * \param mode The new mode for the file - * \return An initialized change file mode failed exception - */ -+ newWithClass: (Class)class_ - path: (OFString*)path - mode: (mode_t)mode; - -/** - * Initializes an already allocated change file mode failed exception. - * - * \param class_ The class of the object which caused the exception - * \param path The path of the file - * \param mode The new mode for the file - * \return An initialized change file mode failed exception - */ -- initWithClass: (Class)class_ - path: (OFString*)path - mode: (mode_t)mode; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return The path of the file - */ -- (OFString*)path; - -/** - * \return The new mode for the file - */ -- (mode_t)mode; -@end - -#ifndef _WIN32 -/** - * \brief An exception indicating that changing the owner of a file failed. - */ -@interface OFChangeFileOwnerFailedException: OFException -{ - OFString *path; - OFString *owner; - OFString *group; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *path; -@property (readonly, nonatomic) OFString *owner; -@property (readonly, nonatomic) OFString *group; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param path The path of the file - * \param owner The new owner for the file - * \param group The new group for the file - * \return An initialized change file owner failed exception - */ -+ newWithClass: (Class)class_ - path: (OFString*)path - owner: (OFString*)owner - group: (OFString*)group; - -/** - * Initializes an already allocated change file owner failed exception. - * - * \param class_ The class of the object which caused the exception - * \param path The path of the file - * \param owner The new owner for the file - * \param group The new group for the file - * \return An initialized change file owner failed exception - */ -- initWithClass: (Class)class_ - path: (OFString*)path - owner: (OFString*)owner - group: (OFString*)group; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return The path of the file - */ -- (OFString*)path; - -/** - * \return The new owner for the file - */ -- (OFString*)owner; - -/** - * \return The new group for the file - */ -- (OFString*)group; -@end -#endif - -/** - * \brief An exception indicating that copying a file failed. - */ -@interface OFCopyFileFailedException: OFException -{ - OFString *sourcePath; - OFString *destinationPath; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *sourcePath; -@property (readonly, nonatomic) OFString *destinationPath; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param src The original path - * \param dst The new path - * \return A new copy file failed exception - */ -+ newWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dst; - -/** - * Initializes an already allocated copy file failed exception. - * - * \param class_ The class of the object which caused the exception - * \param src The original path - * \param dst The new path - * \return An initialized copy file failed exception - */ -- initWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dst; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return The path of the source file - */ -- (OFString*)sourcePath; - -/** - * \return The destination path - */ -- (OFString*)destinationPath; -@end - -/** - * \brief An exception indicating that renaming a file failed. - */ -@interface OFRenameFileFailedException: OFException -{ - OFString *sourcePath; - OFString *destinationPath; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *sourcePath; -@property (readonly, nonatomic) OFString *destinationPath; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param src The original path - * \param dst The new path - * \return A new rename file failed exception - */ -+ newWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dst; - -/** - * Initializes an already allocated rename failed exception. - * - * \param class_ The class of the object which caused the exception - * \param src The original path - * \param dst The new path - * \return An initialized rename file failed exception - */ -- initWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dst; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return The original path - */ -- (OFString*)sourcePath; - -/** - * \return The new path - */ -- (OFString*)destinationPath; -@end - -/** - * \brief An exception indicating that deleting a file failed. - */ -@interface OFDeleteFileFailedException: OFException -{ - OFString *path; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *path; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param path The path of the file - * \return A new delete file failed exception - */ -+ newWithClass: (Class)class_ - path: (OFString*)path; - -/** - * Initializes an already allocated delete file failed exception. - * - * \param class_ The class of the object which caused the exception - * \param path The path of the file - * \return An initialized delete file failed exception - */ -- initWithClass: (Class)class_ - path: (OFString*)path; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return The path of the file - */ -- (OFString*)path; -@end - -/** - * \brief An exception indicating that deleting a directory failed. - */ -@interface OFDeleteDirectoryFailedException: OFException -{ - OFString *path; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *path; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param path The path of the directory - * \return A new delete directory failed exception - */ -+ newWithClass: (Class)class_ - path: (OFString*)path; - -/** - * Initializes an already allocated delete directory failed exception. - * - * \param class_ The class of the object which caused the exception - * \param path The path of the directory - * \return An initialized delete directory failed exception - */ -- initWithClass: (Class)class_ - path: (OFString*)path; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return The path of the directory - */ -- (OFString*)path; -@end - -#ifndef _WIN32 -/** - * \brief An exception indicating that creating a link failed. - */ -@interface OFLinkFailedException: OFException -{ - OFString *sourcePath; - OFString *destinationPath; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *sourcePath; -@property (readonly, nonatomic) OFString *destinationPath; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param src The source for the link - * \param dest The destination for the link - * \return A new link failed exception - */ -+ newWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dest; - -/** - * Initializes an already allocated link failed exception. - * - * \param class_ The class of the object which caused the exception - * \param src The source for the link - * \param dest The destination for the link - * \return An initialized link failed exception - */ -- initWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dest; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return A string with the source for the link - */ -- (OFString*)sourcePath; - -/** - * \return A string with the destination for the link - */ -- (OFString*)destinationPath; -@end - -/** - * \brief An exception indicating that creating a symlink failed. - */ -@interface OFSymlinkFailedException: OFException -{ - OFString *sourcePath; - OFString *destinationPath; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *sourcePath; -@property (readonly, nonatomic) OFString *destinationPath; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param src The source for the symlink - * \param dest The destination for the symlink - * \return A new symlink failed exception - */ -+ newWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dest; - -/** - * Initializes an already allocated symlink failed exception. - * - * \param class_ The class of the object which caused the exception - * \param src The source for the symlink - * \param dest The destination for the symlink - * \return An initialized symlink failed exception - */ -- initWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dest; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return A string with the source for the symlink - */ -- (OFString*)sourcePath; - -/** - * \return A string with the destination for the symlink - */ -- (OFString*)destinationPath; -@end -#endif - -/** - * \brief An exception indicating that setting an option failed. - */ -@interface OFSetOptionFailedException: OFException -@end - -/** - * \brief An exception indicating a socket is not connected or bound. - */ -@interface OFNotConnectedException: OFException -@end - -/** - * \brief An exception indicating an attempt to connect or bind an already - * connected or bound socket. - */ -@interface OFAlreadyConnectedException: OFException -@end - -/** - * \brief An exception indicating the translation of an address failed. - */ -@interface OFAddressTranslationFailedException: OFException -{ - OFString *host; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *host; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param host The host for which translation was requested - * \return A new address translation failed exception - */ -+ newWithClass: (Class)class_ - host: (OFString*)host; - -/** - * Initializes an already allocated address translation failed exception. - * - * \param class_ The class of the object which caused the exception - * \param host The host for which translation was requested - * \return An initialized address translation failed exception - */ -- initWithClass: (Class)class_ - host: (OFString*)host; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * /return The host for which translation was requested - */ -- (OFString*)host; -@end - -/** - * \brief An exception indicating that a connection could not be established. - */ -@interface OFConnectionFailedException: OFException -{ - OFString *host; - uint16_t port; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *host; -@property (readonly) uint16_t port; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param host The host to which the connection failed - * \param port The port on the host to which the connection failed - * \return A new connection failed exception - */ -+ newWithClass: (Class)class_ - host: (OFString*)host - port: (uint16_t)port; - -/** - * Initializes an already allocated connection failed exception. - * - * \param class_ The class of the object which caused the exception - * \param host The host to which the connection failed - * \param port The port on the host to which the connection failed - * \return An initialized connection failed exception - */ -- initWithClass: (Class)class_ - host: (OFString*)host - port: (uint16_t)port; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return The host to which the connection failed - */ -- (OFString*)host; - -/** - * \return The port on the host to which the connection failed - */ -- (uint16_t)port; -@end - -/** - * \brief An exception indicating that binding a socket failed. - */ -@interface OFBindFailedException: OFException -{ - OFString *host; - uint16_t port; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFString *host; -@property (readonly) uint16_t port; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param host The host on which binding failed - * \param port The port on which binding failed - * \return A new bind failed exception - */ -+ newWithClass: (Class)class_ - host: (OFString*)host - port: (uint16_t)port; - -/** - * Initializes an already allocated bind failed exception. - * - * \param class_ The class of the object which caused the exception - * \param host The host on which binding failed - * \param port The port on which binding failed - * \return An initialized bind failed exception - */ -- initWithClass: (Class)class_ - host: (OFString*)host - port: (uint16_t)port; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return The host on which binding failed - */ -- (OFString*)host; - -/** - * \return The port on which binding failed - */ -- (uint16_t)port; -@end - -/** - * \brief An exception indicating that listening on the socket failed. - */ -@interface OFListenFailedException: OFException -{ - int backLog; - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly) int backLog; -@property (readonly) int errNo; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param backlog The requested size of the back log - * \return A new listen failed exception - */ -+ newWithClass: (Class)class_ - backLog: (int)backlog; - -/** - * Initializes an already allocated listen failed exception - * - * \param class_ The class of the object which caused the exception - * \param backlog The requested size of the back log - * \return An initialized listen failed exception - */ -- initWithClass: (Class)class_ - backLog: (int)backlog; - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; - -/** - * \return The requested back log. - */ -- (int)backLog; -@end - -/** - * \brief An exception indicating that accepting a connection failed. - */ -@interface OFAcceptFailedException: OFException -{ - int errNo; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly) int errNo; -#endif - -/** - * \return The errno from when the exception was created - */ -- (int)errNo; -@end - -/** - * \brief An exception indicating that starting a thread failed. - */ -@interface OFThreadStartFailedException: OFException -@end - -/** - * \brief An exception indicating that joining a thread failed. - */ -@interface OFThreadJoinFailedException: OFException -@end - -/** - * \brief An exception indicating that a thread is still running. - */ -@interface OFThreadStillRunningException: OFException -@end - -/** - * \brief An exception indicating that locking a mutex failed. - */ -@interface OFMutexLockFailedException: OFException -@end - -/** - * \brief An exception indicating that unlocking a mutex failed. - */ -@interface OFMutexUnlockFailedException: OFException -@end - -/** - * \brief An exception indicating that a mutex is still locked. - */ -@interface OFMutexLockedException: OFException -@end - -/** - * \brief An exception indicating waiting for a condition failed. - */ -@interface OFConditionWaitFailedException: OFException -@end - -/** - * \brief An exception indicating signalling a condition failed. - */ -@interface OFConditionSignalFailedException: OFException -@end - -/** - * \brief An exception indicating broadcasting a condition failed. - */ -@interface OFConditionBroadcastFailedException: OFException -@end - -/** - * \brief An exception indicating that a thread is still waiting for a - * condition. - */ -@interface OFConditionWaitingException: OFException -@end - -/** - * \brief An exception indicating that the hash has already been calculated. - */ -@interface OFHashAlreadyCalculatedException: OFException -@end - -/** - * \brief An exception indicating an attempt to use an unbound namespace. - */ -@interface OFUnboundNamespaceException: OFException -{ - OFString *ns; - OFString *prefix; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic, getter=namespace) OFString *ns; -@property (readonly, nonatomic) OFString *prefix; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param ns The namespace which is unbound - * \return A new unbound namespace exception - */ -+ newWithClass: (Class)class_ - namespace: (OFString*)ns; - -/** - * \param class_ The class of the object which caused the exception - * \param prefix The prefix which is unbound - * \return A new unbound namespace exception - */ -+ newWithClass: (Class)class_ - prefix: (OFString*)prefix; - -/** - * Initializes an already allocated unbound namespace exception - * - * \param class_ The class of the object which caused the exception - * \param ns The namespace which is unbound - * \return An initialized unbound namespace exception - */ -- initWithClass: (Class)class_ - namespace: (OFString*)ns; - -/** - * Initializes an already allocated unbound namespace exception - * - * \param class_ The class of the object which caused the exception - * \param prefix The prefix which is unbound - * \return An initialized unbound namespace exception - */ -- initWithClass: (Class)class_ - prefix: (OFString*)prefix; - -/** - * \return The unbound namespace - */ -- (OFString*)namespace; - -/** - * \return The unbound prefix - */ -- (OFString*)prefix; -@end - -/** - * \brief An exception indicating that the protocol specified by the URL is not - * supported. - */ -@interface OFUnsupportedProtocolException: OFException -{ - OFURL *URL; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFURL *URL; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param url The URL whose protocol is unsupported - * \return A new unsupported protocol exception - */ -+ newWithClass: (Class)class_ - URL: (OFURL*)url; - -/** - * Initializes an already allocated unsupported protocol exception - * - * \param class_ The class of the object which caused the exception - * \param url The URL whose protocol is unsupported - * \return An initialized unsupported protocol exception - */ -- initWithClass: (Class)class_ - URL: (OFURL*)url; - -/** - * \return The URL whose protocol is unsupported - */ -- (OFURL*)URL; -@end - -/** - * \brief An exception indicating that the server sent an invalid reply. - */ -@interface OFInvalidServerReplyException: OFException -@end - -/** - * \brief An exception indicating that a HTTP request failed. - */ -@interface OFHTTPRequestFailedException: OFException -{ - OFHTTPRequest *HTTPRequest; - short statusCode; -} - -#ifdef OF_HAVE_PROPERTIES -@property (readonly, nonatomic) OFHTTPRequest *HTTPRequest; -@property (readonly) short statusCode; -#endif - -/** - * \param class_ The class of the object which caused the exception - * \param request The HTTP request which failed - * \param code The status code of the fialed HTTP request - * \return A new HTTP request failed exception - */ -+ newWithClass: (Class)class_ - HTTPRequest: (OFHTTPRequest*)request - statusCode: (short)code; - -/** - * Initializes an already allocated HTTP request failed exception - * - * \param class_ The class of the object which caused the exception - * \param request The HTTP request which failed - * \param code The status code of the fialed HTTP request - * \return A new HTTP request failed exception - */ -- initWithClass: (Class)class_ - HTTPRequest: (OFHTTPRequest*)request - statusCode: (short)code; - -/** - * \return The HTTP request which failed - */ -- (OFHTTPRequest*)HTTPRequest; - -/** - * \return The status code of the HTTP request - */ -- (short)statusCode; -@end - -/** - * \brief An exception indicating that data was truncated while it should not - * have been truncated. - */ -@interface OFTruncatedDataException: OFException -@end +#import "OFAllocFailedException.h" +#import "OFException.h" +#import "OFAcceptFailedException.h" +#import "OFAddressTranslationFailedException.h" +#import "OFAlreadyConnectedException.h" +#import "OFBindFailedException.h" +#import "OFChangeDirectoryFailedException.h" +#import "OFChangeFileModeFailedException.h" +#import "OFChangeFileOwnerFailedException.h" +#import "OFConditionBroadcastFailedException.h" +#import "OFConditionSignalFailedException.h" +#import "OFConditionWaitFailedException.h" +#import "OFConditionWaitingException.h" +#import "OFConnectionFailedException.h" +#import "OFCopyFileFailedException.h" +#import "OFCreateDirectoryFailedException.h" +#import "OFDeleteDirectoryFailedException.h" +#import "OFDeleteFileFailedException.h" +#import "OFEnumerationMutationException.h" +#import "OFHashAlreadyCalculatedException.h" +#import "OFHTTPRequestFailedException.h" +#import "OFInitializationFailedException.h" +#import "OFInvalidArgumentException.h" +#import "OFInvalidEncodingException.h" +#import "OFInvalidFormatException.h" +#import "OFInvalidServerReplyException.h" +#import "OFLinkFailedException.h" +#import "OFListenFailedException.h" +#import "OFMalformedXMLException.h" +#import "OFMemoryNotPartOfObjectException.h" +#import "OFMutexLockedException.h" +#import "OFMutexLockFailedException.h" +#import "OFMutexUnlockFailedException.h" +#import "OFNotConnectedException.h" +#import "OFNotImplementedException.h" +#import "OFOpenFileFailedException.h" +#import "OFOutOfMemoryException.h" +#import "OFOutOfRangeException.h" +#import "OFReadFailedException.h" +#import "OFReadOrWriteFailedException.h" +#import "OFRenameFileFailedException.h" +#import "OFSeekFailedException.h" +#import "OFSetOptionFailedException.h" +#import "OFSymlinkFailedException.h" +#import "OFThreadJoinFailedException.h" +#import "OFThreadStartFailedException.h" +#import "OFThreadStillRunningException.h" +#import "OFTruncatedDataException.h" +#import "OFUnboundNamespaceException.h" +#import "OFUnsupportedProtocolException.h" +#import "OFWriteFailedException.h" DELETED src/OFExceptions.m Index: src/OFExceptions.m ================================================================== --- src/OFExceptions.m +++ src/OFExceptions.m @@ -1,2045 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 2010, 2011 - * Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#include "config.h" - -#define _GNU_SOURCE -#include -#include -#include - -#if defined(OF_APPLE_RUNTIME) || defined(OF_GNU_RUNTIME) -# import -#endif - -#ifdef OF_OLD_GNU_RUNTIME -# import -# define sel_getName(x) sel_get_name(x) -#endif - -#import "OFExceptions.h" -#import "OFString.h" -#import "OFTCPSocket.h" -#import "OFHTTPRequest.h" -#import "OFAutoreleasePool.h" - -#ifndef _WIN32 -# include -# define GET_ERRNO errno -# ifndef HAVE_THREADSAFE_GETADDRINFO -# define GET_AT_ERRNO h_errno -# else -# define GET_AT_ERRNO errno -# endif -# define GET_SOCK_ERRNO errno -# define ERRFMT "Error string was: %s" -# define ERRPARAM strerror(errNo) -# if !defined(HAVE_THREADSAFE_GETADDRINFO) && !defined(_PSP) -# define AT_ERRPARAM hstrerror(errNo) -# else -# define AT_ERRPARAM strerror(errNo) -# endif -#else -# include -# define GET_ERRNO GetLastError() -# define GET_AT_ERRNO WSAGetLastError() -# define GET_SOCK_ERRNO WSAGetLastError() -# define ERRFMT "Error code was: %d" -# define ERRPARAM errNo -# define AT_ERRPARAM errNo -#endif - -#import "asprintf.h" - -@implementation OFAllocFailedException -+ alloc -{ - @throw [OFNotImplementedException newWithClass: self - selector: _cmd]; -} - -- init -{ - @throw [OFNotImplementedException newWithClass: isa - selector: _cmd]; -} - -- (void)addMemoryToPool: (void*)ptr -{ - @throw [OFNotImplementedException newWithClass: isa - selector: _cmd]; -} - -- (void*)allocMemoryWithSize: (size_t)size -{ - @throw [OFNotImplementedException newWithClass: isa - selector: _cmd]; -} - -- (void*)allocMemoryForNItems: (size_t)nitems - withSize: (size_t)size -{ - @throw [OFNotImplementedException newWithClass: isa - selector: _cmd]; -} - -- (void*)resizeMemory: (void*)ptr - toSize: (size_t)size -{ - @throw [OFNotImplementedException newWithClass: isa - selector: _cmd]; -} - -- (void*)resizeMemory: (void*)ptr - toNItems: (size_t)nitems - withSize: (size_t)size -{ - @throw [OFNotImplementedException newWithClass: isa - selector: _cmd]; -} - -- (void)freeMemory: (void*)ptr -{ - @throw [OFNotImplementedException newWithClass: isa - selector: _cmd]; -} - -- retain -{ - return self; -} - -- autorelease -{ - return self; -} - -- (unsigned int)retainCount -{ - return OF_RETAIN_COUNT_MAX; -} - -- (void)release -{ -} - -- (void)dealloc -{ - @throw [OFNotImplementedException newWithClass: isa - selector: _cmd]; - [super dealloc]; /* Get rid of a stupid warning */ -} - -- (OFString*)description -{ - return @"Allocating an object failed!"; -} -@end - -@implementation OFException -+ newWithClass: (Class)class_ -{ - return [[self alloc] initWithClass: class_]; -} - -- init -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ -{ - self = [super init]; - - inClass = class_; - - return self; -} - -- (void)dealloc -{ - [description release]; - - [super dealloc]; -} - -- (Class)inClass -{ - return inClass; -} - -- (OFString*)description -{ - return @"An exception occurred"; -} - -- autorelease -{ - @throw [OFNotImplementedException newWithClass: isa - selector: _cmd]; -} -@end - -@implementation OFOutOfMemoryException -+ newWithClass: (Class)class_ - requestedSize: (size_t)size -{ - return [[self alloc] initWithClass: class_ - requestedSize: size]; -} - -- initWithClass: (Class)class_ - requestedSize: (size_t)size -{ - self = [super initWithClass: class_]; - - requestedSize = size; - - return self; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - if (requestedSize) - description = [[OFString alloc] initWithFormat: - @"Could not allocate %zu bytes in class %@!", requestedSize, - inClass]; - else - description = [[OFString alloc] initWithFormat: - @"Could not allocate enough memory in class %@!", inClass]; - - return description; -} - -- (size_t)requestedSize -{ - return requestedSize; -} -@end - -@implementation OFEnumerationMutationException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Object of class %@ was mutated during enumeration!", inClass]; - - return description; -} -@end - -@implementation OFMemoryNotPartOfObjectException -+ newWithClass: (Class)class_ - pointer: (void*)ptr -{ - return [[self alloc] initWithClass: class_ - pointer: ptr]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - pointer: (void*)ptr -{ - self = [super initWithClass: class_]; - - pointer = ptr; - - return self; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Memory at %p was not allocated as part of object of class %@, " - @"thus the memory allocation was not changed! It is also possible " - @"that there was an attempt to free the same memory twice.", - pointer, inClass]; - - return description; -} - -- (void*)pointer -{ - return pointer; -} -@end - -@implementation OFNotImplementedException -+ newWithClass: (Class)class_ - selector: (SEL)selector -{ - return [[self alloc] initWithClass: class_ - selector: selector]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - selector: (SEL)selector_ -{ - self = [super initWithClass: class_]; - - selector = selector_; - - return self; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"The method %s of class %@ is not or not fully implemented!", - sel_getName(selector), inClass]; - - return description; -} - -- (SEL)selector -{ - return selector; -} -@end - -@implementation OFOutOfRangeException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Value out of range in class %@!", inClass]; - - return description; -} -@end - -@implementation OFInvalidArgumentException -+ newWithClass: (Class)class_ - selector: (SEL)selector_ -{ - return [[self alloc] initWithClass: class_ - selector: selector_]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - selector: (SEL)selector_ -{ - self = [super initWithClass: class_]; - - selector = selector_; - - return self; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"The argument for method %s of class %@ is invalid!", - sel_getName(selector), inClass]; - - return description; -} - -- (SEL)selector -{ - return selector; -} -@end - -@implementation OFInvalidEncodingException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"The encoding is invalid for class %@!", inClass]; - - return description; -} -@end - -@implementation OFInvalidFormatException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"The format is invalid for class %@!", inClass]; - - return description; -} -@end - -@implementation OFMalformedXMLException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"The parser in class %@ encountered malformed XML!", inClass]; - - return description; -} -@end - -@implementation OFInitializationFailedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Initialization failed for or in class %@!", inClass]; - - return description; -} -@end - -@implementation OFOpenFileFailedException -+ newWithClass: (Class)class_ - path: (OFString*)path - mode: (OFString*)mode -{ - return [(OFOpenFileFailedException*)[self alloc] initWithClass: class_ - path: path - mode: mode]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - path: (OFString*)path_ - mode: (OFString*)mode_ -{ - self = [super initWithClass: class_]; - - @try { - path = [path_ copy]; - mode = [mode_ copy]; - errNo = GET_ERRNO; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [path release]; - [mode release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to open file %@ with mode %@ in class %@! " ERRFMT, path, - mode, inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)path -{ - return path; -} - -- (OFString*)mode -{ - return mode; -} -@end - -@implementation OFReadOrWriteFailedException -+ newWithClass: (Class)class_ - requestedSize: (size_t)size -{ - return [[self alloc] initWithClass: class_ - requestedSize: size]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - requestedSize: (size_t)size -{ - self = [super initWithClass: class_]; - - requestedSize = size; - - if ([class_ isSubclassOfClass: [OFStreamSocket class]]) - errNo = GET_SOCK_ERRNO; - else - errNo = GET_ERRNO; - - return self; -} - -- (int)errNo -{ - return errNo; -} - -- (size_t)requestedSize -{ - return requestedSize; -} -@end - -@implementation OFReadFailedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to read %zu bytes in class %@! " ERRFMT, requestedSize, - inClass, ERRPARAM]; - - return description; -} -@end - -@implementation OFWriteFailedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to write %zu bytes in class %@! " ERRFMT, requestedSize, - inClass, ERRPARAM]; - - return description; -} -@end - -@implementation OFSeekFailedException -- initWithClass: (Class)class_ -{ - self = [super initWithClass: class_]; - - errNo = GET_ERRNO; - - return self; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Seeking failed in class %@! " ERRFMT, inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} -@end - -@implementation OFCreateDirectoryFailedException -+ newWithClass: (Class)class_ - path: (OFString*)path_ -{ - return [[self alloc] initWithClass: class_ - path: path_]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - path: (OFString*)path_ -{ - self = [super initWithClass: class_]; - - @try { - path = [path_ copy]; - errNo = GET_ERRNO; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [path release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to create directory %@ in class %@! " ERRFMT, path, - inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)path -{ - return path; -} -@end - -@implementation OFChangeDirectoryFailedException -+ newWithClass: (Class)class_ - path: (OFString*)path_ -{ - return [[self alloc] initWithClass: class_ - path: path_]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - path: (OFString*)path_ -{ - self = [super initWithClass: class_]; - - @try { - path = [path_ copy]; - errNo = GET_ERRNO; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [path release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to change to directory %@ in class %@! " ERRFMT, path, - inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)path -{ - return path; -} -@end - -@implementation OFChangeFileModeFailedException -+ newWithClass: (Class)class_ - path: (OFString*)path - mode: (mode_t)mode -{ - return [(OFChangeFileModeFailedException*)[self alloc] - initWithClass: class_ - path: path - mode: mode]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - path: (OFString*)path_ - mode: (mode_t)mode_ -{ - self = [super initWithClass: class_]; - - @try { - path = [path_ copy]; - mode = mode_; - errNo = GET_ERRNO; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [path release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to change mode for file %@ to %d in class %@! " ERRFMT, - path, mode, inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)path -{ - return path; -} - -- (mode_t)mode -{ - return mode; -} -@end - -#ifndef _WIN32 -@implementation OFChangeFileOwnerFailedException -+ newWithClass: (Class)class_ - path: (OFString*)path - owner: (OFString*)owner - group: (OFString*)group -{ - return [[self alloc] initWithClass: class_ - path: path - owner: owner - group: group]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - path: (OFString*)path_ - owner: (OFString*)owner_ - group: (OFString*)group_ -{ - self = [super initWithClass: class_]; - - @try { - path = [path_ copy]; - owner = [owner_ copy]; - group = [group_ copy]; - errNo = GET_ERRNO; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [path release]; - [owner release]; - [group release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - if (group == nil) - description = [[OFString alloc] initWithFormat: - @"Failed to change owner for file %@ to %@ in class %@! " - ERRFMT, path, owner, inClass, ERRPARAM]; - else if (owner == nil) - description = [[OFString alloc] initWithFormat: - @"Failed to change group for file %@ to %@ in class %@! " - ERRFMT, path, group, inClass, ERRPARAM]; - else - description = [[OFString alloc] initWithFormat: - @"Failed to change owner for file %@ to %@:%@ in class %@! " - ERRFMT, path, owner, group, inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)path -{ - return path; -} - -- (OFString*)owner -{ - return owner; -} - -- (OFString*)group -{ - return group; -} -@end -#endif - -@implementation OFCopyFileFailedException -+ newWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dst -{ - return [[self alloc] initWithClass: class_ - sourcePath: src - destinationPath: dst]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dst -{ - self = [super initWithClass: class_]; - - @try { - sourcePath = [src copy]; - destinationPath = [dst copy]; - errNo = GET_ERRNO; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [sourcePath release]; - [destinationPath release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to copy file %@ to %@ in class %@! " ERRFMT, - sourcePath, destinationPath, inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)sourcePath -{ - return sourcePath; -} - -- (OFString*)destinationPath; -{ - return destinationPath; -} -@end - -@implementation OFRenameFileFailedException -+ newWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dst -{ - return [[self alloc] initWithClass: class_ - sourcePath: src - destinationPath: dst]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dst -{ - self = [super initWithClass: class_]; - - @try { - sourcePath = [src copy]; - destinationPath = [dst copy]; - errNo = GET_ERRNO; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [sourcePath release]; - [destinationPath release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to rename file %@ to %@ in class %@! " ERRFMT, sourcePath, - destinationPath, inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)sourcePath -{ - return sourcePath; -} - -- (OFString*)destinationPath; -{ - return destinationPath; -} -@end - -@implementation OFDeleteFileFailedException -+ newWithClass: (Class)class_ - path: (OFString*)path_ -{ - return [[self alloc] initWithClass: class_ - path: path_]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - path: (OFString*)path_ -{ - self = [super initWithClass: class_]; - - @try { - path = [path_ copy]; - errNo = GET_ERRNO; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [path release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to delete file %@ in class %@! " ERRFMT, path, inClass, - ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)path -{ - return path; -} -@end - -@implementation OFDeleteDirectoryFailedException -+ newWithClass: (Class)class_ - path: (OFString*)path_ -{ - return [[self alloc] initWithClass: class_ - path: path_]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - path: (OFString*)path_ -{ - self = [super initWithClass: class_]; - - @try { - path = [path_ copy]; - errNo = GET_ERRNO; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [path release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to delete directory %@ in class %@! " ERRFMT, path, - inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)path -{ - return path; -} -@end - -#ifndef _WIN32 -@implementation OFLinkFailedException -+ newWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dest -{ - return [[self alloc] initWithClass: class_ - sourcePath: src - destinationPath: dest]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dest -{ - self = [super initWithClass: class_]; - - sourcePath = [src copy]; - destinationPath = [dest copy]; - errNo = GET_ERRNO; - - return self; -} - -- (void)dealloc -{ - [sourcePath release]; - [destinationPath release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to link file %@ to %@ in class %@! " ERRFMT, sourcePath, - destinationPath, inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)sourcePath -{ - return sourcePath; -} - -- (OFString*)destinationPath -{ - return destinationPath; -} -@end - -@implementation OFSymlinkFailedException -+ newWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dest -{ - return [[self alloc] initWithClass: class_ - sourcePath: src - destinationPath: dest]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - sourcePath: (OFString*)src - destinationPath: (OFString*)dest -{ - self = [super initWithClass: class_]; - - sourcePath = [src copy]; - destinationPath = [dest copy]; - errNo = GET_ERRNO; - - return self; -} - -- (void)dealloc -{ - [sourcePath release]; - [destinationPath release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to symlink file %@ to %@ in class %@! " ERRFMT, sourcePath, - destinationPath, inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)sourcePath -{ - return sourcePath; -} - -- (OFString*)destinationPath -{ - return destinationPath; -} -@end -#endif - -@implementation OFSetOptionFailedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Setting an option in class %@ failed!", inClass]; - - return description; -} -@end - -@implementation OFNotConnectedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"The socket of type %@ is not connected or bound!", inClass]; - - return description; -} -@end - -@implementation OFAlreadyConnectedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"The socket of type %@ is already connected or bound and thus " - @"can't be connected or bound again!", inClass]; - - return description; -} -@end - -@implementation OFAddressTranslationFailedException -+ newWithClass: (Class)class_ - host: (OFString*)host -{ - return [[self alloc] initWithClass: class_ - host: host]; -} - -- initWithClass: (Class)class_ -{ - self = [super initWithClass: class_]; - - errNo = GET_AT_ERRNO; - - return self; -} - -- initWithClass: (Class)class_ - host: (OFString*)host_ -{ - self = [super initWithClass: class_]; - - @try { - host = [host_ copy]; - errNo = GET_AT_ERRNO; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [host release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - if (host != nil) - description = [[OFString alloc] initWithFormat: - @"The host %@ could not be translated to an address in " - @"class %@. This means that either the host was not found, " - @"there was a problem with the name server, there was a " - @"problem with your network connection or you specified an " - @"invalid host. " ERRFMT, host, inClass, AT_ERRPARAM]; - else - description = [[OFString alloc] initWithFormat: - @"An address translation failed in class %@! " ERRFMT, - inClass, AT_ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)host -{ - return host; -} -@end - -@implementation OFConnectionFailedException -+ newWithClass: (Class)class_ - host: (OFString*)host - port: (uint16_t)port -{ - return [[self alloc] initWithClass: class_ - host: host - port: port]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - host: (OFString*)host_ - port: (uint16_t)port_ -{ - self = [super initWithClass: class_]; - - @try { - host = [host_ copy]; - port = port_; - errNo = GET_SOCK_ERRNO; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [host release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"A connection to %@ on port %" @PRIu16 @"could not be established " - @"in class %@! " ERRFMT, host, port, inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)host -{ - return host; -} - -- (uint16_t)port -{ - return port; -} -@end - -@implementation OFBindFailedException -+ newWithClass: (Class)class_ - host: (OFString*)host - port: (uint16_t)port -{ - return [[self alloc] initWithClass: class_ - host: host - port: port]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - host: (OFString*)host_ - port: (uint16_t)port_ -{ - self = [super initWithClass: class_]; - - @try { - host = [host_ copy]; - port = port_; - errNo = GET_SOCK_ERRNO; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [host release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Binding to port %" @PRIu16 @" on host %@ failed in class %@! " - ERRFMT, port, host, inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (OFString*)host -{ - return host; -} - -- (uint16_t)port -{ - return port; -} -@end - -@implementation OFListenFailedException -+ newWithClass: (Class)class_ - backLog: (int)backlog -{ - return [[self alloc] initWithClass: class_ - backLog: backlog]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - backLog: (int)backlog -{ - self = [super initWithClass: class_]; - - backLog = backlog; - errNo = GET_SOCK_ERRNO; - - return self; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to listen in socket of type %@ with a back log of %d! " - ERRFMT, inClass, backLog, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} - -- (int)backLog -{ - return backLog; -} -@end - -@implementation OFAcceptFailedException -- initWithClass: (Class)class_ -{ - self = [super initWithClass: class_]; - - errNo = GET_SOCK_ERRNO; - - return self; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Failed to accept connection in socket of type %@! " ERRFMT, - inClass, ERRPARAM]; - - return description; -} - -- (int)errNo -{ - return errNo; -} -@end - -@implementation OFThreadStartFailedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Starting a thread of class %@ failed!", inClass]; - - return description; -} -@end - -@implementation OFThreadJoinFailedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Joining a thread of class %@ failed! Most likely, another thread " - @"already waits for the thread to join.", inClass]; - - return description; -} -@end - -@implementation OFThreadStillRunningException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Deallocation of a thread of type %@ was tried, even though it " - @"was still running!", inClass]; - - return description; -} -@end - -@implementation OFMutexLockFailedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"A mutex of class %@ could not be locked!", inClass]; - - return description; -} -@end - -@implementation OFMutexUnlockFailedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"A mutex of class %@ could not be unlocked!", inClass]; - - return description; -} -@end - -@implementation OFMutexLockedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Deallocation of a mutex of type %@ was tried, even though it " - @"was still locked!", inClass]; - - return description; -} -@end - -@implementation OFConditionWaitFailedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Waiting for a condition of type %@ failed!", inClass]; - - return description; -} -@end - -@implementation OFConditionSignalFailedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Signaling a condition of type %@ failed!", inClass]; - - return description; -} -@end - -@implementation OFConditionBroadcastFailedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Broadcasting a condition of type %@ failed!", inClass]; - - return description; -} -@end - -@implementation OFConditionWaitingException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Deallocation of a condition of type %@ was tried, even though a " - @"thread was still waiting for it!", inClass]; - - return description; -} -@end - -@implementation OFHashAlreadyCalculatedException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"The hash has already been calculated in class %@ and thus no new " - @"data can be added", inClass]; - - return description; -} -@end - -@implementation OFUnboundNamespaceException -+ newWithClass: (Class)class_ - namespace: (OFString*)ns -{ - return [[self alloc] initWithClass: class_ - namespace: ns]; -} - -+ newWithClass: (Class)class_ - prefix: (OFString*)prefix -{ - return [[self alloc] initWithClass: class_ - prefix: prefix]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - namespace: (OFString*)ns_ -{ - self = [super initWithClass: class_]; - - @try { - ns = [ns_ copy]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- initWithClass: (Class)class_ - prefix: (OFString*)prefix_ -{ - self = [super initWithClass: class_]; - - @try { - prefix = [prefix_ copy]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [ns release]; - [prefix release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - if (ns != nil) - description = [[OFString alloc] initWithFormat: - @"The namespace %@ is not bound in class %@", ns, inClass]; - else if (prefix != nil) - description = [[OFString alloc] initWithFormat: - @"The prefix %@ is not bound to any namespace in class %@", - prefix, inClass]; - - return description; -} - -- (OFString*)namespace -{ - return ns; -} - -- (OFString*)prefix -{ - return prefix; -} -@end - -@implementation OFUnsupportedProtocolException -+ newWithClass: (Class)class_ - URL: (OFURL*)url -{ - return [[self alloc] initWithClass: class_ - URL: url]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - URL: (OFURL*)url -{ - self = [super initWithClass: class_]; - - @try { - URL = [url copy]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [URL release]; - - [super dealloc]; -} - -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"The protocol of URL %@ is not supported by class %@", URL, - inClass]; - - return description; -} - -- (OFURL*)URL -{ - return URL; -} -@end - -@implementation OFInvalidServerReplyException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Got an invalid reply from the server in class %@", inClass]; - - return description; -} -@end - -@implementation OFHTTPRequestFailedException -+ newWithClass: (Class)class_ - HTTPRequest: (OFHTTPRequest*)request - statusCode: (short)code -{ - return [[self alloc] initWithClass: class_ - HTTPRequest: request - statusCode: code]; -} - -- initWithClass: (Class)class_ -{ - Class c = isa; - [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; -} - -- initWithClass: (Class)class_ - HTTPRequest: (OFHTTPRequest*)request - statusCode: (short)code -{ - self = [super initWithClass: class_]; - - @try { - HTTPRequest = [request retain]; - statusCode = code; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [HTTPRequest release]; - - [super dealloc]; -} - -- (OFString*)description -{ - OFAutoreleasePool *pool; - const char *type = "(unknown)"; - - if (description != nil) - return description; - - switch ([HTTPRequest requestType]) { - case OF_HTTP_REQUEST_TYPE_GET: - type = "GET"; - break; - case OF_HTTP_REQUEST_TYPE_HEAD: - type = "HEAD"; - break; - case OF_HTTP_REQUEST_TYPE_POST: - type = "POST"; - break; - } - - pool = [[OFAutoreleasePool alloc] init]; - - description = [[OFString alloc] initWithFormat: - @"A HTTP %s request in class %@ with URL %@ failed with code %d", - type, inClass, [HTTPRequest URL], statusCode]; - - [pool release]; - - return description; -} - -- (OFHTTPRequest*)HTTPRequest -{ - return HTTPRequest; -} - -- (short)statusCode -{ - return statusCode; -} -@end - -@implementation OFTruncatedDataException -- (OFString*)description -{ - if (description != nil) - return description; - - description = [[OFString alloc] initWithFormat: - @"Truncated data was received or produced in class %@ while it " - @"should not have been truncated!", inClass]; - - return description; -} -@end ADDED src/exceptions/Makefile Index: src/exceptions/Makefile ================================================================== --- src/exceptions/Makefile +++ src/exceptions/Makefile @@ -0,0 +1,63 @@ +include ../../extra.mk + +STATIC_PIC_LIB_NOINST = ${EXCEPTIONS_LIB_A} +STATIC_LIB_NOINST = ${EXCEPTIONS_A} + +SRCS = OFAcceptFailedException.m \ + OFAddressTranslationFailedException.m \ + OFAllocFailedException.m \ + OFAlreadyConnectedException.m \ + OFBindFailedException.m \ + OFChangeDirectoryFailedException.m \ + OFChangeFileModeFailedException.m \ + OFChangeFileOwnerFailedException.m \ + OFConditionBroadcastFailedException.m \ + OFConditionSignalFailedException.m \ + OFConditionWaitFailedException.m \ + OFConditionWaitingException.m \ + OFConnectionFailedException.m \ + OFCopyFileFailedException.m \ + OFCreateDirectoryFailedException.m \ + OFDeleteDirectoryFailedException.m \ + OFDeleteFileFailedException.m \ + OFEnumerationMutationException.m \ + OFException.m \ + OFHTTPRequestFailedException.m \ + OFHashAlreadyCalculatedException.m \ + OFInitializationFailedException.m \ + OFInvalidArgumentException.m \ + OFInvalidEncodingException.m \ + OFInvalidFormatException.m \ + OFInvalidServerReplyException.m \ + OFLinkFailedException.m \ + OFListenFailedException.m \ + OFMalformedXMLException.m \ + OFMemoryNotPartOfObjectException.m \ + OFMutexLockFailedException.m \ + OFMutexLockedException.m \ + OFMutexUnlockFailedException.m \ + OFNotConnectedException.m \ + OFNotImplementedException.m \ + OFOpenFileFailedException.m \ + OFOutOfMemoryException.m \ + OFOutOfRangeException.m \ + OFReadFailedException.m \ + OFReadOrWriteFailedException.m \ + OFRenameFileFailedException.m \ + OFSeekFailedException.m \ + OFSetOptionFailedException.m \ + OFSymlinkFailedException.m \ + OFThreadJoinFailedException.m \ + OFThreadStartFailedException.m \ + OFThreadStillRunningException.m \ + OFTruncatedDataException.m \ + OFUnboundNamespaceException.m \ + OFUnsupportedProtocolException.m \ + OFWriteFailedException.m + +INCLUDES = ${SRCS:.m=.h} + +include ../../buildsys.mk + +CPPFLAGS += -I. -I.. -I../.. +LD = ${OBJC} ADDED src/exceptions/OFAcceptFailedException.h Index: src/exceptions/OFAcceptFailedException.h ================================================================== --- src/exceptions/OFAcceptFailedException.h +++ src/exceptions/OFAcceptFailedException.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that accepting a connection failed. + */ +@interface OFAcceptFailedException: OFException +{ + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly) int errNo; +#endif + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; +@end ADDED src/exceptions/OFAcceptFailedException.m Index: src/exceptions/OFAcceptFailedException.m ================================================================== --- src/exceptions/OFAcceptFailedException.m +++ src/exceptions/OFAcceptFailedException.m @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFAcceptFailedException.h" +#import "OFString.h" + +#import "common.h" + +@implementation OFAcceptFailedException +- initWithClass: (Class)class_ +{ + self = [super initWithClass: class_]; + + errNo = GET_SOCK_ERRNO; + + return self; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to accept connection in socket of type %@! " ERRFMT, + inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} +@end ADDED src/exceptions/OFAddressTranslationFailedException.h Index: src/exceptions/OFAddressTranslationFailedException.h ================================================================== --- src/exceptions/OFAddressTranslationFailedException.h +++ src/exceptions/OFAddressTranslationFailedException.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating the translation of an address failed. + */ +@interface OFAddressTranslationFailedException: OFException +{ + OFString *host; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *host; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param host The host for which translation was requested + * \return A new address translation failed exception + */ ++ newWithClass: (Class)class_ + host: (OFString*)host; + +/** + * Initializes an already allocated address translation failed exception. + * + * \param class_ The class of the object which caused the exception + * \param host The host for which translation was requested + * \return An initialized address translation failed exception + */ +- initWithClass: (Class)class_ + host: (OFString*)host; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * /return The host for which translation was requested + */ +- (OFString*)host; +@end ADDED src/exceptions/OFAddressTranslationFailedException.m Index: src/exceptions/OFAddressTranslationFailedException.m ================================================================== --- src/exceptions/OFAddressTranslationFailedException.m +++ src/exceptions/OFAddressTranslationFailedException.m @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFAddressTranslationFailedException.h" +#import "OFString.h" + +#import "common.h" + +@implementation OFAddressTranslationFailedException ++ newWithClass: (Class)class_ + host: (OFString*)host +{ + return [[self alloc] initWithClass: class_ + host: host]; +} + +- initWithClass: (Class)class_ +{ + self = [super initWithClass: class_]; + + errNo = GET_AT_ERRNO; + + return self; +} + +- initWithClass: (Class)class_ + host: (OFString*)host_ +{ + self = [super initWithClass: class_]; + + @try { + host = [host_ copy]; + errNo = GET_AT_ERRNO; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [host release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + if (host != nil) + description = [[OFString alloc] initWithFormat: + @"The host %@ could not be translated to an address in " + @"class %@. This means that either the host was not found, " + @"there was a problem with the name server, there was a " + @"problem with your network connection or you specified an " + @"invalid host. " ERRFMT, host, inClass, AT_ERRPARAM]; + else + description = [[OFString alloc] initWithFormat: + @"An address translation failed in class %@! " ERRFMT, + inClass, AT_ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)host +{ + return host; +} +@end ADDED src/exceptions/OFAllocFailedException.h Index: src/exceptions/OFAllocFailedException.h ================================================================== --- src/exceptions/OFAllocFailedException.h +++ src/exceptions/OFAllocFailedException.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFObject.h" + +@class OFString; + +/** + * \brief An exception indicating an object could not be allocated. + * + * This exception is preallocated, as if there's no memory, no exception can + * be allocated of course. That's why you shouldn't and even can't deallocate + * it. + * + * This is the only exception that is not an OFException as it's special. + * It does not know for which class allocation failed and it should not be + * handled like other exceptions, as the exception handling code is not + * allowed to allocate ANY memory. + */ +@interface OFAllocFailedException: OFObject +/** + * \return A description of the exception + */ +- (OFString*)description; +@end ADDED src/exceptions/OFAllocFailedException.m Index: src/exceptions/OFAllocFailedException.m ================================================================== --- src/exceptions/OFAllocFailedException.m +++ src/exceptions/OFAllocFailedException.m @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFAllocFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +@implementation OFAllocFailedException ++ alloc +{ + @throw [OFNotImplementedException newWithClass: self + selector: _cmd]; +} + +- init +{ + @throw [OFNotImplementedException newWithClass: isa + selector: _cmd]; +} + +- (void)addMemoryToPool: (void*)ptr +{ + @throw [OFNotImplementedException newWithClass: isa + selector: _cmd]; +} + +- (void*)allocMemoryWithSize: (size_t)size +{ + @throw [OFNotImplementedException newWithClass: isa + selector: _cmd]; +} + +- (void*)allocMemoryForNItems: (size_t)nitems + withSize: (size_t)size +{ + @throw [OFNotImplementedException newWithClass: isa + selector: _cmd]; +} + +- (void*)resizeMemory: (void*)ptr + toSize: (size_t)size +{ + @throw [OFNotImplementedException newWithClass: isa + selector: _cmd]; +} + +- (void*)resizeMemory: (void*)ptr + toNItems: (size_t)nitems + withSize: (size_t)size +{ + @throw [OFNotImplementedException newWithClass: isa + selector: _cmd]; +} + +- (void)freeMemory: (void*)ptr +{ + @throw [OFNotImplementedException newWithClass: isa + selector: _cmd]; +} + +- retain +{ + return self; +} + +- autorelease +{ + return self; +} + +- (unsigned int)retainCount +{ + return OF_RETAIN_COUNT_MAX; +} + +- (void)release +{ +} + +- (void)dealloc +{ + @throw [OFNotImplementedException newWithClass: isa + selector: _cmd]; + [super dealloc]; /* Get rid of a stupid warning */ +} + +- (OFString*)description +{ + return @"Allocating an object failed!"; +} +@end ADDED src/exceptions/OFAlreadyConnectedException.h Index: src/exceptions/OFAlreadyConnectedException.h ================================================================== --- src/exceptions/OFAlreadyConnectedException.h +++ src/exceptions/OFAlreadyConnectedException.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating an attempt to connect or bind an already + * connected or bound socket. + */ +@interface OFAlreadyConnectedException: OFException +@end ADDED src/exceptions/OFAlreadyConnectedException.m Index: src/exceptions/OFAlreadyConnectedException.m ================================================================== --- src/exceptions/OFAlreadyConnectedException.m +++ src/exceptions/OFAlreadyConnectedException.m @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFAlreadyConnectedException.h" +#import "OFString.h" + +@implementation OFAlreadyConnectedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"The socket of type %@ is already connected or bound and thus " + @"can't be connected or bound again!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFBindFailedException.h Index: src/exceptions/OFBindFailedException.h ================================================================== --- src/exceptions/OFBindFailedException.h +++ src/exceptions/OFBindFailedException.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that binding a socket failed. + */ +@interface OFBindFailedException: OFException +{ + OFString *host; + uint16_t port; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *host; +@property (readonly) uint16_t port; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param host The host on which binding failed + * \param port The port on which binding failed + * \return A new bind failed exception + */ ++ newWithClass: (Class)class_ + host: (OFString*)host + port: (uint16_t)port; + +/** + * Initializes an already allocated bind failed exception. + * + * \param class_ The class of the object which caused the exception + * \param host The host on which binding failed + * \param port The port on which binding failed + * \return An initialized bind failed exception + */ +- initWithClass: (Class)class_ + host: (OFString*)host + port: (uint16_t)port; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return The host on which binding failed + */ +- (OFString*)host; + +/** + * \return The port on which binding failed + */ +- (uint16_t)port; +@end ADDED src/exceptions/OFBindFailedException.m Index: src/exceptions/OFBindFailedException.m ================================================================== --- src/exceptions/OFBindFailedException.m +++ src/exceptions/OFBindFailedException.m @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFBindFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +@implementation OFBindFailedException ++ newWithClass: (Class)class_ + host: (OFString*)host + port: (uint16_t)port +{ + return [[self alloc] initWithClass: class_ + host: host + port: port]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + host: (OFString*)host_ + port: (uint16_t)port_ +{ + self = [super initWithClass: class_]; + + @try { + host = [host_ copy]; + port = port_; + errNo = GET_SOCK_ERRNO; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [host release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Binding to port %" @PRIu16 @" on host %@ failed in class %@! " + ERRFMT, port, host, inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)host +{ + return host; +} + +- (uint16_t)port +{ + return port; +} +@end ADDED src/exceptions/OFChangeDirectoryFailedException.h Index: src/exceptions/OFChangeDirectoryFailedException.h ================================================================== --- src/exceptions/OFChangeDirectoryFailedException.h +++ src/exceptions/OFChangeDirectoryFailedException.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating changing to a directory failed + */ +@interface OFChangeDirectoryFailedException: OFException +{ + OFString *path; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *path; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param path A string with the path of the directory to which couldn't be + * changed + * \return A new change directory failed exception + */ ++ newWithClass: (Class)class_ + path: (OFString*)path; + +/** + * Initializes an already allocated change directory failed exception. + * + * \param class_ The class of the object which caused the exception + * \param path A string with the path of the directory to which couldn't be + * changed + * \return An initialized change directory failed exception + */ +- initWithClass: (Class)class_ + path: (OFString*)path; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return A string with the path of the directory to which couldn't changed + */ +- (OFString*)path; +@end ADDED src/exceptions/OFChangeDirectoryFailedException.m Index: src/exceptions/OFChangeDirectoryFailedException.m ================================================================== --- src/exceptions/OFChangeDirectoryFailedException.m +++ src/exceptions/OFChangeDirectoryFailedException.m @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFChangeDirectoryFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +@implementation OFChangeDirectoryFailedException ++ newWithClass: (Class)class_ + path: (OFString*)path_ +{ + return [[self alloc] initWithClass: class_ + path: path_]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + path: (OFString*)path_ +{ + self = [super initWithClass: class_]; + + @try { + path = [path_ copy]; + errNo = GET_ERRNO; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [path release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to change to directory %@ in class %@! " ERRFMT, path, + inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)path +{ + return path; +} +@end ADDED src/exceptions/OFChangeFileModeFailedException.h Index: src/exceptions/OFChangeFileModeFailedException.h ================================================================== --- src/exceptions/OFChangeFileModeFailedException.h +++ src/exceptions/OFChangeFileModeFailedException.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include + +#import "OFException.h" + +/** + * \brief An exception indicating that changing the mode of a file failed. + */ +@interface OFChangeFileModeFailedException: OFException +{ + OFString *path; + mode_t mode; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *path; +@property (readonly) mode_t mode; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param path The path of the file + * \param mode The new mode for the file + * \return An initialized change file mode failed exception + */ ++ newWithClass: (Class)class_ + path: (OFString*)path + mode: (mode_t)mode; + +/** + * Initializes an already allocated change file mode failed exception. + * + * \param class_ The class of the object which caused the exception + * \param path The path of the file + * \param mode The new mode for the file + * \return An initialized change file mode failed exception + */ +- initWithClass: (Class)class_ + path: (OFString*)path + mode: (mode_t)mode; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return The path of the file + */ +- (OFString*)path; + +/** + * \return The new mode for the file + */ +- (mode_t)mode; +@end ADDED src/exceptions/OFChangeFileModeFailedException.m Index: src/exceptions/OFChangeFileModeFailedException.m ================================================================== --- src/exceptions/OFChangeFileModeFailedException.m +++ src/exceptions/OFChangeFileModeFailedException.m @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFExceptions.h" +#import "OFString.h" + +#import "common.h" + +@implementation OFChangeFileModeFailedException ++ newWithClass: (Class)class_ + path: (OFString*)path + mode: (mode_t)mode +{ + return [(OFChangeFileModeFailedException*)[self alloc] + initWithClass: class_ + path: path + mode: mode]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + path: (OFString*)path_ + mode: (mode_t)mode_ +{ + self = [super initWithClass: class_]; + + @try { + path = [path_ copy]; + mode = mode_; + errNo = GET_ERRNO; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [path release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to change mode for file %@ to %d in class %@! " ERRFMT, + path, mode, inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)path +{ + return path; +} + +- (mode_t)mode +{ + return mode; +} +@end ADDED src/exceptions/OFChangeFileOwnerFailedException.h Index: src/exceptions/OFChangeFileOwnerFailedException.h ================================================================== --- src/exceptions/OFChangeFileOwnerFailedException.h +++ src/exceptions/OFChangeFileOwnerFailedException.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +#ifndef _WIN32 +/** + * \brief An exception indicating that changing the owner of a file failed. + */ +@interface OFChangeFileOwnerFailedException: OFException +{ + OFString *path; + OFString *owner; + OFString *group; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *path; +@property (readonly, nonatomic) OFString *owner; +@property (readonly, nonatomic) OFString *group; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param path The path of the file + * \param owner The new owner for the file + * \param group The new group for the file + * \return An initialized change file owner failed exception + */ ++ newWithClass: (Class)class_ + path: (OFString*)path + owner: (OFString*)owner + group: (OFString*)group; + +/** + * Initializes an already allocated change file owner failed exception. + * + * \param class_ The class of the object which caused the exception + * \param path The path of the file + * \param owner The new owner for the file + * \param group The new group for the file + * \return An initialized change file owner failed exception + */ +- initWithClass: (Class)class_ + path: (OFString*)path + owner: (OFString*)owner + group: (OFString*)group; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return The path of the file + */ +- (OFString*)path; + +/** + * \return The new owner for the file + */ +- (OFString*)owner; + +/** + * \return The new group for the file + */ +- (OFString*)group; +@end +#endif ADDED src/exceptions/OFChangeFileOwnerFailedException.m Index: src/exceptions/OFChangeFileOwnerFailedException.m ================================================================== --- src/exceptions/OFChangeFileOwnerFailedException.m +++ src/exceptions/OFChangeFileOwnerFailedException.m @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFChangeFileOwnerFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +#ifndef _WIN32 +@implementation OFChangeFileOwnerFailedException ++ newWithClass: (Class)class_ + path: (OFString*)path + owner: (OFString*)owner + group: (OFString*)group +{ + return [[self alloc] initWithClass: class_ + path: path + owner: owner + group: group]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + path: (OFString*)path_ + owner: (OFString*)owner_ + group: (OFString*)group_ +{ + self = [super initWithClass: class_]; + + @try { + path = [path_ copy]; + owner = [owner_ copy]; + group = [group_ copy]; + errNo = GET_ERRNO; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [path release]; + [owner release]; + [group release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + if (group == nil) + description = [[OFString alloc] initWithFormat: + @"Failed to change owner for file %@ to %@ in class %@! " + ERRFMT, path, owner, inClass, ERRPARAM]; + else if (owner == nil) + description = [[OFString alloc] initWithFormat: + @"Failed to change group for file %@ to %@ in class %@! " + ERRFMT, path, group, inClass, ERRPARAM]; + else + description = [[OFString alloc] initWithFormat: + @"Failed to change owner for file %@ to %@:%@ in class %@! " + ERRFMT, path, owner, group, inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)path +{ + return path; +} + +- (OFString*)owner +{ + return owner; +} + +- (OFString*)group +{ + return group; +} +@end +#endif ADDED src/exceptions/OFConditionBroadcastFailedException.h Index: src/exceptions/OFConditionBroadcastFailedException.h ================================================================== --- src/exceptions/OFConditionBroadcastFailedException.h +++ src/exceptions/OFConditionBroadcastFailedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating broadcasting a condition failed. + */ +@interface OFConditionBroadcastFailedException: OFException +@end ADDED src/exceptions/OFConditionBroadcastFailedException.m Index: src/exceptions/OFConditionBroadcastFailedException.m ================================================================== --- src/exceptions/OFConditionBroadcastFailedException.m +++ src/exceptions/OFConditionBroadcastFailedException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFConditionBroadcastFailedException.h" +#import "OFString.h" + +@implementation OFConditionBroadcastFailedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Broadcasting a condition of type %@ failed!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFConditionSignalFailedException.h Index: src/exceptions/OFConditionSignalFailedException.h ================================================================== --- src/exceptions/OFConditionSignalFailedException.h +++ src/exceptions/OFConditionSignalFailedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating signalling a condition failed. + */ +@interface OFConditionSignalFailedException: OFException +@end ADDED src/exceptions/OFConditionSignalFailedException.m Index: src/exceptions/OFConditionSignalFailedException.m ================================================================== --- src/exceptions/OFConditionSignalFailedException.m +++ src/exceptions/OFConditionSignalFailedException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFConditionSignalFailedException.h" +#import "OFString.h" + +@implementation OFConditionSignalFailedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Signaling a condition of type %@ failed!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFConditionWaitFailedException.h Index: src/exceptions/OFConditionWaitFailedException.h ================================================================== --- src/exceptions/OFConditionWaitFailedException.h +++ src/exceptions/OFConditionWaitFailedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating waiting for a condition failed. + */ +@interface OFConditionWaitFailedException: OFException +@end ADDED src/exceptions/OFConditionWaitFailedException.m Index: src/exceptions/OFConditionWaitFailedException.m ================================================================== --- src/exceptions/OFConditionWaitFailedException.m +++ src/exceptions/OFConditionWaitFailedException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFConditionWaitFailedException.h" +#import "OFString.h" + +@implementation OFConditionWaitFailedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Waiting for a condition of type %@ failed!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFConditionWaitingException.h Index: src/exceptions/OFConditionWaitingException.h ================================================================== --- src/exceptions/OFConditionWaitingException.h +++ src/exceptions/OFConditionWaitingException.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that a thread is still waiting for a + * condition. + */ +@interface OFConditionWaitingException: OFException +@end ADDED src/exceptions/OFConditionWaitingException.m Index: src/exceptions/OFConditionWaitingException.m ================================================================== --- src/exceptions/OFConditionWaitingException.m +++ src/exceptions/OFConditionWaitingException.m @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFConditionWaitingException.h" +#import "OFString.h" + +@implementation OFConditionWaitingException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Deallocation of a condition of type %@ was tried, even though a " + @"thread was still waiting for it!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFConnectionFailedException.h Index: src/exceptions/OFConnectionFailedException.h ================================================================== --- src/exceptions/OFConnectionFailedException.h +++ src/exceptions/OFConnectionFailedException.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that a connection could not be established. + */ +@interface OFConnectionFailedException: OFException +{ + OFString *host; + uint16_t port; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *host; +@property (readonly) uint16_t port; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param host The host to which the connection failed + * \param port The port on the host to which the connection failed + * \return A new connection failed exception + */ ++ newWithClass: (Class)class_ + host: (OFString*)host + port: (uint16_t)port; + +/** + * Initializes an already allocated connection failed exception. + * + * \param class_ The class of the object which caused the exception + * \param host The host to which the connection failed + * \param port The port on the host to which the connection failed + * \return An initialized connection failed exception + */ +- initWithClass: (Class)class_ + host: (OFString*)host + port: (uint16_t)port; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return The host to which the connection failed + */ +- (OFString*)host; + +/** + * \return The port on the host to which the connection failed + */ +- (uint16_t)port; +@end ADDED src/exceptions/OFConnectionFailedException.m Index: src/exceptions/OFConnectionFailedException.m ================================================================== --- src/exceptions/OFConnectionFailedException.m +++ src/exceptions/OFConnectionFailedException.m @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFConnectionFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +@implementation OFConnectionFailedException ++ newWithClass: (Class)class_ + host: (OFString*)host + port: (uint16_t)port +{ + return [[self alloc] initWithClass: class_ + host: host + port: port]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + host: (OFString*)host_ + port: (uint16_t)port_ +{ + self = [super initWithClass: class_]; + + @try { + host = [host_ copy]; + port = port_; + errNo = GET_SOCK_ERRNO; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [host release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"A connection to %@ on port %" @PRIu16 @"could not be established " + @"in class %@! " ERRFMT, host, port, inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)host +{ + return host; +} + +- (uint16_t)port +{ + return port; +} +@end ADDED src/exceptions/OFCopyFileFailedException.h Index: src/exceptions/OFCopyFileFailedException.h ================================================================== --- src/exceptions/OFCopyFileFailedException.h +++ src/exceptions/OFCopyFileFailedException.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that copying a file failed. + */ +@interface OFCopyFileFailedException: OFException +{ + OFString *sourcePath; + OFString *destinationPath; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *sourcePath; +@property (readonly, nonatomic) OFString *destinationPath; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param src The original path + * \param dst The new path + * \return A new copy file failed exception + */ ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dst; + +/** + * Initializes an already allocated copy file failed exception. + * + * \param class_ The class of the object which caused the exception + * \param src The original path + * \param dst The new path + * \return An initialized copy file failed exception + */ +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dst; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return The path of the source file + */ +- (OFString*)sourcePath; + +/** + * \return The destination path + */ +- (OFString*)destinationPath; +@end ADDED src/exceptions/OFCopyFileFailedException.m Index: src/exceptions/OFCopyFileFailedException.m ================================================================== --- src/exceptions/OFCopyFileFailedException.m +++ src/exceptions/OFCopyFileFailedException.m @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFCopyFileFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +@implementation OFCopyFileFailedException ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dst +{ + return [[self alloc] initWithClass: class_ + sourcePath: src + destinationPath: dst]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dst +{ + self = [super initWithClass: class_]; + + @try { + sourcePath = [src copy]; + destinationPath = [dst copy]; + errNo = GET_ERRNO; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [sourcePath release]; + [destinationPath release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to copy file %@ to %@ in class %@! " ERRFMT, + sourcePath, destinationPath, inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)sourcePath +{ + return sourcePath; +} + +- (OFString*)destinationPath; +{ + return destinationPath; +} +@end ADDED src/exceptions/OFCreateDirectoryFailedException.h Index: src/exceptions/OFCreateDirectoryFailedException.h ================================================================== --- src/exceptions/OFCreateDirectoryFailedException.h +++ src/exceptions/OFCreateDirectoryFailedException.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating a directory couldn't be created. + */ +@interface OFCreateDirectoryFailedException: OFException +{ + OFString *path; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *path; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param path A string with the path of the directory which couldn't be created + * \return A new create directory failed exception + */ ++ newWithClass: (Class)class_ + path: (OFString*)path; + +/** + * Initializes an already allocated create directory failed exception. + * + * \param class_ The class of the object which caused the exception + * \param path A string with the path of the directory which couldn't be created + * \return An initialized create directory failed exception + */ +- initWithClass: (Class)class_ + path: (OFString*)path; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return A string with the path of the directory which couldn't be created + */ +- (OFString*)path; +@end ADDED src/exceptions/OFCreateDirectoryFailedException.m Index: src/exceptions/OFCreateDirectoryFailedException.m ================================================================== --- src/exceptions/OFCreateDirectoryFailedException.m +++ src/exceptions/OFCreateDirectoryFailedException.m @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFCreateDirectoryFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +@implementation OFCreateDirectoryFailedException ++ newWithClass: (Class)class_ + path: (OFString*)path_ +{ + return [[self alloc] initWithClass: class_ + path: path_]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + path: (OFString*)path_ +{ + self = [super initWithClass: class_]; + + @try { + path = [path_ copy]; + errNo = GET_ERRNO; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [path release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to create directory %@ in class %@! " ERRFMT, path, + inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)path +{ + return path; +} +@end ADDED src/exceptions/OFDeleteDirectoryFailedException.h Index: src/exceptions/OFDeleteDirectoryFailedException.h ================================================================== --- src/exceptions/OFDeleteDirectoryFailedException.h +++ src/exceptions/OFDeleteDirectoryFailedException.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that deleting a directory failed. + */ +@interface OFDeleteDirectoryFailedException: OFException +{ + OFString *path; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *path; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param path The path of the directory + * \return A new delete directory failed exception + */ ++ newWithClass: (Class)class_ + path: (OFString*)path; + +/** + * Initializes an already allocated delete directory failed exception. + * + * \param class_ The class of the object which caused the exception + * \param path The path of the directory + * \return An initialized delete directory failed exception + */ +- initWithClass: (Class)class_ + path: (OFString*)path; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return The path of the directory + */ +- (OFString*)path; +@end ADDED src/exceptions/OFDeleteDirectoryFailedException.m Index: src/exceptions/OFDeleteDirectoryFailedException.m ================================================================== --- src/exceptions/OFDeleteDirectoryFailedException.m +++ src/exceptions/OFDeleteDirectoryFailedException.m @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFDeleteDirectoryFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +@implementation OFDeleteDirectoryFailedException ++ newWithClass: (Class)class_ + path: (OFString*)path_ +{ + return [[self alloc] initWithClass: class_ + path: path_]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + path: (OFString*)path_ +{ + self = [super initWithClass: class_]; + + @try { + path = [path_ copy]; + errNo = GET_ERRNO; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [path release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to delete directory %@ in class %@! " ERRFMT, path, + inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)path +{ + return path; +} +@end ADDED src/exceptions/OFDeleteFileFailedException.h Index: src/exceptions/OFDeleteFileFailedException.h ================================================================== --- src/exceptions/OFDeleteFileFailedException.h +++ src/exceptions/OFDeleteFileFailedException.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that deleting a file failed. + */ +@interface OFDeleteFileFailedException: OFException +{ + OFString *path; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *path; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param path The path of the file + * \return A new delete file failed exception + */ ++ newWithClass: (Class)class_ + path: (OFString*)path; + +/** + * Initializes an already allocated delete file failed exception. + * + * \param class_ The class of the object which caused the exception + * \param path The path of the file + * \return An initialized delete file failed exception + */ +- initWithClass: (Class)class_ + path: (OFString*)path; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return The path of the file + */ +- (OFString*)path; +@end ADDED src/exceptions/OFDeleteFileFailedException.m Index: src/exceptions/OFDeleteFileFailedException.m ================================================================== --- src/exceptions/OFDeleteFileFailedException.m +++ src/exceptions/OFDeleteFileFailedException.m @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFDeleteFileFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +@implementation OFDeleteFileFailedException ++ newWithClass: (Class)class_ + path: (OFString*)path_ +{ + return [[self alloc] initWithClass: class_ + path: path_]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + path: (OFString*)path_ +{ + self = [super initWithClass: class_]; + + @try { + path = [path_ copy]; + errNo = GET_ERRNO; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [path release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to delete file %@ in class %@! " ERRFMT, path, inClass, + ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)path +{ + return path; +} +@end ADDED src/exceptions/OFEnumerationMutationException.h Index: src/exceptions/OFEnumerationMutationException.h ================================================================== --- src/exceptions/OFEnumerationMutationException.h +++ src/exceptions/OFEnumerationMutationException.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that a mutation was detected during + * enumeration. + */ +@interface OFEnumerationMutationException: OFException +@end ADDED src/exceptions/OFEnumerationMutationException.m Index: src/exceptions/OFEnumerationMutationException.m ================================================================== --- src/exceptions/OFEnumerationMutationException.m +++ src/exceptions/OFEnumerationMutationException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFEnumerationMutationException.h" +#import "OFString.h" + +@implementation OFEnumerationMutationException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Object of class %@ was mutated during enumeration!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFException.h Index: src/exceptions/OFException.h ================================================================== --- src/exceptions/OFException.h +++ src/exceptions/OFException.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFObject.h" + +@class OFString; + +/** + * \brief The base class for all exceptions in ObjFW + * + * The OFException class is the base class for all exceptions in ObjFW, except + * the OFAllocFailedException. + * + * IMPORTANT: Exceptions do NOT use OFAutoreleasePools and can't be autoreleased + * either! You have to make sure to dealloc the exception in your \@catch block! + */ +@interface OFException: OFObject +{ + Class inClass; + OFString *description; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) Class inClass; +#endif + +/** + * Creates a new exception. + * + * \param class_ The class of the object which caused the exception + * \return A new exception + */ ++ newWithClass: (Class)class_; + +/** + * Initializes an already allocated OFException. + * + * \param class_ The class of the object which caused the exception + * \return An initialized OFException + */ +- initWithClass: (Class)class_; + +/** + * \return The class of the object in which the exception happened + */ +- (Class)inClass; + +/** + * \return A description of the exception + */ +- (OFString*)description; +@end ADDED src/exceptions/OFException.m Index: src/exceptions/OFException.m ================================================================== --- src/exceptions/OFException.m +++ src/exceptions/OFException.m @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +@implementation OFException ++ newWithClass: (Class)class_ +{ + return [[self alloc] initWithClass: class_]; +} + +- init +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ +{ + self = [super init]; + + inClass = class_; + + return self; +} + +- (void)dealloc +{ + [description release]; + + [super dealloc]; +} + +- (Class)inClass +{ + return inClass; +} + +- (OFString*)description +{ + return @"An exception occurred"; +} + +- autorelease +{ + @throw [OFNotImplementedException newWithClass: isa + selector: _cmd]; +} +@end ADDED src/exceptions/OFHTTPRequestFailedException.h Index: src/exceptions/OFHTTPRequestFailedException.h ================================================================== --- src/exceptions/OFHTTPRequestFailedException.h +++ src/exceptions/OFHTTPRequestFailedException.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +@class OFHTTPRequest; + +/** + * \brief An exception indicating that a HTTP request failed. + */ +@interface OFHTTPRequestFailedException: OFException +{ + OFHTTPRequest *HTTPRequest; + short statusCode; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFHTTPRequest *HTTPRequest; +@property (readonly) short statusCode; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param request The HTTP request which failed + * \param code The status code of the fialed HTTP request + * \return A new HTTP request failed exception + */ ++ newWithClass: (Class)class_ + HTTPRequest: (OFHTTPRequest*)request + statusCode: (short)code; + +/** + * Initializes an already allocated HTTP request failed exception + * + * \param class_ The class of the object which caused the exception + * \param request The HTTP request which failed + * \param code The status code of the fialed HTTP request + * \return A new HTTP request failed exception + */ +- initWithClass: (Class)class_ + HTTPRequest: (OFHTTPRequest*)request + statusCode: (short)code; + +/** + * \return The HTTP request which failed + */ +- (OFHTTPRequest*)HTTPRequest; + +/** + * \return The status code of the HTTP request + */ +- (short)statusCode; +@end ADDED src/exceptions/OFHTTPRequestFailedException.m Index: src/exceptions/OFHTTPRequestFailedException.m ================================================================== --- src/exceptions/OFHTTPRequestFailedException.m +++ src/exceptions/OFHTTPRequestFailedException.m @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFHTTPRequestFailedException.h" +#import "OFString.h" +#import "OFHTTPRequest.h" +#import "OFAutoreleasePool.h" + +#import "OFNotImplementedException.h" + +@implementation OFHTTPRequestFailedException ++ newWithClass: (Class)class_ + HTTPRequest: (OFHTTPRequest*)request + statusCode: (short)code +{ + return [[self alloc] initWithClass: class_ + HTTPRequest: request + statusCode: code]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + HTTPRequest: (OFHTTPRequest*)request + statusCode: (short)code +{ + self = [super initWithClass: class_]; + + @try { + HTTPRequest = [request retain]; + statusCode = code; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [HTTPRequest release]; + + [super dealloc]; +} + +- (OFString*)description +{ + OFAutoreleasePool *pool; + const char *type = "(unknown)"; + + if (description != nil) + return description; + + switch ([HTTPRequest requestType]) { + case OF_HTTP_REQUEST_TYPE_GET: + type = "GET"; + break; + case OF_HTTP_REQUEST_TYPE_HEAD: + type = "HEAD"; + break; + case OF_HTTP_REQUEST_TYPE_POST: + type = "POST"; + break; + } + + pool = [[OFAutoreleasePool alloc] init]; + + description = [[OFString alloc] initWithFormat: + @"A HTTP %s request in class %@ with URL %@ failed with code %d", + type, inClass, [HTTPRequest URL], statusCode]; + + [pool release]; + + return description; +} + +- (OFHTTPRequest*)HTTPRequest +{ + return HTTPRequest; +} + +- (short)statusCode +{ + return statusCode; +} +@end ADDED src/exceptions/OFHashAlreadyCalculatedException.h Index: src/exceptions/OFHashAlreadyCalculatedException.h ================================================================== --- src/exceptions/OFHashAlreadyCalculatedException.h +++ src/exceptions/OFHashAlreadyCalculatedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that the hash has already been calculated. + */ +@interface OFHashAlreadyCalculatedException: OFException +@end ADDED src/exceptions/OFHashAlreadyCalculatedException.m Index: src/exceptions/OFHashAlreadyCalculatedException.m ================================================================== --- src/exceptions/OFHashAlreadyCalculatedException.m +++ src/exceptions/OFHashAlreadyCalculatedException.m @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFHashAlreadyCalculatedException.h" +#import "OFString.h" + +@implementation OFHashAlreadyCalculatedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"The hash has already been calculated in class %@ and thus no new " + @"data can be added", inClass]; + + return description; +} +@end ADDED src/exceptions/OFInitializationFailedException.h Index: src/exceptions/OFInitializationFailedException.h ================================================================== --- src/exceptions/OFInitializationFailedException.h +++ src/exceptions/OFInitializationFailedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that initializing something failed. + */ +@interface OFInitializationFailedException: OFException +@end ADDED src/exceptions/OFInitializationFailedException.m Index: src/exceptions/OFInitializationFailedException.m ================================================================== --- src/exceptions/OFInitializationFailedException.m +++ src/exceptions/OFInitializationFailedException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFInitializationFailedException.h" +#import "OFString.h" + +@implementation OFInitializationFailedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Initialization failed for or in class %@!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFInvalidArgumentException.h Index: src/exceptions/OFInvalidArgumentException.h ================================================================== --- src/exceptions/OFInvalidArgumentException.h +++ src/exceptions/OFInvalidArgumentException.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that the argument is invalid for this method. + */ +@interface OFInvalidArgumentException: OFException +{ + SEL selector; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly) SEL selector; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param selector The selector which doesn't accept the argument + * \return A new invalid argument exception + */ ++ newWithClass: (Class)class_ + selector: (SEL)selector; + +/** + * Initializes an already allocated invalid argument exception + * + * \param class_ The class of the object which caused the exception + * \param selector The selector which doesn't accept the argument + * \return An initialized invalid argument exception + */ +- initWithClass: (Class)class_ + selector: (SEL)selector; + +/** + * \return The selector to which an invalid argument was passed + */ +- (SEL)selector; +@end ADDED src/exceptions/OFInvalidArgumentException.m Index: src/exceptions/OFInvalidArgumentException.m ================================================================== --- src/exceptions/OFInvalidArgumentException.m +++ src/exceptions/OFInvalidArgumentException.m @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFInvalidArgumentException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +@implementation OFInvalidArgumentException ++ newWithClass: (Class)class_ + selector: (SEL)selector_ +{ + return [[self alloc] initWithClass: class_ + selector: selector_]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + selector: (SEL)selector_ +{ + self = [super initWithClass: class_]; + + selector = selector_; + + return self; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"The argument for method %s of class %@ is invalid!", + sel_getName(selector), inClass]; + + return description; +} + +- (SEL)selector +{ + return selector; +} +@end ADDED src/exceptions/OFInvalidEncodingException.h Index: src/exceptions/OFInvalidEncodingException.h ================================================================== --- src/exceptions/OFInvalidEncodingException.h +++ src/exceptions/OFInvalidEncodingException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that the encoding is invalid for this object. + */ +@interface OFInvalidEncodingException: OFException +@end ADDED src/exceptions/OFInvalidEncodingException.m Index: src/exceptions/OFInvalidEncodingException.m ================================================================== --- src/exceptions/OFInvalidEncodingException.m +++ src/exceptions/OFInvalidEncodingException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFInvalidEncodingException.h" +#import "OFString.h" + +@implementation OFInvalidEncodingException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"The encoding is invalid for class %@!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFInvalidFormatException.h Index: src/exceptions/OFInvalidFormatException.h ================================================================== --- src/exceptions/OFInvalidFormatException.h +++ src/exceptions/OFInvalidFormatException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that the format is invalid. + */ +@interface OFInvalidFormatException: OFException +@end ADDED src/exceptions/OFInvalidFormatException.m Index: src/exceptions/OFInvalidFormatException.m ================================================================== --- src/exceptions/OFInvalidFormatException.m +++ src/exceptions/OFInvalidFormatException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFInvalidFormatException.h" +#import "OFString.h" + +@implementation OFInvalidFormatException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"The format is invalid for class %@!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFInvalidServerReplyException.h Index: src/exceptions/OFInvalidServerReplyException.h ================================================================== --- src/exceptions/OFInvalidServerReplyException.h +++ src/exceptions/OFInvalidServerReplyException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that the server sent an invalid reply. + */ +@interface OFInvalidServerReplyException: OFException +@end ADDED src/exceptions/OFInvalidServerReplyException.m Index: src/exceptions/OFInvalidServerReplyException.m ================================================================== --- src/exceptions/OFInvalidServerReplyException.m +++ src/exceptions/OFInvalidServerReplyException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFInvalidServerReplyException.h" +#import "OFString.h" + +@implementation OFInvalidServerReplyException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Got an invalid reply from the server in class %@", inClass]; + + return description; +} +@end ADDED src/exceptions/OFLinkFailedException.h Index: src/exceptions/OFLinkFailedException.h ================================================================== --- src/exceptions/OFLinkFailedException.h +++ src/exceptions/OFLinkFailedException.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +#ifndef _WIN32 +/** + * \brief An exception indicating that creating a link failed. + */ +@interface OFLinkFailedException: OFException +{ + OFString *sourcePath; + OFString *destinationPath; + int errNo; +} + +# ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *sourcePath; +@property (readonly, nonatomic) OFString *destinationPath; +@property (readonly) int errNo; +# endif + +/** + * \param class_ The class of the object which caused the exception + * \param src The source for the link + * \param dest The destination for the link + * \return A new link failed exception + */ ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest; + +/** + * Initializes an already allocated link failed exception. + * + * \param class_ The class of the object which caused the exception + * \param src The source for the link + * \param dest The destination for the link + * \return An initialized link failed exception + */ +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return A string with the source for the link + */ +- (OFString*)sourcePath; + +/** + * \return A string with the destination for the link + */ +- (OFString*)destinationPath; +@end +#endif ADDED src/exceptions/OFLinkFailedException.m Index: src/exceptions/OFLinkFailedException.m ================================================================== --- src/exceptions/OFLinkFailedException.m +++ src/exceptions/OFLinkFailedException.m @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFLinkFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +#ifndef _WIN32 +@implementation OFLinkFailedException ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest +{ + return [[self alloc] initWithClass: class_ + sourcePath: src + destinationPath: dest]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest +{ + self = [super initWithClass: class_]; + + sourcePath = [src copy]; + destinationPath = [dest copy]; + errNo = GET_ERRNO; + + return self; +} + +- (void)dealloc +{ + [sourcePath release]; + [destinationPath release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to link file %@ to %@ in class %@! " ERRFMT, sourcePath, + destinationPath, inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)sourcePath +{ + return sourcePath; +} + +- (OFString*)destinationPath +{ + return destinationPath; +} +@end +#endif ADDED src/exceptions/OFListenFailedException.h Index: src/exceptions/OFListenFailedException.h ================================================================== --- src/exceptions/OFListenFailedException.h +++ src/exceptions/OFListenFailedException.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that listening on the socket failed. + */ +@interface OFListenFailedException: OFException +{ + int backLog; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly) int backLog; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param backlog The requested size of the back log + * \return A new listen failed exception + */ ++ newWithClass: (Class)class_ + backLog: (int)backlog; + +/** + * Initializes an already allocated listen failed exception + * + * \param class_ The class of the object which caused the exception + * \param backlog The requested size of the back log + * \return An initialized listen failed exception + */ +- initWithClass: (Class)class_ + backLog: (int)backlog; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return The requested back log. + */ +- (int)backLog; +@end ADDED src/exceptions/OFListenFailedException.m Index: src/exceptions/OFListenFailedException.m ================================================================== --- src/exceptions/OFListenFailedException.m +++ src/exceptions/OFListenFailedException.m @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFListenFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +@implementation OFListenFailedException ++ newWithClass: (Class)class_ + backLog: (int)backlog +{ + return [[self alloc] initWithClass: class_ + backLog: backlog]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + backLog: (int)backlog +{ + self = [super initWithClass: class_]; + + backLog = backlog; + errNo = GET_SOCK_ERRNO; + + return self; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to listen in socket of type %@ with a back log of %d! " + ERRFMT, inClass, backLog, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (int)backLog +{ + return backLog; +} +@end ADDED src/exceptions/OFMalformedXMLException.h Index: src/exceptions/OFMalformedXMLException.h ================================================================== --- src/exceptions/OFMalformedXMLException.h +++ src/exceptions/OFMalformedXMLException.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that a parser encountered malformed or + * invalid XML. + */ +@interface OFMalformedXMLException: OFException +@end ADDED src/exceptions/OFMalformedXMLException.m Index: src/exceptions/OFMalformedXMLException.m ================================================================== --- src/exceptions/OFMalformedXMLException.m +++ src/exceptions/OFMalformedXMLException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFMalformedXMLException.h" +#import "OFString.h" + +@implementation OFMalformedXMLException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"The parser in class %@ encountered malformed XML!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFMemoryNotPartOfObjectException.h Index: src/exceptions/OFMemoryNotPartOfObjectException.h ================================================================== --- src/exceptions/OFMemoryNotPartOfObjectException.h +++ src/exceptions/OFMemoryNotPartOfObjectException.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating the given memory is not part of the object. + */ +@interface OFMemoryNotPartOfObjectException: OFException +{ + void *pointer; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly) void *pointer; +#endif + +/** + * \param class_ The class of 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 + */ ++ newWithClass: (Class)class_ + pointer: (void*)ptr; + +/** + * Initializes an already allocated memory not part of object exception. + * + * \param class_ The class of the object which caused the exception + * \param ptr A pointer to the memory that is not part of the object + * \return An initialized memory not part of object exception + */ +- initWithClass: (Class)class_ + pointer: (void*)ptr; + +/** + * \return A pointer to the memory which is not part of the object + */ +- (void*)pointer; +@end ADDED src/exceptions/OFMemoryNotPartOfObjectException.m Index: src/exceptions/OFMemoryNotPartOfObjectException.m ================================================================== --- src/exceptions/OFMemoryNotPartOfObjectException.m +++ src/exceptions/OFMemoryNotPartOfObjectException.m @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFMemoryNotPartOfObjectException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +@implementation OFMemoryNotPartOfObjectException ++ newWithClass: (Class)class_ + pointer: (void*)ptr +{ + return [[self alloc] initWithClass: class_ + pointer: ptr]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + pointer: (void*)ptr +{ + self = [super initWithClass: class_]; + + pointer = ptr; + + return self; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Memory at %p was not allocated as part of object of class %@, " + @"thus the memory allocation was not changed! It is also possible " + @"that there was an attempt to free the same memory twice.", + pointer, inClass]; + + return description; +} + +- (void*)pointer +{ + return pointer; +} +@end ADDED src/exceptions/OFMutexLockFailedException.h Index: src/exceptions/OFMutexLockFailedException.h ================================================================== --- src/exceptions/OFMutexLockFailedException.h +++ src/exceptions/OFMutexLockFailedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that locking a mutex failed. + */ +@interface OFMutexLockFailedException: OFException +@end ADDED src/exceptions/OFMutexLockFailedException.m Index: src/exceptions/OFMutexLockFailedException.m ================================================================== --- src/exceptions/OFMutexLockFailedException.m +++ src/exceptions/OFMutexLockFailedException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFMutexLockFailedException.h" +#import "OFString.h" + +@implementation OFMutexLockFailedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"A mutex of class %@ could not be locked!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFMutexLockedException.h Index: src/exceptions/OFMutexLockedException.h ================================================================== --- src/exceptions/OFMutexLockedException.h +++ src/exceptions/OFMutexLockedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that a mutex is still locked. + */ +@interface OFMutexLockedException: OFException +@end ADDED src/exceptions/OFMutexLockedException.m Index: src/exceptions/OFMutexLockedException.m ================================================================== --- src/exceptions/OFMutexLockedException.m +++ src/exceptions/OFMutexLockedException.m @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFMutexLockedException.h" +#import "OFString.h" + +@implementation OFMutexLockedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Deallocation of a mutex of type %@ was tried, even though it " + @"was still locked!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFMutexUnlockFailedException.h Index: src/exceptions/OFMutexUnlockFailedException.h ================================================================== --- src/exceptions/OFMutexUnlockFailedException.h +++ src/exceptions/OFMutexUnlockFailedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that unlocking a mutex failed. + */ +@interface OFMutexUnlockFailedException: OFException +@end ADDED src/exceptions/OFMutexUnlockFailedException.m Index: src/exceptions/OFMutexUnlockFailedException.m ================================================================== --- src/exceptions/OFMutexUnlockFailedException.m +++ src/exceptions/OFMutexUnlockFailedException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFMutexUnlockFailedException.h" +#import "OFString.h" + +@implementation OFMutexUnlockFailedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"A mutex of class %@ could not be unlocked!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFNotConnectedException.h Index: src/exceptions/OFNotConnectedException.h ================================================================== --- src/exceptions/OFNotConnectedException.h +++ src/exceptions/OFNotConnectedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating a socket is not connected or bound. + */ +@interface OFNotConnectedException: OFException +@end ADDED src/exceptions/OFNotConnectedException.m Index: src/exceptions/OFNotConnectedException.m ================================================================== --- src/exceptions/OFNotConnectedException.m +++ src/exceptions/OFNotConnectedException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFNotConnectedException.h" +#import "OFString.h" + +@implementation OFNotConnectedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"The socket of type %@ is not connected or bound!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFNotImplementedException.h Index: src/exceptions/OFNotImplementedException.h ================================================================== --- src/exceptions/OFNotImplementedException.h +++ src/exceptions/OFNotImplementedException.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that a method or part of it is not + * implemented. + */ +@interface OFNotImplementedException: OFException +{ + SEL selector; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly) SEL selector; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param selector The selector which is not or not fully implemented + * \return A new not implemented exception + */ ++ newWithClass: (Class)class_ + selector: (SEL)selector; + +/** + * Initializes an already allocated not implemented exception. + * + * \param class_ The class of the object which caused the exception + * \param selector The selector which is not or not fully implemented + * \return An initialized not implemented exception + */ +- initWithClass: (Class)class_ + selector: (SEL)selector; + +/** + * \return The selector which is not or not fully implemented + */ +- (SEL)selector; +@end ADDED src/exceptions/OFNotImplementedException.m Index: src/exceptions/OFNotImplementedException.m ================================================================== --- src/exceptions/OFNotImplementedException.m +++ src/exceptions/OFNotImplementedException.m @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFNotImplementedException.h" +#import "OFString.h" + +#import "common.h" + +@implementation OFNotImplementedException ++ newWithClass: (Class)class_ + selector: (SEL)selector +{ + return [[self alloc] initWithClass: class_ + selector: selector]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + selector: (SEL)selector_ +{ + self = [super initWithClass: class_]; + + selector = selector_; + + return self; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"The method %s of class %@ is not or not fully implemented!", + sel_getName(selector), inClass]; + + return description; +} + +- (SEL)selector +{ + return selector; +} +@end ADDED src/exceptions/OFOpenFileFailedException.h Index: src/exceptions/OFOpenFileFailedException.h ================================================================== --- src/exceptions/OFOpenFileFailedException.h +++ src/exceptions/OFOpenFileFailedException.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating a file couldn't be opened. + */ +@interface OFOpenFileFailedException: OFException +{ + OFString *path; + OFString *mode; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *path; +@property (readonly, nonatomic) OFString *mode; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param path A string with the path of the file tried to open + * \param mode A string with the mode in which the file should have been opened + * \return A new open file failed exception + */ ++ newWithClass: (Class)class_ + path: (OFString*)path + mode: (OFString*)mode; + +/** + * Initializes an already allocated open file failed exception. + * + * \param class_ The class of the object which caused the exception + * \param path A string with the path of the file which couldn't be opened + * \param mode A string with the mode in which the file should have been opened + * \return An initialized open file failed exception + */ +- initWithClass: (Class)class_ + path: (OFString*)path + mode: (OFString*)mode; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return A string with the path of the file which couldn't be opened + */ +- (OFString*)path; + +/** + * \return A string with the mode in which the file should have been opened + */ +- (OFString*)mode; +@end ADDED src/exceptions/OFOpenFileFailedException.m Index: src/exceptions/OFOpenFileFailedException.m ================================================================== --- src/exceptions/OFOpenFileFailedException.m +++ src/exceptions/OFOpenFileFailedException.m @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFOpenFileFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +@implementation OFOpenFileFailedException ++ newWithClass: (Class)class_ + path: (OFString*)path + mode: (OFString*)mode +{ + return [[self alloc] initWithClass: class_ + path: path + mode: mode]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + path: (OFString*)path_ + mode: (OFString*)mode_ +{ + self = [super initWithClass: class_]; + + @try { + path = [path_ copy]; + mode = [mode_ copy]; + errNo = GET_ERRNO; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [path release]; + [mode release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to open file %@ with mode %@ in class %@! " ERRFMT, path, + mode, inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)path +{ + return path; +} + +- (OFString*)mode +{ + return mode; +} +@end ADDED src/exceptions/OFOutOfMemoryException.h Index: src/exceptions/OFOutOfMemoryException.h ================================================================== --- src/exceptions/OFOutOfMemoryException.h +++ src/exceptions/OFOutOfMemoryException.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating there is not enough memory available. + */ +@interface OFOutOfMemoryException: OFException +{ + size_t requestedSize; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly) size_t requestedSize; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param size The size of the memory that couldn't be allocated + * \return A new no memory exception + */ ++ newWithClass: (Class)class_ + requestedSize: (size_t)size; + +/** + * Initializes an already allocated no memory exception. + * + * \param class_ The class of the object which caused the exception + * \param size The size of the memory that couldn't be allocated + * \return An initialized no memory exception + */ +- initWithClass: (Class)class_ + requestedSize: (size_t)size; + +/** + * \return The size of the memoory that couldn't be allocated + */ +- (size_t)requestedSize; +@end ADDED src/exceptions/OFOutOfMemoryException.m Index: src/exceptions/OFOutOfMemoryException.m ================================================================== --- src/exceptions/OFOutOfMemoryException.m +++ src/exceptions/OFOutOfMemoryException.m @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFOutOfMemoryException.h" +#import "OFString.h" + +@implementation OFOutOfMemoryException ++ newWithClass: (Class)class_ + requestedSize: (size_t)size +{ + return [[self alloc] initWithClass: class_ + requestedSize: size]; +} + +- initWithClass: (Class)class_ + requestedSize: (size_t)size +{ + self = [super initWithClass: class_]; + + requestedSize = size; + + return self; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + if (requestedSize) + description = [[OFString alloc] initWithFormat: + @"Could not allocate %zu bytes in class %@!", requestedSize, + inClass]; + else + description = [[OFString alloc] initWithFormat: + @"Could not allocate enough memory in class %@!", inClass]; + + return description; +} + +- (size_t)requestedSize +{ + return requestedSize; +} +@end ADDED src/exceptions/OFOutOfRangeException.h Index: src/exceptions/OFOutOfRangeException.h ================================================================== --- src/exceptions/OFOutOfRangeException.h +++ src/exceptions/OFOutOfRangeException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating the given value is out of range. + */ +@interface OFOutOfRangeException: OFException +@end ADDED src/exceptions/OFOutOfRangeException.m Index: src/exceptions/OFOutOfRangeException.m ================================================================== --- src/exceptions/OFOutOfRangeException.m +++ src/exceptions/OFOutOfRangeException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFOutOfRangeException.h" +#import "OFString.h" + +@implementation OFOutOfRangeException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Value out of range in class %@!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFReadFailedException.h Index: src/exceptions/OFReadFailedException.h ================================================================== --- src/exceptions/OFReadFailedException.h +++ src/exceptions/OFReadFailedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFReadOrWriteFailedException.h" + +/** + * \brief An exception indicating a read on a stream failed. + */ +@interface OFReadFailedException: OFReadOrWriteFailedException +@end ADDED src/exceptions/OFReadFailedException.m Index: src/exceptions/OFReadFailedException.m ================================================================== --- src/exceptions/OFReadFailedException.m +++ src/exceptions/OFReadFailedException.m @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFReadFailedException.h" +#import "OFString.h" + +#import "common.h" + +@implementation OFReadFailedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to read %zu bytes in class %@! " ERRFMT, requestedSize, + inClass, ERRPARAM]; + + return description; +} +@end ADDED src/exceptions/OFReadOrWriteFailedException.h Index: src/exceptions/OFReadOrWriteFailedException.h ================================================================== --- src/exceptions/OFReadOrWriteFailedException.h +++ src/exceptions/OFReadOrWriteFailedException.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating a read or write to a stream failed. + */ +@interface OFReadOrWriteFailedException: OFException +{ + size_t requestedSize; +@public + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly) size_t requestedSize; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of 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 + */ ++ newWithClass: (Class)class_ + requestedSize: (size_t)size; + +/** + * Initializes an already allocated read or write failed exception. + * + * \param class_ The class of 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 + */ +- initWithClass: (Class)class_ + requestedSize: (size_t)size; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return The requested size of the data that couldn't be read / written + */ +- (size_t)requestedSize; +@end ADDED src/exceptions/OFReadOrWriteFailedException.m Index: src/exceptions/OFReadOrWriteFailedException.m ================================================================== --- src/exceptions/OFReadOrWriteFailedException.m +++ src/exceptions/OFReadOrWriteFailedException.m @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFReadOrWriteFailedException.h" +#import "OFString.h" +#import "OFStreamSocket.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +@implementation OFReadOrWriteFailedException ++ newWithClass: (Class)class_ + requestedSize: (size_t)size +{ + return [[self alloc] initWithClass: class_ + requestedSize: size]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + requestedSize: (size_t)size +{ + self = [super initWithClass: class_]; + + requestedSize = size; + + if ([class_ isSubclassOfClass: [OFStreamSocket class]]) + errNo = GET_SOCK_ERRNO; + else + errNo = GET_ERRNO; + + return self; +} + +- (int)errNo +{ + return errNo; +} + +- (size_t)requestedSize +{ + return requestedSize; +} +@end ADDED src/exceptions/OFRenameFileFailedException.h Index: src/exceptions/OFRenameFileFailedException.h ================================================================== --- src/exceptions/OFRenameFileFailedException.h +++ src/exceptions/OFRenameFileFailedException.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that renaming a file failed. + */ +@interface OFRenameFileFailedException: OFException +{ + OFString *sourcePath; + OFString *destinationPath; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *sourcePath; +@property (readonly, nonatomic) OFString *destinationPath; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param src The original path + * \param dst The new path + * \return A new rename file failed exception + */ ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dst; + +/** + * Initializes an already allocated rename failed exception. + * + * \param class_ The class of the object which caused the exception + * \param src The original path + * \param dst The new path + * \return An initialized rename file failed exception + */ +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dst; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return The original path + */ +- (OFString*)sourcePath; + +/** + * \return The new path + */ +- (OFString*)destinationPath; +@end ADDED src/exceptions/OFRenameFileFailedException.m Index: src/exceptions/OFRenameFileFailedException.m ================================================================== --- src/exceptions/OFRenameFileFailedException.m +++ src/exceptions/OFRenameFileFailedException.m @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFRenameFileFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +@implementation OFRenameFileFailedException ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dst +{ + return [[self alloc] initWithClass: class_ + sourcePath: src + destinationPath: dst]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dst +{ + self = [super initWithClass: class_]; + + @try { + sourcePath = [src copy]; + destinationPath = [dst copy]; + errNo = GET_ERRNO; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [sourcePath release]; + [destinationPath release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to rename file %@ to %@ in class %@! " ERRFMT, sourcePath, + destinationPath, inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)sourcePath +{ + return sourcePath; +} + +- (OFString*)destinationPath; +{ + return destinationPath; +} +@end ADDED src/exceptions/OFSeekFailedException.h Index: src/exceptions/OFSeekFailedException.h ================================================================== --- src/exceptions/OFSeekFailedException.h +++ src/exceptions/OFSeekFailedException.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that seeking in a stream failed. + */ +@interface OFSeekFailedException: OFException +{ + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly) int errNo; +#endif + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; +@end ADDED src/exceptions/OFSeekFailedException.m Index: src/exceptions/OFSeekFailedException.m ================================================================== --- src/exceptions/OFSeekFailedException.m +++ src/exceptions/OFSeekFailedException.m @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFSeekFailedException.h" +#import "OFString.h" + +#import "common.h" + +@implementation OFSeekFailedException +- initWithClass: (Class)class_ +{ + self = [super initWithClass: class_]; + + errNo = GET_ERRNO; + + return self; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Seeking failed in class %@! " ERRFMT, inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} +@end ADDED src/exceptions/OFSetOptionFailedException.h Index: src/exceptions/OFSetOptionFailedException.h ================================================================== --- src/exceptions/OFSetOptionFailedException.h +++ src/exceptions/OFSetOptionFailedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that setting an option failed. + */ +@interface OFSetOptionFailedException: OFException +@end ADDED src/exceptions/OFSetOptionFailedException.m Index: src/exceptions/OFSetOptionFailedException.m ================================================================== --- src/exceptions/OFSetOptionFailedException.m +++ src/exceptions/OFSetOptionFailedException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFSetOptionFailedException.h" +#import "OFString.h" + +@implementation OFSetOptionFailedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Setting an option in class %@ failed!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFSymlinkFailedException.h Index: src/exceptions/OFSymlinkFailedException.h ================================================================== --- src/exceptions/OFSymlinkFailedException.h +++ src/exceptions/OFSymlinkFailedException.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +#ifndef _WIN32 +/** + * \brief An exception indicating that creating a symlink failed. + */ +@interface OFSymlinkFailedException: OFException +{ + OFString *sourcePath; + OFString *destinationPath; + int errNo; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFString *sourcePath; +@property (readonly, nonatomic) OFString *destinationPath; +@property (readonly) int errNo; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param src The source for the symlink + * \param dest The destination for the symlink + * \return A new symlink failed exception + */ ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest; + +/** + * Initializes an already allocated symlink failed exception. + * + * \param class_ The class of the object which caused the exception + * \param src The source for the symlink + * \param dest The destination for the symlink + * \return An initialized symlink failed exception + */ +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + +/** + * \return A string with the source for the symlink + */ +- (OFString*)sourcePath; + +/** + * \return A string with the destination for the symlink + */ +- (OFString*)destinationPath; +@end +#endif ADDED src/exceptions/OFSymlinkFailedException.m Index: src/exceptions/OFSymlinkFailedException.m ================================================================== --- src/exceptions/OFSymlinkFailedException.m +++ src/exceptions/OFSymlinkFailedException.m @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFSymlinkFailedException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +#import "common.h" + +#ifndef _WIN32 +@implementation OFSymlinkFailedException ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest +{ + return [[self alloc] initWithClass: class_ + sourcePath: src + destinationPath: dest]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest +{ + self = [super initWithClass: class_]; + + sourcePath = [src copy]; + destinationPath = [dest copy]; + errNo = GET_ERRNO; + + return self; +} + +- (void)dealloc +{ + [sourcePath release]; + [destinationPath release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to symlink file %@ to %@ in class %@! " ERRFMT, sourcePath, + destinationPath, inClass, ERRPARAM]; + + return description; +} + +- (int)errNo +{ + return errNo; +} + +- (OFString*)sourcePath +{ + return sourcePath; +} + +- (OFString*)destinationPath +{ + return destinationPath; +} +@end +#endif ADDED src/exceptions/OFThreadJoinFailedException.h Index: src/exceptions/OFThreadJoinFailedException.h ================================================================== --- src/exceptions/OFThreadJoinFailedException.h +++ src/exceptions/OFThreadJoinFailedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that joining a thread failed. + */ +@interface OFThreadJoinFailedException: OFException +@end ADDED src/exceptions/OFThreadJoinFailedException.m Index: src/exceptions/OFThreadJoinFailedException.m ================================================================== --- src/exceptions/OFThreadJoinFailedException.m +++ src/exceptions/OFThreadJoinFailedException.m @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFThreadJoinFailedException.h" +#import "OFString.h" + +@implementation OFThreadJoinFailedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Joining a thread of class %@ failed! Most likely, another thread " + @"already waits for the thread to join.", inClass]; + + return description; +} +@end ADDED src/exceptions/OFThreadStartFailedException.h Index: src/exceptions/OFThreadStartFailedException.h ================================================================== --- src/exceptions/OFThreadStartFailedException.h +++ src/exceptions/OFThreadStartFailedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that starting a thread failed. + */ +@interface OFThreadStartFailedException: OFException +@end ADDED src/exceptions/OFThreadStartFailedException.m Index: src/exceptions/OFThreadStartFailedException.m ================================================================== --- src/exceptions/OFThreadStartFailedException.m +++ src/exceptions/OFThreadStartFailedException.m @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFThreadStartFailedException.h" +#import "OFString.h" + +@implementation OFThreadStartFailedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Starting a thread of class %@ failed!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFThreadStillRunningException.h Index: src/exceptions/OFThreadStillRunningException.h ================================================================== --- src/exceptions/OFThreadStillRunningException.h +++ src/exceptions/OFThreadStillRunningException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that a thread is still running. + */ +@interface OFThreadStillRunningException: OFException +@end ADDED src/exceptions/OFThreadStillRunningException.m Index: src/exceptions/OFThreadStillRunningException.m ================================================================== --- src/exceptions/OFThreadStillRunningException.m +++ src/exceptions/OFThreadStillRunningException.m @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFThreadStillRunningException.h" +#import "OFString.h" + +@implementation OFThreadStillRunningException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Deallocation of a thread of type %@ was tried, even though it " + @"was still running!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFTruncatedDataException.h Index: src/exceptions/OFTruncatedDataException.h ================================================================== --- src/exceptions/OFTruncatedDataException.h +++ src/exceptions/OFTruncatedDataException.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating that data was truncated while it should not + * have been truncated. + */ +@interface OFTruncatedDataException: OFException +@end ADDED src/exceptions/OFTruncatedDataException.m Index: src/exceptions/OFTruncatedDataException.m ================================================================== --- src/exceptions/OFTruncatedDataException.m +++ src/exceptions/OFTruncatedDataException.m @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFTruncatedDataException.h" +#import "OFString.h" + +@implementation OFTruncatedDataException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Truncated data was received or produced in class %@ while it " + @"should not have been truncated!", inClass]; + + return description; +} +@end ADDED src/exceptions/OFUnboundNamespaceException.h Index: src/exceptions/OFUnboundNamespaceException.h ================================================================== --- src/exceptions/OFUnboundNamespaceException.h +++ src/exceptions/OFUnboundNamespaceException.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +/** + * \brief An exception indicating an attempt to use an unbound namespace. + */ +@interface OFUnboundNamespaceException: OFException +{ + OFString *ns; + OFString *prefix; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic, getter=namespace) OFString *ns; +@property (readonly, nonatomic) OFString *prefix; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param ns The namespace which is unbound + * \return A new unbound namespace exception + */ ++ newWithClass: (Class)class_ + namespace: (OFString*)ns; + +/** + * \param class_ The class of the object which caused the exception + * \param prefix The prefix which is unbound + * \return A new unbound namespace exception + */ ++ newWithClass: (Class)class_ + prefix: (OFString*)prefix; + +/** + * Initializes an already allocated unbound namespace exception + * + * \param class_ The class of the object which caused the exception + * \param ns The namespace which is unbound + * \return An initialized unbound namespace exception + */ +- initWithClass: (Class)class_ + namespace: (OFString*)ns; + +/** + * Initializes an already allocated unbound namespace exception + * + * \param class_ The class of the object which caused the exception + * \param prefix The prefix which is unbound + * \return An initialized unbound namespace exception + */ +- initWithClass: (Class)class_ + prefix: (OFString*)prefix; + +/** + * \return The unbound namespace + */ +- (OFString*)namespace; + +/** + * \return The unbound prefix + */ +- (OFString*)prefix; +@end ADDED src/exceptions/OFUnboundNamespaceException.m Index: src/exceptions/OFUnboundNamespaceException.m ================================================================== --- src/exceptions/OFUnboundNamespaceException.m +++ src/exceptions/OFUnboundNamespaceException.m @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFUnboundNamespaceException.h" +#import "OFString.h" + +#import "OFNotImplementedException.h" + +@implementation OFUnboundNamespaceException ++ newWithClass: (Class)class_ + namespace: (OFString*)ns +{ + return [[self alloc] initWithClass: class_ + namespace: ns]; +} + ++ newWithClass: (Class)class_ + prefix: (OFString*)prefix +{ + return [[self alloc] initWithClass: class_ + prefix: prefix]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + namespace: (OFString*)ns_ +{ + self = [super initWithClass: class_]; + + @try { + ns = [ns_ copy]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- initWithClass: (Class)class_ + prefix: (OFString*)prefix_ +{ + self = [super initWithClass: class_]; + + @try { + prefix = [prefix_ copy]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [ns release]; + [prefix release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + if (ns != nil) + description = [[OFString alloc] initWithFormat: + @"The namespace %@ is not bound in class %@", ns, inClass]; + else if (prefix != nil) + description = [[OFString alloc] initWithFormat: + @"The prefix %@ is not bound to any namespace in class %@", + prefix, inClass]; + + return description; +} + +- (OFString*)namespace +{ + return ns; +} + +- (OFString*)prefix +{ + return prefix; +} +@end ADDED src/exceptions/OFUnsupportedProtocolException.h Index: src/exceptions/OFUnsupportedProtocolException.h ================================================================== --- src/exceptions/OFUnsupportedProtocolException.h +++ src/exceptions/OFUnsupportedProtocolException.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFException.h" + +@class OFURL; + +/** + * \brief An exception indicating that the protocol specified by the URL is not + * supported. + */ +@interface OFUnsupportedProtocolException: OFException +{ + OFURL *URL; +} + +#ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFURL *URL; +#endif + +/** + * \param class_ The class of the object which caused the exception + * \param url The URL whose protocol is unsupported + * \return A new unsupported protocol exception + */ ++ newWithClass: (Class)class_ + URL: (OFURL*)url; + +/** + * Initializes an already allocated unsupported protocol exception + * + * \param class_ The class of the object which caused the exception + * \param url The URL whose protocol is unsupported + * \return An initialized unsupported protocol exception + */ +- initWithClass: (Class)class_ + URL: (OFURL*)url; + +/** + * \return The URL whose protocol is unsupported + */ +- (OFURL*)URL; +@end ADDED src/exceptions/OFUnsupportedProtocolException.m Index: src/exceptions/OFUnsupportedProtocolException.m ================================================================== --- src/exceptions/OFUnsupportedProtocolException.m +++ src/exceptions/OFUnsupportedProtocolException.m @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFUnsupportedProtocolException.h" +#import "OFString.h" +#import "OFURL.h" + +#import "OFNotImplementedException.h" + +@implementation OFUnsupportedProtocolException ++ newWithClass: (Class)class_ + URL: (OFURL*)url +{ + return [[self alloc] initWithClass: class_ + URL: url]; +} + +- initWithClass: (Class)class_ +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException newWithClass: c + selector: _cmd]; +} + +- initWithClass: (Class)class_ + URL: (OFURL*)url +{ + self = [super initWithClass: class_]; + + @try { + URL = [url copy]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [URL release]; + + [super dealloc]; +} + +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"The protocol of URL %@ is not supported by class %@", URL, + inClass]; + + return description; +} + +- (OFURL*)URL +{ + return URL; +} +@end ADDED src/exceptions/OFWriteFailedException.h Index: src/exceptions/OFWriteFailedException.h ================================================================== --- src/exceptions/OFWriteFailedException.h +++ src/exceptions/OFWriteFailedException.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#import "OFReadOrWriteFailedException.h" + +/** + * \brief An exception indicating a write to a stream failed. + */ +@interface OFWriteFailedException: OFReadOrWriteFailedException +@end ADDED src/exceptions/OFWriteFailedException.m Index: src/exceptions/OFWriteFailedException.m ================================================================== --- src/exceptions/OFWriteFailedException.m +++ src/exceptions/OFWriteFailedException.m @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFWriteFailedException.h" +#import "OFString.h" + +#import "common.h" + +@implementation OFWriteFailedException +- (OFString*)description +{ + if (description != nil) + return description; + + description = [[OFString alloc] initWithFormat: + @"Failed to write %zu bytes in class %@! " ERRFMT, requestedSize, + inClass, ERRPARAM]; + + return description; +} +@end ADDED src/exceptions/common.h Index: src/exceptions/common.h ================================================================== --- src/exceptions/common.h +++ src/exceptions/common.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include + +#if defined(OF_APPLE_RUNTIME) || defined(OF_GNU_RUNTIME) +# import +#endif + +#ifdef OF_OLD_GNU_RUNTIME +# import +# define sel_getName(x) sel_get_name(x) +#endif + +#ifndef _WIN32 +# include +# define GET_ERRNO errno +# ifndef HAVE_THREADSAFE_GETADDRINFO +# define GET_AT_ERRNO h_errno +# else +# define GET_AT_ERRNO errno +# endif +# define GET_SOCK_ERRNO errno +# define ERRFMT "Error string was: %s" +# define ERRPARAM strerror(errNo) +# if !defined(HAVE_THREADSAFE_GETADDRINFO) && !defined(_PSP) +# define AT_ERRPARAM hstrerror(errNo) +# else +# define AT_ERRPARAM strerror(errNo) +# endif +#else +# include +# define GET_ERRNO GetLastError() +# define GET_AT_ERRNO WSAGetLastError() +# define GET_SOCK_ERRNO WSAGetLastError() +# define ERRFMT "Error code was: %d" +# define ERRPARAM errNo +# define AT_ERRPARAM errNo +#endif Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -79,8 +79,8 @@ psp-strip ${PROG_NOINST} pack-pbp $@ PARAM.SFO NULL NULL NULL NULL NULL ${PROG_NOINST} NULL include ../buildsys.mk -CPPFLAGS += -I../src -I.. -DSTDOUT +CPPFLAGS += -I../src -I../src/exceptions -I.. -DSTDOUT LIBS := -L../src -lobjfw ${LIBS} LD = ${OBJC}