Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Headers/Foundation/NSData.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ extern "C" {
@class NSURL;
#endif

enum {
NSDataReadingMappedIfSafe = 1UL << 0, // Suggests using memory mapping for the file if it can be done securely
NSDataReadingUncached = 1UL << 1, // Suggests avoiding file system caching for the read operation
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7,GS_API_LATEST)
NSDataReadingMappedAlways = 1UL << 3, // Strongly requests memory mapping the file; overrides MappedIfSafe if both are set
#endif
};
typedef NSUInteger NSDataReadingOptions;

#if OS_API_VERSION(MAC_OS_X_VERSION_10_6,GS_API_LATEST)
enum {
NSDataSearchBackwards = (1UL << 0),
Expand Down Expand Up @@ -95,9 +104,15 @@ GS_EXPORT_CLASS
length: (NSUInteger)bufferSize
freeWhenDone: (BOOL)shouldFree;
#endif
+ (instancetype)dataWithContentsOfFile: (NSString *)path
options: (NSDataReadingOptions)readOptionsMask
error: (NSError **)errorPtr;
+ (instancetype) dataWithContentsOfFile: (NSString*)path;
+ (instancetype) dataWithContentsOfMappedFile: (NSString*)path;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
+ (instancetype) dataWithContentsOfURL: (NSURL *)url
options: (NSDataReadingOptions)readOptionsMask
error: (NSError **)errorPtr;
+ (instancetype) dataWithContentsOfURL: (NSURL*)url;
#endif
+ (instancetype) dataWithData: (NSData*)data;
Expand Down Expand Up @@ -127,9 +142,15 @@ GS_EXPORT_CLASS
freeWhenDone: (BOOL)shouldFree;
#endif
- (instancetype) initWithContentsOfFile: (NSString*)path;
- (instancetype) initWithContentsOfFile:(NSString *) path
options:(NSDataReadingOptions) readOptionsMask
error:(NSError **) errorPtr;
- (instancetype) initWithContentsOfMappedFile: (NSString*)path;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
- (instancetype) initWithContentsOfURL: (NSURL*)url;
- (instancetype) initWithContentsOfURL: (NSURL *)url
options: (NSDataReadingOptions)readOptionsMask
error: (NSError **)errorPtr;
#endif
- (instancetype) initWithData: (NSData*)data;

Expand Down
Loading
Loading