Differences From Artifact [27f6116ecb]:
- File src/OFString.m — part of check-in [c8f7b90082] at 2017-07-22 20:50:27 on branch trunk — Split OFDataArray into OFData and OFMutableData (user: js, size: 65352) [annotate] [blame] [check-ins using]
To Artifact [18c9b8230b]:
- File
src/OFString.m
— part of check-in
[23e57c5040]
at
2017-07-22 23:04:35
on branch trunk
— OFFile: Simplify mode
This removes "b" for binary and always uses binary, as there is no good
reason to not use binary. (user: js, size: 65349) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
962 963 964 965 966 967 968 | @try { fileSize = [[OFFileManager defaultManager] sizeOfFileAtPath: path]; } @catch (OFStatItemFailedException *e) { @throw [OFOpenItemFailedException exceptionWithPath: path | | | | 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | @try { fileSize = [[OFFileManager defaultManager] sizeOfFileAtPath: path]; } @catch (OFStatItemFailedException *e) { @throw [OFOpenItemFailedException exceptionWithPath: path mode: @"r" errNo: errno]; } if (sizeof(of_offset_t) > sizeof(size_t) && fileSize > (of_offset_t)SIZE_MAX) @throw [OFOutOfRangeException exception]; file = [[OFFile alloc] initWithPath: path mode: @"r"]; @try { tmp = [self allocMemoryWithSize: (size_t)fileSize]; [file readIntoBuffer: tmp exactLength: (size_t)fileSize]; } @finally { |
︙ | ︙ | |||
2764 2765 2766 2767 2768 2769 2770 | - (void)writeToFile: (OFString *)path encoding: (of_string_encoding_t)encoding { void *pool = objc_autoreleasePoolPush(); OFFile *file; file = [OFFile fileWithPath: path | | | 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 | - (void)writeToFile: (OFString *)path encoding: (of_string_encoding_t)encoding { void *pool = objc_autoreleasePoolPush(); OFFile *file; file = [OFFile fileWithPath: path mode: @"w"]; [file writeString: self encoding: encoding]; objc_autoreleasePoolPop(pool); } #endif |
︙ | ︙ |