ObjFW  Check-in [c0f28cf861]

Overview
Comment:Add OFSortedList.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c0f28cf861432f5e35c99e47b6b8b244737bec39e9231e77905aef70dcd18ca6
User & Date: js on 2012-09-09 14:36:27
Other Links: manifest | tags
Context
2012-09-09
17:48
Make the main thread an OFThread. check-in: ead7b7acd3 user: js tags: trunk
14:36
Add OFSortedList. check-in: c0f28cf861 user: js tags: trunk
14:36
OFNumber: Implement OFComparing. check-in: 56df9c44de user: js tags: trunk
Changes

Modified ObjFW.xcodeproj/project.pbxproj from [20611be222] to [4e3da9bce2].

31
32
33
34
35
36
37


38
39
40
41
42
43
44
			productName = configure;
		};
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
		4B11005C14329B9A003A45D8 /* OFXMLNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B11005A14329B9A003A45D8 /* OFXMLNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B11005D14329B9A003A45D8 /* OFXMLNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B11005B14329B9A003A45D8 /* OFXMLNode.m */; };


		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, ); }; };







>
>







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
			productName = configure;
		};
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
		4B11005C14329B9A003A45D8 /* OFXMLNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B11005A14329B9A003A45D8 /* OFXMLNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B11005D14329B9A003A45D8 /* OFXMLNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B11005B14329B9A003A45D8 /* OFXMLNode.m */; };
		4B141BA415FCDF74000C21A8 /* OFSortedList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B141BA215FCDF74000C21A8 /* OFSortedList.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B141BA515FCDF74000C21A8 /* OFSortedList.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B141BA315FCDF74000C21A8 /* OFSortedList.m */; };
		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, ); }; };
402
403
404
405
406
407
408


409
410
411
412
413
414
415
/* Begin PBXFileReference section */
		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>"; };
		4B11005A14329B9A003A45D8 /* OFXMLNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFXMLNode.h; path = src/OFXMLNode.h; sourceTree = "<group>"; };
		4B11005B14329B9A003A45D8 /* OFXMLNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFXMLNode.m; path = src/OFXMLNode.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>"; };
		4B17FF70133A28FC003E6DCD /* OFException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFException.h; path = src/exceptions/OFException.h; sourceTree = "<group>"; };
		4B17FF71133A28FC003E6DCD /* OFException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFException.m; path = src/exceptions/OFException.m; sourceTree = "<group>"; };
		4B17FF75133A2B18003E6DCD /* OFNotImplementedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFNotImplementedException.h; path = src/exceptions/OFNotImplementedException.h; sourceTree = "<group>"; };
		4B17FF76133A2B18003E6DCD /* OFNotImplementedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFNotImplementedException.m; path = src/exceptions/OFNotImplementedException.m; sourceTree = "<group>"; };
		4B17FF79133A2C14003E6DCD /* OFOutOfRangeException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFOutOfRangeException.h; path = src/exceptions/OFOutOfRangeException.h; sourceTree = "<group>"; };







>
>







404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
/* Begin PBXFileReference section */
		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>"; };
		4B11005A14329B9A003A45D8 /* OFXMLNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFXMLNode.h; path = src/OFXMLNode.h; sourceTree = "<group>"; };
		4B11005B14329B9A003A45D8 /* OFXMLNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFXMLNode.m; path = src/OFXMLNode.m; sourceTree = "<group>"; };
		4B141BA215FCDF74000C21A8 /* OFSortedList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFSortedList.h; path = src/OFSortedList.h; sourceTree = "<group>"; };
		4B141BA315FCDF74000C21A8 /* OFSortedList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSortedList.m; path = src/OFSortedList.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>"; };
		4B17FF70133A28FC003E6DCD /* OFException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFException.h; path = src/exceptions/OFException.h; sourceTree = "<group>"; };
		4B17FF71133A28FC003E6DCD /* OFException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFException.m; path = src/exceptions/OFException.m; sourceTree = "<group>"; };
		4B17FF75133A2B18003E6DCD /* OFNotImplementedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFNotImplementedException.h; path = src/exceptions/OFNotImplementedException.h; sourceTree = "<group>"; };
		4B17FF76133A2B18003E6DCD /* OFNotImplementedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFNotImplementedException.m; path = src/exceptions/OFNotImplementedException.m; sourceTree = "<group>"; };
		4B17FF79133A2C14003E6DCD /* OFOutOfRangeException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFOutOfRangeException.h; path = src/exceptions/OFOutOfRangeException.h; sourceTree = "<group>"; };
981
982
983
984
985
986
987


988
989
990
991
992
993
994
				4B989C2E13771A3700109A30 /* OFSerialization.h */,
				4B39844013D3A24600E6F825 /* OFSet.h */,
				4B39844113D3A24600E6F825 /* OFSet.m */,
				4BA85BC8140ECCE800E91D51 /* OFSet_hashtable.h */,
				4BA85BC9140ECCE800E91D51 /* OFSet_hashtable.m */,
				4BF1BCC411C9663F0025511F /* OFSHA1Hash.h */,
				4BF1BCC511C9663F0025511F /* OFSHA1Hash.m */,


				4B67997D1099E7C50041064A /* OFStream.h */,
				4B67997E1099E7C50041064A /* OFStream.m */,
				4BAF5F47123460C900F4E111 /* OFStreamObserver.h */,
				4BAF5F48123460C900F4E111 /* OFStreamObserver.m */,
				4B83F0F2142FDEFD00E4A821 /* OFStreamObserver_kqueue.h */,
				4B83F0F3142FDEFD00E4A821 /* OFStreamObserver_kqueue.m */,
				4B64D6EB1425381E007BDFB1 /* OFStreamObserver_poll.h */,







