Differences From Artifact [fd491800a0]:
- File src/OFString.m — part of check-in [c5c3df3abe] at 2017-05-30 22:01:45 on branch trunk — MorphOS: Name variable handle instead of fd (user: js, size: 64573) [annotate] [blame] [check-ins using]
To Artifact [094992d7f8]:
- File
src/OFString.m
— part of check-in
[4ebeb7e3a2]
at
2017-06-03 12:46:40
on branch trunk
— Make of_(l)stat() private to OFFileManager
Everything else should just use OFFileManager. (user: js, size: 64620) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
24 25 26 27 28 29 30 | #if defined(HAVE_STRTOF_L) || defined(HAVE_STRTOD_L) # include <locale.h> #endif #ifdef HAVE_XLOCALE_H # include <xlocale.h> #endif | < < < < > > | 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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | #if defined(HAVE_STRTOF_L) || defined(HAVE_STRTOD_L) # include <locale.h> #endif #ifdef HAVE_XLOCALE_H # include <xlocale.h> #endif #import "OFString.h" #import "OFString_UTF8.h" #import "OFString_UTF8+Private.h" #import "OFArray.h" #import "OFDictionary.h" #import "OFDataArray.h" #import "OFLocalization.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 #import "OFXMLElement.h" #ifdef OF_HAVE_SOCKETS # import "OFHTTPRequestFailedException.h" #endif #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" #import "OFNotImplementedException.h" #import "OFOpenItemFailedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFStatItemFailedException.h" #import "OFTruncatedDataException.h" #import "OFUnsupportedProtocolException.h" #import "of_asprintf.h" #import "unicode.h" /* |
︙ | ︙ | |||
921 922 923 924 925 926 927 | encoding: OF_STRING_ENCODING_UTF_8]; } - initWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding { char *tmp; | | | | | | | > | | | | | 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 | encoding: OF_STRING_ENCODING_UTF_8]; } - initWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding { char *tmp; of_offset_t fileSize; @try { OFFile *file; @try { fileSize = [[OFFileManager defaultManager] sizeOfFileAtPath: path]; } @catch (OFStatItemFailedException *e) { @throw [OFOpenItemFailedException exceptionWithPath: path mode: @"rb" 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: @"rb"]; @try { tmp = [self allocMemoryWithSize: (size_t)fileSize]; [file readIntoBuffer: tmp exactLength: (size_t)fileSize]; } @finally { [file release]; } } @catch (id e) { [self release]; @throw e; } self = [self initWithCString: tmp encoding: encoding length: (size_t)fileSize]; [self freeMemory: tmp]; return self; } #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) |
︙ | ︙ |