Differences From Artifact [c9a19755a7]:
- File
src/OFFile.m
— part of check-in
[44f45c2e35]
at
2017-01-09 17:36:36
on branch trunk
— Update copyright
Forgot to add 2017, even though I already did quite some changes in
2017. (user: js, size: 6619) [annotate] [blame] [check-ins using]
To Artifact [018b6789b8]:
- File
src/OFFile.m
— part of check-in
[4af49a13c3]
at
2017-05-07 20:10:13
on branch trunk
— Small code style change
Casts are now written like types in variable declarations. (user: js, size: 6625) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
127 128 129 130 131 132 133 | #ifdef OF_NINTENDO_DS if (!nitroFSInit(NULL)) @throw [OFInitializationFailedException exceptionWithClass: self]; #endif } | | | | | | 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 | #ifdef OF_NINTENDO_DS if (!nitroFSInit(NULL)) @throw [OFInitializationFailedException exceptionWithClass: self]; #endif } + (instancetype)fileWithPath: (OFString *)path mode: (OFString *)mode { return [[[self alloc] initWithPath: path mode: mode] autorelease]; } + (instancetype)fileWithFileDescriptor: (int)filedescriptor { return [[[self alloc] initWithFileDescriptor: filedescriptor] autorelease]; } - init { OF_INVALID_INIT_METHOD } - initWithPath: (OFString *)path mode: (OFString *)mode { self = [super init]; @try { int flags; if ((flags = parseMode([mode UTF8String])) == -1) |
︙ | ︙ | |||
197 198 199 200 201 202 203 | { if (_fd == -1) return true; return _atEndOfStream; } | | | 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | { if (_fd == -1) return true; return _atEndOfStream; } - (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { ssize_t ret; if (_fd == -1 || _atEndOfStream) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length]; |
︙ | ︙ | |||
227 228 229 230 231 232 233 | if (ret == 0) _atEndOfStream = true; return ret; } | | | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | if (ret == 0) _atEndOfStream = true; return ret; } - (void)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { if (_fd == -1 || _atEndOfStream) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length]; #ifndef OF_WINDOWS |
︙ | ︙ |