>
>







985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
				4B989C2E13771A3700109A30 /* OFSerialization.h */,
				4B39844013D3A24600E6F825 /* OFSet.h */,
				4B39844113D3A24600E6F825 /* OFSet.m */,
				4BA85BC8140ECCE800E91D51 /* OFSet_hashtable.h */,
				4BA85BC9140ECCE800E91D51 /* OFSet_hashtable.m */,
				4BF1BCC411C9663F0025511F /* OFSHA1Hash.h */,
				4BF1BCC511C9663F0025511F /* OFSHA1Hash.m */,
				4B141BA215FCDF74000C21A8 /* OFSortedList.h */,
				4B141BA315FCDF74000C21A8 /* OFSortedList.m */,
				4B67997D1099E7C50041064A /* OFStream.h */,
				4B67997E1099E7C50041064A /* OFStream.m */,
				4BAF5F47123460C900F4E111 /* OFStreamObserver.h */,
				4BAF5F48123460C900F4E111 /* OFStreamObserver.m */,
				4B83F0F2142FDEFD00E4A821 /* OFStreamObserver_kqueue.h */,
				4B83F0F3142FDEFD00E4A821 /* OFStreamObserver_kqueue.m */,
				4B64D6EB1425381E007BDFB1 /* OFStreamObserver_poll.h */,
1186
1187
1188
1189
1190
1191
1192

1193
1194
1195
1196
1197
1198
1199
				4BB25E88139C388A00F574EA /* OFObject+Serialization.h in Headers */,
				4B3D23D21337FCB000DD29B8 /* OFPlugin.h in Headers */,
				4BB524C1143D1E4E0085FBCC /* OFProcess.h in Headers */,
				4B3D23D31337FCB000DD29B8 /* OFSeekableStream.h in Headers */,
				4B989C2F13771A3700109A30 /* OFSerialization.h in Headers */,
				4B39844213D3A24600E6F825 /* OFSet.h in Headers */,
				4B3D23D41337FCB000DD29B8 /* OFSHA1Hash.h in Headers */,

				4B3D23D51337FCB000DD29B8 /* OFStream.h in Headers */,
				4B3D23D61337FCB000DD29B8 /* OFStreamObserver.h in Headers */,
				4B3D23D71337FCB000DD29B8 /* OFStreamSocket.h in Headers */,
				4B3D23D81337FCB000DD29B8 /* OFString.h in Headers */,
				4B3D23D91337FCB000DD29B8 /* OFString+Hashing.h in Headers */,
				4B5CF8F914940BD2007AA324 /* OFString+JSONValue.h in Headers */,
				4BB25E8A139C388A00F574EA /* OFString+Serialization.h in Headers */,







>







