Differences From Artifact [f9aa8dca83]:
- File
src/OFData.m
— part of check-in
[96e0a91a06]
at
2022-09-24 15:32:52
on branch trunk
— Do not document exceptions that are obvious
Otherwise every second method would need to have
OFInvalidArgumentException documented. (user: js, size: 14148) [annotate] [blame] [check-ins using]
To Artifact [9d8368a480]:
- File src/OFData.m — part of check-in [e7ab06503c] at 2022-09-28 21:40:00 on branch trunk — Rename OFUR{L -> I} in preparation for URI support (user: js, size: 14148) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
25 26 27 28 29 30 31 | #ifdef OF_HAVE_FILES # import "OFFile.h" # import "OFFileManager.h" #endif #import "OFStream.h" #import "OFString.h" #import "OFSystemInfo.h" | | | | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | #ifdef OF_HAVE_FILES # import "OFFile.h" # import "OFFileManager.h" #endif #import "OFStream.h" #import "OFString.h" #import "OFSystemInfo.h" #import "OFURI.h" #import "OFURIHandler.h" #import "OFXMLElement.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFNotImplementedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" |
︙ | ︙ | |||
89 90 91 92 93 94 95 | #ifdef OF_HAVE_FILES + (instancetype)dataWithContentsOfFile: (OFString *)path { return [[[self alloc] initWithContentsOfFile: path] autorelease]; } #endif | | | | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | #ifdef OF_HAVE_FILES + (instancetype)dataWithContentsOfFile: (OFString *)path { return [[[self alloc] initWithContentsOfFile: path] autorelease]; } #endif + (instancetype)dataWithContentsOfURI: (OFURI *)URI { return [[[self alloc] initWithContentsOfURI: URI] autorelease]; } + (instancetype)dataWithStringRepresentation: (OFString *)string { return [[[self alloc] initWithStringRepresentation: string] autorelease]; } |
︙ | ︙ | |||
211 212 213 214 215 216 217 | @throw e; } return self; } #endif | | | | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | @throw e; } return self; } #endif - (instancetype)initWithContentsOfURI: (OFURI *)URI { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); OFStream *stream = [OFURIHandler openItemAtURI: URI mode: @"r"]; size_t pageSize; unsigned char *buffer; _count = 0; _itemSize = 1; _freeWhenDone = true; |
︙ | ︙ | |||
587 588 589 590 591 592 593 | [file writeBuffer: _items length: _count * _itemSize]; } @finally { [file release]; } } #endif | | | | 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 | [file writeBuffer: _items length: _count * _itemSize]; } @finally { [file release]; } } #endif - (void)writeToURI: (OFURI *)URI { void *pool = objc_autoreleasePoolPush(); [[OFURIHandler openItemAtURI: URI mode: @"w"] writeData: self]; objc_autoreleasePoolPop(pool); } - (OFXMLElement *)XMLElementBySerializing { void *pool; |
︙ | ︙ |