Overview
Comment: | Add OFSet and OFMutableSet. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
8df328d503984284cfc72972c9f0f50d |
User & Date: | js on 2011-07-18 22:53:19 |
Other Links: | manifest | tags |
Context
2011-07-18
| ||
23:47 | Fix a bug (hopefully the last!) in blocks. check-in: b330936afe user: js tags: trunk | |
22:53 | Add OFSet and OFMutableSet. check-in: 8df328d503 user: js tags: trunk | |
03:01 | Fix reference counting for blocks. check-in: dbd79d0747 user: js tags: trunk | |
Changes
Modified ObjFW.xcodeproj/project.pbxproj from [17608a8ac3] to [3a4af388aa].
︙ | |||
91 92 93 94 95 96 97 98 99 100 101 102 103 104 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | + + + + + | 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, ); }; }; 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 */; }; 4B39844213D3A24600E6F825 /* OFSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B39844013D3A24600E6F825 /* OFSet.h */; }; 4B39844313D3A24600E6F825 /* OFSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B39844113D3A24600E6F825 /* OFSet.m */; }; 4B39844713D3AFB400E6F825 /* OFMutableSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B39844513D3AFB400E6F825 /* OFMutableSet.h */; }; 4B39844813D3AFB400E6F825 /* OFMutableSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B39844613D3AFB400E6F825 /* OFMutableSet.m */; }; 4B39844A13D3D03000E6F825 /* OFSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B39844913D3D03000E6F825 /* OFSet.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 */; }; 4B3D23901337FC0D00DD29B8 /* OFDataArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B6799611099E7C50041064A /* OFDataArray.m */; }; 4B3D23911337FC0D00DD29B8 /* OFDataArray+Hashing.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BE17ADA12FD746D002CEB0B /* OFDataArray+Hashing.m */; }; |
︙ | |||
404 405 406 407 408 409 410 411 412 413 414 415 416 417 | 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | + + + + + | 4B29BC4B133AC7DC0004B236 /* OFDeleteFileFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDeleteFileFailedException.m; path = src/exceptions/OFDeleteFileFailedException.m; sourceTree = "<group>"; }; 4B29BC54133AC81B0004B236 /* OFRenameFileFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFRenameFileFailedException.h; path = src/exceptions/OFRenameFileFailedException.h; sourceTree = "<group>"; }; 4B29BC55133AC81B0004B236 /* OFRenameFileFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFRenameFileFailedException.m; path = src/exceptions/OFRenameFileFailedException.m; sourceTree = "<group>"; }; 4B29BC5D133AC9C40004B236 /* OFLinkFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFLinkFailedException.h; path = src/exceptions/OFLinkFailedException.h; sourceTree = "<group>"; }; 4B29BC5E133AC9C40004B236 /* OFLinkFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFLinkFailedException.m; path = src/exceptions/OFLinkFailedException.m; sourceTree = "<group>"; }; 4B29BC5F133AC9C60004B236 /* OFSymlinkFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFSymlinkFailedException.h; path = src/exceptions/OFSymlinkFailedException.h; sourceTree = "<group>"; }; 4B29BC60133AC9C90004B236 /* OFSymlinkFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSymlinkFailedException.m; path = src/exceptions/OFSymlinkFailedException.m; sourceTree = "<group>"; }; 4B39844013D3A24600E6F825 /* OFSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFSet.h; path = src/OFSet.h; sourceTree = "<group>"; }; 4B39844113D3A24600E6F825 /* OFSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSet.m; path = src/OFSet.m; sourceTree = "<group>"; }; 4B39844513D3AFB400E6F825 /* OFMutableSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMutableSet.h; path = src/OFMutableSet.h; sourceTree = "<group>"; }; 4B39844613D3AFB400E6F825 /* OFMutableSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMutableSet.m; path = src/OFMutableSet.m; sourceTree = "<group>"; }; 4B39844913D3D03000E6F825 /* OFSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSet.m; path = tests/OFSet.m; sourceTree = "<group>"; }; 4B3D236D1337FB5800DD29B8 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = base64.h; path = src/base64.h; sourceTree = "<group>"; }; 4B3D236E1337FB5800DD29B8 /* base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = base64.m; path = src/base64.m; sourceTree = "<group>"; }; 4B3D23701337FB7500DD29B8 /* OFHTTPRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFHTTPRequestTests.m; path = tests/OFHTTPRequestTests.m; sourceTree = "<group>"; }; 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; }; 4B3D5693139A617D0010A78F /* OFSerializationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSerializationTests.m; path = tests/OFSerializationTests.m; sourceTree = "<group>"; }; |
︙ | |||
821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 | 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 | + + + + | 4B67996D1099E7C50041064A /* OFList.m */, 4BF1BCC211C9663F0025511F /* OFMD5Hash.h */, 4BF1BCC311C9663F0025511F /* OFMD5Hash.m */, 4B67996F1099E7C50041064A /* OFMutableArray.h */, 4B6799701099E7C50041064A /* OFMutableArray.m */, 4B6799711099E7C50041064A /* OFMutableDictionary.h */, 4B6799721099E7C50041064A /* OFMutableDictionary.m */, 4B39844513D3AFB400E6F825 /* OFMutableSet.h */, 4B39844613D3AFB400E6F825 /* OFMutableSet.m */, 4B6799731099E7C50041064A /* OFMutableString.h */, 4B6799741099E7C50041064A /* OFMutableString.m */, 4B511B7A139C0A34003764A5 /* OFNull.h */, 4B511B7B139C0A34003764A5 /* OFNull.m */, 4B6799751099E7C50041064A /* OFNumber.h */, 4B6799761099E7C50041064A /* OFNumber.m */, 4B6799771099E7C50041064A /* OFObject.h */, 4B6799781099E7C50041064A /* OFObject.m */, 4BB25E82139C388A00F574EA /* OFObject+Serialization.h */, 4BB25E83139C388A00F574EA /* OFObject+Serialization.m */, 4B6799791099E7C50041064A /* OFPlugin.h */, 4B67997A1099E7C50041064A /* OFPlugin.m */, 4B981CDE116F71DD00294DB7 /* OFSeekableStream.h */, 4B981CDF116F71DD00294DB7 /* OFSeekableStream.m */, 4B989C2E13771A3700109A30 /* OFSerialization.h */, 4B39844013D3A24600E6F825 /* OFSet.h */, 4B39844113D3A24600E6F825 /* OFSet.m */, 4BF1BCC411C9663F0025511F /* OFSHA1Hash.h */, 4BF1BCC511C9663F0025511F /* OFSHA1Hash.m */, 4B67997D1099E7C50041064A /* OFStream.h */, 4B67997E1099E7C50041064A /* OFStream.m */, 4BAF5F47123460C900F4E111 /* OFStreamObserver.h */, 4BAF5F48123460C900F4E111 /* OFStreamObserver.m */, 4BAF5F49123460C900F4E111 /* OFStreamSocket.h */, |
︙ | |||
912 913 914 915 916 917 918 919 920 921 922 923 924 925 | 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 | + | 4B3D23701337FB7500DD29B8 /* OFHTTPRequestTests.m */, 4B6EF6721235358D0076B512 /* OFListTests.m */, 4B6EF6731235358D0076B512 /* OFMD5HashTests.m */, 4B6EF6741235358D0076B512 /* OFNumberTests.m */, 4B6EF6751235358D0076B512 /* OFObjectTests.m */, 4B6EF6761235358D0076B512 /* OFPluginTests.m */, 4B3D5693139A617D0010A78F /* OFSerializationTests.m */, 4B39844913D3D03000E6F825 /* OFSet.m */, 4B6EF6771235358D0076B512 /* OFSHA1HashTests.m */, 4B6EF6781235358D0076B512 /* OFStreamTests.m */, 4B6EF6791235358D0076B512 /* OFStringTests.m */, 4B6EF67A1235358D0076B512 /* OFTCPSocketTests.m */, 4B6EF67B1235358D0076B512 /* OFThreadTests.m */, 4BF0749512DFAFCA00A4ADD1 /* OFURLTests.m */, 4B6EF67C1235358D0076B512 /* OFXMLElementBuilderTests.m */, |
︙ | |||
1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 | 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 | + + | 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 */, 4B55A109133AC05100B58A93 /* common.h in Headers */, 4BDF37B51338055600F9A81A /* config.h in Headers */, 4B39844213D3A24600E6F825 /* OFSet.h in Headers */, 4B39844713D3AFB400E6F825 /* OFMutableSet.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 4B23CA89133811610047A1D9 /* TestPlugin */ = { |
︙ | |||
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 | 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 | + + + + - | 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 */, 4B39844313D3A24600E6F825 /* OFSet.m in Sources */, 4B39844813D3AFB400E6F825 /* OFMutableSet.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 4BF33AEC133807310059CEF7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 4BF33AFC133807A20059CEF7 /* OFArrayTests.m in Sources */, 4BF33AFD133807A20059CEF7 /* OFBlockTests.m in Sources */, 4BF33AFE133807A20059CEF7 /* OFDataArrayTests.m in Sources */, 4BF33AFF133807A20059CEF7 /* OFDateTests.m in Sources */, 4BF33B00133807A20059CEF7 /* OFDictionaryTests.m in Sources */, 4BF33B02133807A20059CEF7 /* OFHTTPRequestTests.m in Sources */, 4BF33B03133807A20059CEF7 /* OFListTests.m in Sources */, 4BF33B04133807A20059CEF7 /* OFMD5HashTests.m in Sources */, 4BF33B05133807A20059CEF7 /* OFNumberTests.m in Sources */, 4BF33B06133807A20059CEF7 /* OFObjectTests.m in Sources */, 4BF33B07133807A20059CEF7 /* OFPluginTests.m in Sources */, 4B3D5694139A617D0010A78F /* OFSerializationTests.m in Sources */, 4B39844A13D3D03000E6F825 /* OFSet.m in Sources */, 4BF33B08133807A20059CEF7 /* OFSHA1HashTests.m in Sources */, 4BF33B09133807A20059CEF7 /* OFStreamTests.m in Sources */, 4BF33B0A133807A20059CEF7 /* OFStringTests.m in Sources */, 4BF33B0B133807A20059CEF7 /* OFTCPSocketTests.m in Sources */, 4BF33B0C133807A20059CEF7 /* OFThreadTests.m in Sources */, 4BF33B0D133807A20059CEF7 /* OFURLTests.m in Sources */, 4BF33B0E133807A20059CEF7 /* OFXMLElementBuilderTests.m in Sources */, 4BF33B0F133807A20059CEF7 /* OFXMLElementTests.m in Sources */, 4BF33B10133807A20059CEF7 /* OFXMLParserTests.m in Sources */, 4BF33B11133807A20059CEF7 /* PropertiesTests.m in Sources */, 4BF33B12133807A20059CEF7 /* TestsAppDelegate.m in Sources */, |
︙ |
Modified src/Makefile from [b17698396a] to [9a92cef180].
︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | + + | OFFloatVector.m \ OFHash.m \ OFHTTPRequest.m \ OFList.m \ OFMD5Hash.m \ OFMutableArray.m \ OFMutableDictionary.m \ OFMutableSet.m \ OFMutableString.m \ OFNull.m \ OFNumber.m \ OFObject.m \ OFObject+Serialization.m \ ${OFPLUGIN_M} \ OFSeekableStream.m \ OFSet.m \ OFSHA1Hash.m \ OFStream.m \ OFStreamObserver.m \ OFStreamSocket.m \ OFString.m \ OFString+Hashing.m \ OFString+Serialization.m \ |
︙ |
Modified src/OFDictionary.h from [8a0c697234] to [4dadcc19f3].
︙ | |||
205 206 207 208 209 210 211 212 213 214 215 216 217 218 | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | + + + + + | * \param block A block which determines if the object should be in the new * dictionary * \return A new, autoreleased OFDictionary */ - (OFDictionary*)filteredDictionaryUsingBlock: (of_dictionary_filter_block_t)block; #endif #ifdef OF_SET_M - _initWithDictionary: (OFDictionary*)dictionary copyKeys: (BOOL)copyKeys; #endif @end @interface OFDictionaryEnumerator: OFEnumerator { OFDictionary *dictionary; struct of_dictionary_bucket **data; uint32_t size; |
︙ |
Modified src/OFDictionary.m from [58ee7d242e] to [78f590ebf2].
︙ | |||
87 88 89 90 91 92 93 | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | - + + - + + - + + | [self release]; @throw e; } return self; } |
︙ | |||
138 139 140 141 142 143 144 145 146 147 148 149 150 151 | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | + + + + + + | } @catch (id e) { [self release]; @throw e; } return self; } - initWithDictionary: (OFDictionary*)dictionary { return [self _initWithDictionary: dictionary copyKeys: YES]; } - initWithObject: (id)object forKey: (id <OFCopying>)key { self = [super init]; @try { |
︙ | |||
779 780 781 782 783 784 785 | 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 | - + | OFMutableString *ret; OFAutoreleasePool *pool, *pool2; OFEnumerator *keyEnumerator, *objectEnumerator; id key, object; size_t i; if (count == 0) |
︙ |
Modified src/OFMutableDictionary.h from [17f7dd7a1c] to [7317469848].
︙ | |||
50 51 52 53 54 55 56 57 | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | + + + + + + | /** * \brief Replaces each object with the object returned by the block. * * \param block The block which returns a new object for each object */ - (void)replaceObjectsUsingBlock: (of_dictionary_replace_block_t)block; #endif #if defined(OF_SET_M) || defined(OF_MUTABLE_SET_M) - (void)_setObject: (id)object forKey: (id)key copyKey: (BOOL)copyKey; #endif @end |
Modified src/OFMutableDictionary.m from [9f66c7a554] to [77b424abe9].
︙ | |||
83 84 85 86 87 88 89 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | - - + + + | } [self freeMemory: data]; data = newData; size = newSize; } |
︙ | |||
144 145 146 147 148 149 150 | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | - + | if (i >= last) @throw [OFOutOfRangeException newWithClass: isa]; bucket = [self allocMemoryWithSize: sizeof(*bucket)]; @try { |
︙ | |||
171 172 173 174 175 176 177 178 179 180 181 182 183 184 | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | + + + + + + + + | return; } old = data[i]->object; data[i]->object = [object retain]; [old release]; } - (void)setObject: (id)object forKey: (id <OFCopying>)key { [self _setObject: object forKey: key copyKey: YES]; } - (void)removeObjectForKey: (id <OFCopying>)key { uint32_t i, hash, last; if (key == nil) @throw [OFInvalidArgumentException newWithClass: isa |
︙ |
Added src/OFMutableSet.h version [7c8ba2472f].
|
Added src/OFMutableSet.m version [b2021bf947].
|
Added src/OFSet.h version [1df2b6e5f6].