1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
				4BB25E88139C388A00F574EA /* OFObject+Serialization.h in Headers */,
				4B3D23D21337FCB000DD29B8 /* OFPlugin.h in Headers */,
				4BB524C1143D1E4E0085FBCC /* OFProcess.h in Headers */,
				4B3D23D31337FCB000DD29B8 /* OFSeekableStream.h in Headers */,
				4B989C2F13771A3700109A30 /* OFSerialization.h in Headers */,
				4B39844213D3A24600E6F825 /* OFSet.h in Headers */,
				4B3D23D41337FCB000DD29B8 /* OFSHA1Hash.h in Headers */,
				4B141BA415FCDF74000C21A8 /* OFSortedList.h in Headers */,
				4B3D23D51337FCB000DD29B8 /* OFStream.h in Headers */,
				4B3D23D61337FCB000DD29B8 /* OFStreamObserver.h in Headers */,
				4B3D23D71337FCB000DD29B8 /* OFStreamSocket.h in Headers */,
				4B3D23D81337FCB000DD29B8 /* OFString.h in Headers */,
				4B3D23D91337FCB000DD29B8 /* OFString+Hashing.h in Headers */,
				4B5CF8F914940BD2007AA324 /* OFString+JSONValue.h in Headers */,
				4BB25E8A139C388A00F574EA /* OFString+Serialization.h in Headers */,
1480
1481
1482
1483
1484
1485
1486

1487
1488
1489
1490
1491
1492
1493
				4BB25E89139C388A00F574EA /* OFObject+Serialization.m in Sources */,
				4B3D23A01337FC0D00DD29B8 /* OFPlugin.m in Sources */,
				4BB524C2143D1E4E0085FBCC /* OFProcess.m in Sources */,
				4B3D23A11337FC0D00DD29B8 /* OFSeekableStream.m in Sources */,
				4B39844313D3A24600E6F825 /* OFSet.m in Sources */,
				4BA85BCF140ECCE800E91D51 /* OFSet_hashtable.m in Sources */,
				4B3D23A21337FC0D00DD29B8 /* OFSHA1Hash.m in Sources */,

				4B3D23A31337FC0D00DD29B8 /* OFStream.m in Sources */,
				4B3D23A41337FC0D00DD29B8 /* OFStreamObserver.m in Sources */,
				4B83F0F5142FDEFD00E4A821 /* OFStreamObserver_kqueue.m in Sources */,
				4B64D6F01425381E007BDFB1 /* OFStreamObserver_poll.m in Sources */,
				4B64D6F21425381E007BDFB1 /* OFStreamObserver_select.m in Sources */,
				4B3D23A51337FC0D00DD29B8 /* OFStreamSocket.m in Sources */,
				4B3D23A61337FC0D00DD29B8 /* OFString.m in Sources */,







>







1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
				4BB25E89139C388A00F574EA /* OFObject+Serialization.m in Sources */,
				4B3D23A01337FC0D00DD29B8 /* OFPlugin.m in Sources */,
				4BB524C2143D1E4E0085FBCC /* OFProcess.m in Sources */,
				4B3D23A11337FC0D00DD29B8 /* OFSeekableStream.m in Sources */,
				4B39844313D3A24600E6F825 /* OFSet.m in Sources */,
				4BA85BCF140ECCE800E91D51 /* OFSet_hashtable.m in Sources */,
				4B3D23A21337FC0D00DD29B8 /* OFSHA1Hash.m in Sources */,
				4B141BA515FCDF74000C21A8 /* OFSortedList.m in Sources */,
				4B3D23A31337FC0D00DD29B8 /* OFStream.m in Sources */,
				4B3D23A41337FC0D00DD29B8 /* OFStreamObserver.m in Sources */,
				4B83F0F5142FDEFD00E4A821 /* OFStreamObserver_kqueue.m in Sources */,
				4B64D6F01425381E007BDFB1 /* OFStreamObserver_poll.m in Sources */,
				4B64D6F21425381E007BDFB1 /* OFStreamObserver_select.m in Sources */,
				4B3D23A51337FC0D00DD29B8 /* OFStreamSocket.m in Sources */,
				4B3D23A61337FC0D00DD29B8 /* OFString.m in Sources */,

Modified src/Makefile from [b7d5362beb] to [964b921378].

34
35
36
37
38
39
40

