Overview
Comment: | Move file management to its own class
This makes it possible to add support for delegates for file management |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
f3c452dfef74db21bf6fac7680ab45b9 |
User & Date: | js on 2015-08-22 10:57:14 |
Other Links: | manifest | tags |
Context
2015-08-22
| ||
11:38 | utils/ofhttp: Add includes required on Solaris check-in: ee6fb4df7f user: js tags: trunk | |
10:57 | Move file management to its own class check-in: f3c452dfef user: js tags: trunk | |
2015-08-21
| ||
17:51 | Set version to 0.9-dev check-in: 9d505a482a user: js tags: trunk | |
Changes
Modified ObjFW.xcodeproj/project.pbxproj from [5362f703c3] to [5b75f34ca3].
︙ | |||
143 144 145 146 147 148 149 150 151 152 153 154 155 156 | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | + + | 4B2B3E7E140D430500EC2F7C /* OFArray_adjacent.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2B3E74140D430500EC2F7C /* OFArray_adjacent.m */; }; 4B2B3E7F140D430500EC2F7C /* OFDictionary_hashtable.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2B3E75140D430500EC2F7C /* OFDictionary_hashtable.h */; settings = {ATTRIBUTES = (); }; }; 4B2B3E80140D430500EC2F7C /* OFDictionary_hashtable.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2B3E76140D430500EC2F7C /* OFDictionary_hashtable.m */; }; 4B2B3E81140D430500EC2F7C /* OFMutableArray_adjacent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2B3E77140D430500EC2F7C /* OFMutableArray_adjacent.h */; settings = {ATTRIBUTES = (); }; }; 4B2B3E82140D430500EC2F7C /* OFMutableArray_adjacent.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2B3E78140D430500EC2F7C /* OFMutableArray_adjacent.m */; }; 4B2B3E83140D430500EC2F7C /* OFMutableDictionary_hashtable.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2B3E79140D430500EC2F7C /* OFMutableDictionary_hashtable.h */; settings = {ATTRIBUTES = (); }; }; 4B2B3E84140D430500EC2F7C /* OFMutableDictionary_hashtable.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2B3E7A140D430500EC2F7C /* OFMutableDictionary_hashtable.m */; }; 4B2C728B1B888B8300717583 /* OFFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C72891B888B6900717583 /* OFFileManager.m */; }; 4B2C728C1B888B8700717583 /* OFFileManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2C72881B888B6900717583 /* OFFileManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B325EDD1605F3A0007836CA /* OFRunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B325ED91605F3A0007836CA /* OFRunLoop.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B325EDE1605F3A0007836CA /* OFRunLoop.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B325EDA1605F3A0007836CA /* OFRunLoop.m */; }; 4B325EDF1605F3A0007836CA /* OFTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B325EDB1605F3A0007836CA /* OFTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B325EE01605F3A0007836CA /* OFTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B325EDC1605F3A0007836CA /* OFTimer.m */; }; 4B3379CF1979326A0088E97E /* threading.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B3379CE1979326A0088E97E /* threading.m */; }; 4B35C64E1ADAD30A003DB666 /* OFObserveFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B35C64C1ADAD30A003DB666 /* OFObserveFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B35C64F1ADAD30A003DB666 /* OFObserveFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B35C64D1ADAD30A003DB666 /* OFObserveFailedException.m */; }; |
︙ | |||
655 656 657 658 659 660 661 662 663 664 665 666 667 668 | 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 | + + | 4B2B3E74140D430500EC2F7C /* OFArray_adjacent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFArray_adjacent.m; path = src/OFArray_adjacent.m; sourceTree = "<group>"; }; 4B2B3E75140D430500EC2F7C /* OFDictionary_hashtable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFDictionary_hashtable.h; path = src/OFDictionary_hashtable.h; sourceTree = "<group>"; }; 4B2B3E76140D430500EC2F7C /* OFDictionary_hashtable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDictionary_hashtable.m; path = src/OFDictionary_hashtable.m; sourceTree = "<group>"; }; 4B2B3E77140D430500EC2F7C /* OFMutableArray_adjacent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMutableArray_adjacent.h; path = src/OFMutableArray_adjacent.h; sourceTree = "<group>"; }; 4B2B3E78140D430500EC2F7C /* OFMutableArray_adjacent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMutableArray_adjacent.m; path = src/OFMutableArray_adjacent.m; sourceTree = "<group>"; }; 4B2B3E79140D430500EC2F7C /* OFMutableDictionary_hashtable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMutableDictionary_hashtable.h; path = src/OFMutableDictionary_hashtable.h; sourceTree = "<group>"; }; 4B2B3E7A140D430500EC2F7C /* OFMutableDictionary_hashtable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMutableDictionary_hashtable.m; path = src/OFMutableDictionary_hashtable.m; sourceTree = "<group>"; }; 4B2C72881B888B6900717583 /* OFFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFFileManager.h; path = src/OFFileManager.h; sourceTree = "<group>"; }; 4B2C72891B888B6900717583 /* OFFileManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFFileManager.m; path = src/OFFileManager.m; sourceTree = "<group>"; }; 4B325ED91605F3A0007836CA /* OFRunLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFRunLoop.h; path = src/OFRunLoop.h; sourceTree = "<group>"; }; 4B325EDA1605F3A0007836CA /* OFRunLoop.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFRunLoop.m; path = src/OFRunLoop.m; sourceTree = "<group>"; }; 4B325EDB1605F3A0007836CA /* OFTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFTimer.h; path = src/OFTimer.h; sourceTree = "<group>"; }; 4B325EDC1605F3A0007836CA /* OFTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFTimer.m; path = src/OFTimer.m; sourceTree = "<group>"; }; 4B3379CE1979326A0088E97E /* threading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = threading.m; path = src/threading.m; sourceTree = "<group>"; }; 4B35C64C1ADAD30A003DB666 /* OFObserveFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFObserveFailedException.h; path = src/exceptions/OFObserveFailedException.h; sourceTree = "<group>"; }; 4B35C64D1ADAD30A003DB666 /* OFObserveFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFObserveFailedException.m; path = src/exceptions/OFObserveFailedException.m; sourceTree = "<group>"; }; |
︙ | |||
1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 | 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 | + + | 4B6799631099E7C50041064A /* OFDictionary.m */, 4B2B3E75140D430500EC2F7C /* OFDictionary_hashtable.h */, 4B2B3E76140D430500EC2F7C /* OFDictionary_hashtable.m */, 4B0108C910EB8C9300631877 /* OFEnumerator.h */, 4B0108CA10EB8C9300631877 /* OFEnumerator.m */, 4B6799661099E7C50041064A /* OFFile.h */, 4B6799671099E7C50041064A /* OFFile.m */, 4B2C72881B888B6900717583 /* OFFileManager.h */, 4B2C72891B888B6900717583 /* OFFileManager.m */, 4BF1BCC011C9663F0025511F /* OFHash.h */, 4BB4B53F16775FF4002A2DCE /* OFHTTPClient.h */, 4BB4B54016775FF4002A2DCE /* OFHTTPClient.m */, 4B99250F12E0780000215DBE /* OFHTTPRequest.h */, 4B99251012E0780000215DBE /* OFHTTPRequest.m */, 4B7161AB17A6FC7600B74970 /* OFHTTPResponse.h */, 4B7161AC17A6FC7600B74970 /* OFHTTPResponse.m */, |
︙ | |||
1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 | 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 | + | 4B3D23C31337FC8300DD29B8 /* OFDataArray+Hashing.h in Headers */, 4B879A8C177231F000EBCEA4 /* OFDataArray+MessagePackValue.h in Headers */, 4B3D23C41337FC8300DD29B8 /* OFDate.h in Headers */, 4B3D23C51337FCB000DD29B8 /* OFDictionary.h in Headers */, 4B3D23C61337FCB000DD29B8 /* OFEnumerator.h in Headers */, 4B17FF74133A2AAB003E6DCD /* OFException.h in Headers */, 4B3D23C81337FCB000DD29B8 /* OFFile.h in Headers */, 4B2C728C1B888B8700717583 /* OFFileManager.h in Headers */, 4B3D23C91337FCB000DD29B8 /* OFHash.h in Headers */, 4BB4B54416775FF4002A2DCE /* OFHTTPClient.h in Headers */, 4B3D23CA1337FCB000DD29B8 /* OFHTTPRequest.h in Headers */, 4B7161AD17A6FC7600B74970 /* OFHTTPResponse.h in Headers */, 4BB4B54616775FF4002A2DCE /* OFHTTPServer.h in Headers */, 4B70A9921B07DEBF00CC5593 /* OFInflate64Stream.h in Headers */, 4B70A9931B07DEBF00CC5593 /* OFInflateStream.h in Headers */, |
︙ | |||
2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 | 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 | + | 4B3D23911337FC0D00DD29B8 /* OFDataArray+Hashing.m in Sources */, 4B879A8D177231F000EBCEA4 /* OFDataArray+MessagePackValue.m in Sources */, 4B3D23921337FC0D00DD29B8 /* OFDate.m in Sources */, 4B3D23931337FC0D00DD29B8 /* OFDictionary.m in Sources */, 4B2B3E80140D430500EC2F7C /* OFDictionary_hashtable.m in Sources */, 4B3D23941337FC0D00DD29B8 /* OFEnumerator.m in Sources */, 4B3D23961337FC0D00DD29B8 /* OFFile.m in Sources */, 4B2C728B1B888B8300717583 /* OFFileManager.m in Sources */, 4BB4B54516775FF4002A2DCE /* OFHTTPClient.m in Sources */, 4B3D23981337FC0D00DD29B8 /* OFHTTPRequest.m in Sources */, 4B7161AE17A6FC7600B74970 /* OFHTTPResponse.m in Sources */, 4BB4B54716775FF4002A2DCE /* OFHTTPServer.m in Sources */, 4B70A9961B07DF9700CC5593 /* OFInflate64Stream.m in Sources */, 4B70A9971B07DF9700CC5593 /* OFInflateStream.m in Sources */, 4B06855418B2AD3800FC731A /* OFINICategory.m in Sources */, |
︙ |
Modified src/Makefile from [413693eb52] to [7fcb9cfe27].
︙ | |||
80 81 82 83 84 85 86 87 88 89 90 91 92 93 | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | + | of_strptime.m \ unicode.m \ ${USE_SRCS_FILES} \ ${USE_SRCS_PLUGINS} \ ${USE_SRCS_SOCKETS} \ ${USE_SRCS_THREADS} SRCS_FILES = OFFile.m \ OFFileManager.m \ OFINICategory.m \ OFINIFile.m \ OFSettings.m \ OFZIPArchive.m \ OFZIPArchiveEntry.m SRCS_PLUGINS = OFPlugin.m SRCS_SOCKETS = OFHTTPClient.m \ |
︙ |
Modified src/OFDataArray.m from [8d104459de] to [ca5d4f1f51].
︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | + | #include <string.h> #include <limits.h> #import "OFDataArray.h" #import "OFString.h" #ifdef OF_HAVE_FILES # import "OFFile.h" # import "OFFileManager.h" #endif #import "OFURL.h" #ifdef OF_HAVE_SOCKETS # import "OFHTTPClient.h" # import "OFHTTPRequest.h" # import "OFHTTPResponse.h" #endif |
︙ | |||
150 151 152 153 154 155 156 | 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | + - + | #ifdef OF_HAVE_FILES - initWithContentsOfFile: (OFString*)path { @try { OFFile *file = [[OFFile alloc] initWithPath: path mode: @"rb"]; of_offset_t size = [[OFFileManager defaultManager] |
︙ |
Modified src/OFFile.h from [03d8a7c1d4] to [5c6bbab5b7].
︙ | |||
24 25 26 27 28 29 30 | 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 | - - - - + | #include <sys/types.h> #include <sys/stat.h> #import "OFSeekableStream.h" OF_ASSUME_NONNULL_BEGIN |
︙ | |||
80 81 82 83 84 85 86 | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | * * @param fd A file descriptor, returned from for example open(). * It is not closed when the OFFile object is deallocated! * @return A new autoreleased OFFile */ + (instancetype)fileWithFileDescriptor: (int)fd; |
︙ |
Modified src/OFFile.m from [2c4c5b7c7a] to [9fe26dc5db].
︙ | |||
10 11 12 13 14 15 16 | 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 | - - - - - - - - - - - - - - - - - - + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - | * * 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. */ |
︙ | |||
112 113 114 115 116 117 118 | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | # define S_IWGRP 0 #endif #ifndef S_IWOTH # define S_IWOTH 0 #endif #define DEFAULT_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH |
︙ | |||
202 203 204 205 206 207 208 | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | - - - - - - - - - - - - | @implementation OFFile + (void)initialize { if (self != [OFFile class]) return; |
︙ | |||
240 241 242 243 244 245 246 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | + (instancetype)fileWithFileDescriptor: (int)filedescriptor { return [[[self alloc] initWithFileDescriptor: filedescriptor] autorelease]; } |
︙ |
Added src/OFFileManager.h version [b4e702fc31].