Overview
Comment: | Add OFURL class. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
164c76c0cf88b52e1ac99b6a71113a75 |
User & Date: | js on 2011-01-14 12:22:59 |
Other Links: | manifest | tags |
Context
2011-01-15
| ||
16:14 | Fix a missing include. check-in: b5da55a84c user: js tags: trunk | |
2011-01-14
| ||
12:22 | Add OFURL class. check-in: 164c76c0cf user: js tags: trunk | |
11:01 |
It can never happen that we don't have threads and atomic ops. If we don't have threads, everything is atomic. check-in: c50d483262 user: js tags: trunk | |
Changes
Modified ObjFW.xcodeproj/project.pbxproj from [9b445ea901] to [0a6858be47].
︙ | ︙ | |||
120 121 122 123 124 125 126 127 128 129 130 131 132 133 | 4B0108C910EB8C9300631877 /* OFEnumerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFEnumerator.h; path = src/OFEnumerator.h; sourceTree = "<group>"; }; 4B0108CA10EB8C9300631877 /* OFEnumerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFEnumerator.m; path = src/OFEnumerator.m; sourceTree = "<group>"; }; 4B0D249411DFAA3D00ED6FFC /* OFXMLElementBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFXMLElementBuilder.h; path = src/OFXMLElementBuilder.h; sourceTree = "<group>"; }; 4B0D249511DFAA3D00ED6FFC /* OFXMLElementBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFXMLElementBuilder.m; path = src/OFXMLElementBuilder.m; sourceTree = "<group>"; }; 4B175C1D116D130B003C99CB /* OFApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFApplication.h; path = src/OFApplication.h; sourceTree = "<group>"; }; 4B175C1E116D130B003C99CB /* OFApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFApplication.m; path = src/OFApplication.m; sourceTree = "<group>"; }; 4B4986DF1101F64500A2CFDA /* objc_properties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = objc_properties.m; path = src/objc_properties.m; sourceTree = "<group>"; }; 4B6799561099E7C50041064A /* asprintf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = asprintf.h; path = src/asprintf.h; sourceTree = "<group>"; }; 4B6799581099E7C50041064A /* objc_sync.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = objc_sync.m; path = src/objc_sync.m; sourceTree = "<group>"; }; 4B67995A1099E7C50041064A /* OFArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFArray.h; path = src/OFArray.h; sourceTree = "<group>"; }; 4B67995B1099E7C50041064A /* OFArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFArray.m; path = src/OFArray.m; sourceTree = "<group>"; }; 4B67995C1099E7C50041064A /* OFAutoreleasePool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFAutoreleasePool.h; path = src/OFAutoreleasePool.h; sourceTree = "<group>"; }; 4B67995D1099E7C50041064A /* OFAutoreleasePool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFAutoreleasePool.m; path = src/OFAutoreleasePool.m; sourceTree = "<group>"; }; 4B6799601099E7C50041064A /* OFDataArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFDataArray.h; path = src/OFDataArray.h; sourceTree = "<group>"; }; | > > | 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | 4B0108C910EB8C9300631877 /* OFEnumerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFEnumerator.h; path = src/OFEnumerator.h; sourceTree = "<group>"; }; 4B0108CA10EB8C9300631877 /* OFEnumerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFEnumerator.m; path = src/OFEnumerator.m; sourceTree = "<group>"; }; 4B0D249411DFAA3D00ED6FFC /* OFXMLElementBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFXMLElementBuilder.h; path = src/OFXMLElementBuilder.h; sourceTree = "<group>"; }; 4B0D249511DFAA3D00ED6FFC /* OFXMLElementBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFXMLElementBuilder.m; path = src/OFXMLElementBuilder.m; sourceTree = "<group>"; }; 4B175C1D116D130B003C99CB /* OFApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFApplication.h; path = src/OFApplication.h; sourceTree = "<group>"; }; 4B175C1E116D130B003C99CB /* OFApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFApplication.m; path = src/OFApplication.m; sourceTree = "<group>"; }; 4B4986DF1101F64500A2CFDA /* objc_properties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = objc_properties.m; path = src/objc_properties.m; sourceTree = "<group>"; }; 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; }; 4B6799561099E7C50041064A /* asprintf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = asprintf.h; path = src/asprintf.h; sourceTree = "<group>"; }; 4B6799581099E7C50041064A /* objc_sync.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = objc_sync.m; path = src/objc_sync.m; sourceTree = "<group>"; }; 4B67995A1099E7C50041064A /* OFArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFArray.h; path = src/OFArray.h; sourceTree = "<group>"; }; 4B67995B1099E7C50041064A /* OFArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFArray.m; path = src/OFArray.m; sourceTree = "<group>"; }; 4B67995C1099E7C50041064A /* OFAutoreleasePool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFAutoreleasePool.h; path = src/OFAutoreleasePool.h; sourceTree = "<group>"; }; 4B67995D1099E7C50041064A /* OFAutoreleasePool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFAutoreleasePool.m; path = src/OFAutoreleasePool.m; sourceTree = "<group>"; }; 4B6799601099E7C50041064A /* OFDataArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFDataArray.h; path = src/OFDataArray.h; sourceTree = "<group>"; }; |
︙ | ︙ | |||
205 206 207 208 209 210 211 212 213 214 215 216 217 218 | 4BD86D811237A6C600ED9912 /* OFBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFBlock.m; path = src/OFBlock.m; sourceTree = SOURCE_ROOT; }; 4BE5F0D712DF4225005C7A0C /* OFConstantString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFConstantString.h; path = src/OFConstantString.h; sourceTree = SOURCE_ROOT; }; 4BE5F0D812DF4225005C7A0C /* OFConstantString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFConstantString.m; path = src/OFConstantString.m; sourceTree = SOURCE_ROOT; }; 4BE5F0D912DF4225005C7A0C /* OFDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFDate.h; path = src/OFDate.h; sourceTree = SOURCE_ROOT; }; 4BE5F0DA12DF4225005C7A0C /* OFDate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDate.m; path = src/OFDate.m; sourceTree = SOURCE_ROOT; }; 4BE5F0E412DF4259005C7A0C /* OFBlockTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFBlockTests.m; path = tests/OFBlockTests.m; sourceTree = SOURCE_ROOT; }; 4BE5F0E512DF4259005C7A0C /* OFDateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDateTests.m; path = tests/OFDateTests.m; sourceTree = SOURCE_ROOT; }; 4BF1BCBF11C9663F0025511F /* objfw-defs.h.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "objfw-defs.h.in"; path = "src/objfw-defs.h.in"; sourceTree = "<group>"; }; 4BF1BCC011C9663F0025511F /* OFHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFHash.h; path = src/OFHash.h; sourceTree = "<group>"; }; 4BF1BCC111C9663F0025511F /* OFHash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFHash.m; path = src/OFHash.m; sourceTree = "<group>"; }; 4BF1BCC211C9663F0025511F /* OFMD5Hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMD5Hash.h; path = src/OFMD5Hash.h; sourceTree = "<group>"; }; 4BF1BCC311C9663F0025511F /* OFMD5Hash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMD5Hash.m; path = src/OFMD5Hash.m; sourceTree = "<group>"; }; 4BF1BCC411C9663F0025511F /* OFSHA1Hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFSHA1Hash.h; path = src/OFSHA1Hash.h; sourceTree = "<group>"; }; 4BF1BCC511C9663F0025511F /* OFSHA1Hash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSHA1Hash.m; path = src/OFSHA1Hash.m; sourceTree = "<group>"; }; | > | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | 4BD86D811237A6C600ED9912 /* OFBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFBlock.m; path = src/OFBlock.m; sourceTree = SOURCE_ROOT; }; 4BE5F0D712DF4225005C7A0C /* OFConstantString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFConstantString.h; path = src/OFConstantString.h; sourceTree = SOURCE_ROOT; }; 4BE5F0D812DF4225005C7A0C /* OFConstantString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFConstantString.m; path = src/OFConstantString.m; sourceTree = SOURCE_ROOT; }; 4BE5F0D912DF4225005C7A0C /* OFDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFDate.h; path = src/OFDate.h; sourceTree = SOURCE_ROOT; }; 4BE5F0DA12DF4225005C7A0C /* OFDate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDate.m; path = src/OFDate.m; sourceTree = SOURCE_ROOT; }; 4BE5F0E412DF4259005C7A0C /* OFBlockTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFBlockTests.m; path = tests/OFBlockTests.m; sourceTree = SOURCE_ROOT; }; 4BE5F0E512DF4259005C7A0C /* OFDateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDateTests.m; path = tests/OFDateTests.m; sourceTree = SOURCE_ROOT; }; 4BF0749512DFAFCA00A4ADD1 /* OFURLTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFURLTests.m; path = tests/OFURLTests.m; sourceTree = SOURCE_ROOT; }; 4BF1BCBF11C9663F0025511F /* objfw-defs.h.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "objfw-defs.h.in"; path = "src/objfw-defs.h.in"; sourceTree = "<group>"; }; 4BF1BCC011C9663F0025511F /* OFHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFHash.h; path = src/OFHash.h; sourceTree = "<group>"; }; 4BF1BCC111C9663F0025511F /* OFHash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFHash.m; path = src/OFHash.m; sourceTree = "<group>"; }; 4BF1BCC211C9663F0025511F /* OFMD5Hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMD5Hash.h; path = src/OFMD5Hash.h; sourceTree = "<group>"; }; 4BF1BCC311C9663F0025511F /* OFMD5Hash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMD5Hash.m; path = src/OFMD5Hash.m; sourceTree = "<group>"; }; 4BF1BCC411C9663F0025511F /* OFSHA1Hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFSHA1Hash.h; path = src/OFSHA1Hash.h; sourceTree = "<group>"; }; 4BF1BCC511C9663F0025511F /* OFSHA1Hash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSHA1Hash.m; path = src/OFSHA1Hash.m; sourceTree = "<group>"; }; |
︙ | ︙ | |||
303 304 305 306 307 308 309 310 311 312 313 314 315 316 | 4BF1BCCB11C9663F0025511F /* OFString+XMLEscaping.m */, 4BF1BCCC11C9663F0025511F /* OFString+XMLUnescaping.h */, 4BF1BCCD11C9663F0025511F /* OFString+XMLUnescaping.m */, 4B6799811099E7C50041064A /* OFTCPSocket.h */, 4B6799821099E7C50041064A /* OFTCPSocket.m */, 4B6799831099E7C50041064A /* OFThread.h */, 4B6799841099E7C50041064A /* OFThread.m */, 4BF1BCCE11C9663F0025511F /* OFXMLAttribute.h */, 4BF1BCCF11C9663F0025511F /* OFXMLAttribute.m */, 4B6799871099E7C50041064A /* OFXMLElement.h */, 4B6799881099E7C50041064A /* OFXMLElement.m */, 4B0D249411DFAA3D00ED6FFC /* OFXMLElementBuilder.h */, 4B0D249511DFAA3D00ED6FFC /* OFXMLElementBuilder.m */, 4B6799891099E7C50041064A /* OFXMLParser.h */, | > > | 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | 4BF1BCCB11C9663F0025511F /* OFString+XMLEscaping.m */, 4BF1BCCC11C9663F0025511F /* OFString+XMLUnescaping.h */, 4BF1BCCD11C9663F0025511F /* OFString+XMLUnescaping.m */, 4B6799811099E7C50041064A /* OFTCPSocket.h */, 4B6799821099E7C50041064A /* OFTCPSocket.m */, 4B6799831099E7C50041064A /* OFThread.h */, 4B6799841099E7C50041064A /* OFThread.m */, 4B4A61F212DF5EA20048F3F2 /* OFURL.h */, 4B4A61F312DF5EA20048F3F2 /* OFURL.m */, 4BF1BCCE11C9663F0025511F /* OFXMLAttribute.h */, 4BF1BCCF11C9663F0025511F /* OFXMLAttribute.m */, 4B6799871099E7C50041064A /* OFXMLElement.h */, 4B6799881099E7C50041064A /* OFXMLElement.m */, 4B0D249411DFAA3D00ED6FFC /* OFXMLElementBuilder.h */, 4B0D249511DFAA3D00ED6FFC /* OFXMLElementBuilder.m */, 4B6799891099E7C50041064A /* OFXMLParser.h */, |
︙ | ︙ | |||
349 350 351 352 353 354 355 356 357 358 359 360 361 362 | 4B6EF6751235358D0076B512 /* OFObjectTests.m */, 4B6EF6761235358D0076B512 /* OFPluginTests.m */, 4B6EF6771235358D0076B512 /* OFSHA1HashTests.m */, 4B6EF6781235358D0076B512 /* OFStreamTests.m */, 4B6EF6791235358D0076B512 /* OFStringTests.m */, 4B6EF67A1235358D0076B512 /* OFTCPSocketTests.m */, 4B6EF67B1235358D0076B512 /* OFThreadTests.m */, 4B6EF67C1235358D0076B512 /* OFXMLElementBuilderTests.m */, 4B6EF67D1235358D0076B512 /* OFXMLElementTests.m */, 4B6EF67E1235358D0076B512 /* OFXMLParserTests.m */, 4B6EF67F1235358D0076B512 /* PropertiesTests.m */, 4B6EF6801235358D0076B512 /* TestsAppDelegate.h */, 4B6EF6811235358D0076B512 /* TestsAppDelegate.m */, ); | > | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | 4B6EF6751235358D0076B512 /* OFObjectTests.m */, 4B6EF6761235358D0076B512 /* OFPluginTests.m */, 4B6EF6771235358D0076B512 /* OFSHA1HashTests.m */, 4B6EF6781235358D0076B512 /* OFStreamTests.m */, 4B6EF6791235358D0076B512 /* OFStringTests.m */, 4B6EF67A1235358D0076B512 /* OFTCPSocketTests.m */, 4B6EF67B1235358D0076B512 /* OFThreadTests.m */, 4BF0749512DFAFCA00A4ADD1 /* OFURLTests.m */, 4B6EF67C1235358D0076B512 /* OFXMLElementBuilderTests.m */, 4B6EF67D1235358D0076B512 /* OFXMLElementTests.m */, 4B6EF67E1235358D0076B512 /* OFXMLParserTests.m */, 4B6EF67F1235358D0076B512 /* PropertiesTests.m */, 4B6EF6801235358D0076B512 /* TestsAppDelegate.h */, 4B6EF6811235358D0076B512 /* TestsAppDelegate.m */, ); |
︙ | ︙ |
Modified src/Makefile from [166d734b1c] to [b73e183993].
︙ | ︙ | |||
33 34 35 36 37 38 39 40 41 42 43 44 45 46 | OFString.m \ OFString+Hashing.m \ OFString+URLEncoding.m \ OFString+XMLEscaping.m \ OFString+XMLUnescaping.m \ OFTCPSocket.m \ ${OFTHREAD_M} \ OFXMLAttribute.m \ OFXMLElement.m \ OFXMLElementBuilder.m \ OFXMLParser.m \ unicode.m INCLUDES := ${SRCS:.m=.h} \ | > | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | OFString.m \ OFString+Hashing.m \ OFString+URLEncoding.m \ OFString+XMLEscaping.m \ OFString+XMLUnescaping.m \ OFTCPSocket.m \ ${OFTHREAD_M} \ OFURL.m \ OFXMLAttribute.m \ OFXMLElement.m \ OFXMLElementBuilder.m \ OFXMLParser.m \ unicode.m INCLUDES := ${SRCS:.m=.h} \ |
︙ | ︙ |
Modified src/OFExceptions.h from [24104f796c] to [a9ea4a0db3].
︙ | ︙ | |||
15 16 17 18 19 20 21 22 23 24 25 26 27 28 | */ #include <sys/types.h> #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. | > | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | */ #include <sys/types.h> #import "OFObject.h" @class OFString; @class OFURL; /** * \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. |
︙ | ︙ | |||
1225 1226 1227 1228 1229 1230 1231 | * \param prefix The prefix which is unbound * \return A new unbound namespace exception */ + newWithClass: (Class)class_ prefix: (OFString*)prefix; /** | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 | * \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 |
Modified src/OFExceptions.m from [537ffd5aae] to [8d877139a9].
︙ | ︙ | |||
1843 1844 1845 1846 1847 1848 1849 | } - (OFString*)prefix { return prefix; } @end | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 | } - (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 %s is not supported by class %s", [[URL description] cString], class_getName(inClass)]; return description; } - (OFURL*)URL { return URL; } @end |
Added src/OFURL.h version [e36be7b9d6].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | /* * Copyright (c) 2008, 2009, 2010, 2011 * Jonathan Schleifer <js@webkeks.org> * * 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 A class for parsing URLs and accessing parts of it. */ @interface OFURL: OFObject <OFCopying> { OFString *scheme; OFString *host; uint16_t port; OFString *user; OFString *password; OFString *path; OFString *parameters; OFString *query; OFString *fragment; } #ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *scheme; @property (readonly, copy) OFString *host; @property (readonly, assign) uint16_t port; @property (readonly, copy) OFString *user; @property (readonly, copy) OFString *password; @property (readonly, copy) OFString *path; @property (readonly, copy) OFString *parameters; @property (readonly, copy) OFString *query; @property (readonly, copy) OFString *fragment; #endif /** * \param str A string describing an URL * \return A new, autoreleased OFURL */ + URLWithString: (OFString*)str; /** * Initializes an already allocated OFURL. * * \param str A string describing an URL * \return An initialized OFURL */ - initWithString: (OFString*)str; /** * \return The scheme part of the URL */ - (OFString*)scheme; /** * \return The host part of the URL */ - (OFString*)host; /** * \return The port part of the URL */ - (uint16_t)port; /** * \return The user part of the URL */ - (OFString*)user; /** * \return The password part of the URL */ - (OFString*)password; /** * \return The path part of the URL */ - (OFString*)path; /** * \return The parameters part of the URL */ - (OFString*)parameters; /** * \return The query part of the URL */ - (OFString*)query; /** * \return The fragment part of the URL */ - (OFString*)fragment; @end |
Added src/OFURL.m version [5ee125a04b].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | /* * Copyright (c) 2008, 2009, 2010, 2011 * Jonathan Schleifer <js@webkeks.org> * * 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" #include <stdlib.h> #include <string.h> #include <assert.h> #import "OFURL.h" #import "OFString.h" #import "OFAutoreleasePool.h" #import "OFExceptions.h" @implementation OFURL + URLWithString: (OFString*)str { return [[[self alloc] initWithString: str] autorelease]; } - initWithString: (OFString*)str { char *str_c, *str_c2 = NULL; self = [super init]; @try { char *tmp, *tmp2; if ((str_c2 = strdup([str cString])) == NULL) @throw [OFOutOfMemoryException newWithClass: isa requestedSize: [str cStringLength]]; str_c = str_c2; if (!strncmp(str_c, "http://", 7)) { scheme = @"http"; str_c += 7; } else if (!strncmp(str_c, "https://", 8)) { scheme = @"https"; str_c += 8; } else @throw [OFInvalidFormatException newWithClass: isa]; if ((tmp = strchr(str_c, '/')) != NULL) { *tmp = '\0'; tmp++; } if ((tmp2 = strchr(str_c, '@')) != NULL) { char *tmp3; *tmp2 = '\0'; tmp2++; if ((tmp3 = strchr(str_c, ':')) != NULL) { *tmp3 = '\0'; tmp3++; user = [[OFString alloc] initWithCString: str_c]; password = [[OFString alloc] initWithCString: tmp3]; } else user = [[OFString alloc] initWithCString: str_c]; str_c = tmp2; } if ((tmp2 = strchr(str_c, ':')) != NULL) { OFAutoreleasePool *pool; OFString *port_str; *tmp2 = '\0'; tmp2++; host = [[OFString alloc] initWithCString: str_c]; pool = [[OFAutoreleasePool alloc] init]; port_str = [[OFString alloc] initWithCString: tmp2]; if ([port_str decimalValue] > 65535) @throw [OFInvalidFormatException newWithClass: isa]; port = [port_str decimalValue]; [pool release]; } else { host = [[OFString alloc] initWithCString: str_c]; if ([scheme isEqual: @"http"]) port = 80; else if ([scheme isEqual: @"https"]) port = 443; else assert(0); } if ((str_c = tmp) != NULL) { if ((tmp = strchr(str_c, '#')) != NULL) { *tmp = '\0'; fragment = [[OFString alloc] initWithCString: tmp + 1]; } if ((tmp = strchr(str_c, '?')) != NULL) { *tmp = '\0'; query = [[OFString alloc] initWithCString: tmp + 1]; } if ((tmp = strchr(str_c, ';')) != NULL) { *tmp = '\0'; parameters = [[OFString alloc] initWithCString: tmp + 1]; } path = [[OFString alloc] initWithCString: str_c]; } } @catch (id e) { [self release]; @throw e; } @finally { if (str_c2 != NULL) free(str_c2); } return self; } - (void)dealloc { [scheme release]; [host release]; [user release]; [password release]; [path release]; [parameters release]; [query release]; [fragment release]; [super dealloc]; } - (BOOL)isEqual: (id)obj { OFURL *url; if (![obj isKindOfClass: [OFURL class]]) return NO; url = obj; if (![url->scheme isEqual: scheme]) return NO; if (![url->host isEqual: host]) return NO; if (url->port != port) return NO; if (![url->user isEqual: user]) return NO; if (![url->password isEqual: password]) return NO; if (![url->path isEqual: path]) return NO; if (![url->parameters isEqual: parameters]) return NO; if (![url->query isEqual: query]) return NO; if (![url->fragment isEqual: fragment]) return NO; return YES; } - copy { OFURL *new = [[OFURL alloc] init]; new->scheme = [scheme copy]; new->host = [host copy]; new->port = port; new->user = [user copy]; new->password = [password copy]; new->path = [path copy]; new->parameters = [parameters copy]; new->query = [query copy]; new->fragment = [fragment copy]; return new; } - (OFString*)scheme { return [[scheme copy] autorelease]; } - (OFString*)host { return [[host copy] autorelease]; } - (uint16_t)port { return port; } - (OFString*)user { return [[user copy] autorelease]; } - (OFString*)password { return [[password copy] autorelease]; } - (OFString*)path { return [[path copy] autorelease]; } - (OFString*)parameters { return [[parameters copy] autorelease]; } - (OFString*)query { return [[query copy] autorelease]; } - (OFString*)fragment { return [[fragment copy] autorelease]; } - (OFString*)description { OFMutableString *desc = [OFMutableString stringWithFormat: @"%s://", [scheme cString]]; BOOL needPort = YES; if (user != nil && password != nil) [desc appendFormat: @"%s:%s@", [user cString], [password cString]]; else if (user != nil) [desc appendFormat: @"%s@", [user cString]]; [desc appendString: host]; if (([scheme isEqual: @"http"] && port == 80) || ([scheme isEqual: @"https"] && port == 443)) needPort = NO; if (needPort) [desc appendFormat: @":%d", port]; if (path != nil) [desc appendFormat: @"/%s", [path cString]]; if (parameters != nil) [desc appendFormat: @";%s", [parameters cString]]; if (query != nil) [desc appendFormat: @"?%s", [query cString]]; if (fragment != nil) [desc appendFormat: @"#%s", [fragment cString]]; return desc; } @end |
Modified src/ObjFW.h from [6658b11f76] to [f49c5a28b5].
︙ | ︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #import "OFList.h" #import "OFDictionary.h" #import "OFEnumerator.h" #import "OFNumber.h" #import "OFDate.h" #import "OFStream.h" #import "OFStreamObserver.h" #import "OFFile.h" #import "OFStreamSocket.h" | > | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #import "OFList.h" #import "OFDictionary.h" #import "OFEnumerator.h" #import "OFNumber.h" #import "OFDate.h" #import "OFURL.h" #import "OFStream.h" #import "OFStreamObserver.h" #import "OFFile.h" #import "OFStreamSocket.h" |
︙ | ︙ |
Modified tests/Makefile from [0d381940f6] to [a08a8e85cd].
︙ | ︙ | |||
15 16 17 18 19 20 21 22 23 24 25 26 27 28 | OFObjectTests.m \ ${OFPLUGINTESTS_M} \ OFSHA1HashTests.m \ OFStreamTests.m \ OFStringTests.m \ OFTCPSocketTests.m \ ${OFTHREADTESTS_M} \ OFXMLElementTests.m \ OFXMLElementBuilderTests.m \ OFXMLParserTests.m \ ${PROPERTIESTESTS_M} \ TestsAppDelegate.m IOS_USER ?= mobile | > | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | OFObjectTests.m \ ${OFPLUGINTESTS_M} \ OFSHA1HashTests.m \ OFStreamTests.m \ OFStringTests.m \ OFTCPSocketTests.m \ ${OFTHREADTESTS_M} \ OFURLTests.m \ OFXMLElementTests.m \ OFXMLElementBuilderTests.m \ OFXMLParserTests.m \ ${PROPERTIESTESTS_M} \ TestsAppDelegate.m IOS_USER ?= mobile |
︙ | ︙ |
Added tests/OFURLTests.m version [8e8ba2b5ac].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | /* * Copyright (c) 2008, 2009, 2010, 2011 * Jonathan Schleifer <js@webkeks.org> * * 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 "OFURL.h" #import "OFString.h" #import "OFAutoreleasePool.h" #import "OFExceptions.h" #import "TestsAppDelegate.h" static OFString *module = @"OFURL"; static OFString *url_str = @"http://u:p@h:1234/f;p?q#f"; @implementation TestsAppDelegate (OFURLTests) - (void)URLTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFURL *u1, *u2, *u3, *u4; TEST(@"+[URLWithString:]", R(u1 = [OFURL URLWithString: url_str]) && R(u2 = [OFURL URLWithString: @"http://foo:80"]) && R(u3 = [OFURL URLWithString: @"http://bar/"])) TEST(@"-[description]", [[u1 description] isEqual: url_str] && [[u2 description] isEqual: @"http://foo"] && [[u3 description] isEqual: @"http://bar/"]) TEST(@"-[scheme]", [[u1 scheme] isEqual: @"http"]) TEST(@"-[user]", [[u1 user] isEqual: @"u"]) TEST(@"-[password]", [[u1 password] isEqual: @"p"]) TEST(@"-[host]", [[u1 host] isEqual: @"h"]) TEST(@"-[port]", [u1 port] == 1234) TEST(@"-[path]", [[u1 path] isEqual: @"f"]) TEST(@"-[parameters]", [[u1 parameters] isEqual: @"p"]) TEST(@"-[query]", [[u1 query] isEqual: @"q"]) TEST(@"-[fragment]", [[u1 fragment] isEqual: @"f"]) TEST(@"-[copy]", R(u4 = [[u1 copy] autorelease])) TEST(@"-[isEqual:]", [u1 isEqual: u4] && ![u2 isEqual: u3]) EXPECT_EXCEPTION(@"Detection of invalid format", OFInvalidFormatException, [OFURL URLWithString: @"http"]) EXPECT_EXCEPTION(@"Detection of invalid scheme", OFInvalidFormatException, [OFURL URLWithString: @"foo://"]) [pool drain]; } @end |
Modified tests/TestsAppDelegate.h from [5d13558604] to [a04c79d77f].
︙ | ︙ | |||
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | @interface TestsAppDelegate (OFTCPSocketTests) - (void)TCPSocketTests; @end @interface TestsAppDelegate (OFThreadTests) - (void)threadTests; @end @interface TestsAppDelegate (OFXMLElementTests) - (void)XMLElementTests; @end @interface TestsAppDelegate (OFXMLElementBuilderTests) - (void)XMLElementBuilderTests; @end @interface TestsAppDelegate (OFXMLParserTests) <OFXMLElementBuilderDelegate> - (void)XMLParserTests; @end | > > > > | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | @interface TestsAppDelegate (OFTCPSocketTests) - (void)TCPSocketTests; @end @interface TestsAppDelegate (OFThreadTests) - (void)threadTests; @end @interface TestsAppDelegate (OFURLTests) - (void)URLTests; @end @interface TestsAppDelegate (OFXMLElementTests) - (void)XMLElementTests; @end @interface TestsAppDelegate (OFXMLElementBuilderTests) - (void)XMLElementBuilderTests; @end @interface TestsAppDelegate (OFXMLParserTests) <OFXMLElementBuilderDelegate> - (void)XMLParserTests; @end |
Modified tests/TestsAppDelegate.m from [ea82a9c512] to [b9118f60e0].
︙ | ︙ | |||
98 99 100 101 102 103 104 105 106 107 108 109 110 111 | [self dateTests]; [self numberTests]; [self streamTests]; [self TCPSocketTests]; #ifdef OF_THREADS [self threadTests]; #endif [self XMLElementTests]; [self XMLParserTests]; [self XMLElementBuilderTests]; #ifdef OF_PLUGINS [self pluginTests]; #endif #ifdef OF_HAVE_PROPERTIES | > | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | [self dateTests]; [self numberTests]; [self streamTests]; [self TCPSocketTests]; #ifdef OF_THREADS [self threadTests]; #endif [self URLTests]; [self XMLElementTests]; [self XMLParserTests]; [self XMLElementBuilderTests]; #ifdef OF_PLUGINS [self pluginTests]; #endif #ifdef OF_HAVE_PROPERTIES |
︙ | ︙ |