41
42
43
44
45
46
47
       OFObject.m			\
       OFObject+Serialization.m		\
       ${OFPLUGIN_M}			\
       OFProcess.m			\
       OFSeekableStream.m		\
       OFSet.m				\
       OFSHA1Hash.m			\

       OFStream.m			\
       OFStreamObserver.m		\
       OFStreamSocket.m			\
       OFString.m			\
       OFString+Hashing.m		\
       OFString+JSONValue.m		\
       OFString+Serialization.m		\







>







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
       OFObject.m			\
       OFObject+Serialization.m		\
       ${OFPLUGIN_M}			\
       OFProcess.m			\
       OFSeekableStream.m		\
       OFSet.m				\
       OFSHA1Hash.m			\
       OFSortedList.m			\
       OFStream.m			\
       OFStreamObserver.m		\
       OFStreamSocket.m			\
       OFString.m			\
       OFString+Hashing.m		\
       OFString+JSONValue.m		\
       OFString+Serialization.m		\

Modified src/OFList.h from [edc02fcf57] to [1e7516e1b8].

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
 */
- (of_list_object_t*)prependObject: (id)object;

/**
 * \brief Inserts an object before another list object.
 *
 * \param object The object to insert
 * \param listObject The of_list_object_t of the object before which it should be
 *	  inserted
 * \return An of_list_object_t, needed to identify the object inside the list.
 *	   For example, if you want to remove an object from the list, you need
 *	   its of_list_object_t.
 */
- (of_list_object_t*)insertObject: (id)object
		 beforeListObject: (of_list_object_t*)listObject;








|
|







92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
 */
- (of_list_object_t*)prependObject: (id)object;

/**
 * \brief Inserts an object before another list object.
 *
 * \param object The object to insert
 * \param listObject The of_list_object_t of the object before which it should
 *	  be inserted
 * \return An of_list_object_t, needed to identify the object inside the list.
 *	   For example, if you want to remove an object from the list, you need
 *	   its of_list_object_t.
 */
- (of_list_object_t*)insertObject: (id)object
		 beforeListObject: (of_list_object_t*)listObject;

Added src/OFSortedList.h version [9c74d441f5].



































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012
 *   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 "OFList.h"

/**
 * \brief A class which provides easy to use sorted double-linked lists.
 *
 * \warning Because the list is sorted, all methods inserting an object at a
 *	    specific place are unavailable, even though they exist in OFList!
 */
@interface OFSortedList: OFList
/**
 * \brief Adds the object to the list while keeping the list sorted.
 *
 * \param object The object to add
 * \return The list object for the object just added
 */
- (of_list_object_t*)addObject: (id <OFComparing>)object;
@end

Added src/OFSortedList.m version [6e89d832b7].

























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012
 *   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 "OFSortedList.h"

#import "OFNotImplementedException.h"

@implementation OFSortedList
- (of_list_object_t*)appendObject: (id)object
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
}

- (of_list_object_t*)prependObject: (id)object
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
}

- (of_list_object_t*)insertObject: (id)object
		 beforeListObject: (of_list_object_t*)listObject
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
}

- (of_list_object_t*)insertObject: (id)object
		  afterListObject: (of_list_object_t*)listObject
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
}

- (of_list_object_t*)addObject: (id <OFComparing>)object
{
	of_list_object_t *iter;

	for (iter = lastListObject; iter != NULL; iter = iter->previous) {
		if ([object compare: iter->object] == OF_ORDERED_DESCENDING)
			return [super insertObject: object
				   afterListObject: iter];
	}

	return [super prependObject: object];
}
@end

Modified src/ObjFW.h from [83c87b8540] to [0edf98a084].

22
23
24
25
26
27
28

29
30
31
32
33
34
35
#import "OFAutoreleasePool.h"
#import "OFString.h"

#import "OFDataArray.h"
#import "OFArray.h"

#import "OFList.h"


#import "OFDictionary.h"

#import "OFSet.h"
#import "OFCountedSet.h"

#import "OFEnumerator.h"







>







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#import "OFAutoreleasePool.h"
#import "OFString.h"

#import "OFDataArray.h"
#import "OFArray.h"

#import "OFList.h"
#import "OFSortedList.h"

#import "OFDictionary.h"

#import "OFSet.h"
#import "OFCountedSet.h"

#import "OFEnumerator.h"