Differences From Artifact [a97d47a4cf]:
- File src/OFString.m — part of check-in [455caa7063] at 2017-11-06 00:10:21 on branch trunk — of_string_utf8_encode(): Remove a variable (user: js, size: 66980) [annotate] [blame] [check-ins using]
To Artifact [02ef45c9df]:
- File
src/OFString.m
— part of check-in
[34fe205b84]
at
2017-11-12 18:27:56
on branch trunk
— OFFileManager: Major API redesign
This removes all query methods and replaces them by a single one that
returns a dictionary. Not only does this allow querying multiple
attributes at once, it is also more extensible, as the previous
attributes were specific to file URLs. (user: js, size: 67076) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
47 48 49 50 51 52 53 | #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" #import "OFNotImplementedException.h" #import "OFOpenItemFailedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" | | | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" #import "OFNotImplementedException.h" #import "OFOpenItemFailedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFRetrieveItemAttributesFailedException.h" #import "OFTruncatedDataException.h" #import "OFUnsupportedProtocolException.h" #import "of_asprintf.h" #import "unicode.h" /* |
︙ | ︙ | |||
1011 1012 1013 1014 1015 1016 1017 | encoding: OF_STRING_ENCODING_UTF_8]; } - (instancetype)initWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding { char *tmp; | | > | | | > | > | > | 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 | encoding: OF_STRING_ENCODING_UTF_8]; } - (instancetype)initWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding { char *tmp; uintmax_t fileSize; @try { void *pool = objc_autoreleasePoolPush(); OFFile *file; @try { fileSize = [[[OFFileManager defaultManager] attributesOfItemAtPath: path] fileSize]; } @catch (OFRetrieveItemAttributesFailedException *e) { @throw [OFOpenItemFailedException exceptionWithPath: path mode: @"r" errNo: errno]; } objc_autoreleasePoolPop(pool); # if UINTMAX_MAX > SIZE_MAX if (fileSize > SIZE_MAX) @throw [OFOutOfRangeException exception]; #endif file = [[OFFile alloc] initWithPath: path mode: @"r"]; @try { tmp = [self allocMemoryWithSize: (size_t)fileSize]; |
︙ | ︙ |