• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 7.1.0.193
GDFileHandle.h
Go to the documentation of this file.
1 /*
2  * (c) 2017 BlackBerry Limited. All rights reserved.
3  *
4  */
5 
6 #pragma once
7 
8 #import <Foundation/Foundation.h>
9 #import "GDPortability.h"
10 
12 
253 @interface GDFileHandle : NSFileHandle
254 
255 - (NSData *)readDataToEndOfFile;
256 - (NSData *)readDataOfLength:(NSUInteger)length;
257 
258 - (void)writeData:(NSData *)data;
259 - (unsigned long long)seekToEndOfFile;
260 - (void)seekToFileOffset:(unsigned long long)offset;
261 - (void)truncateFileAtOffset:(unsigned long long)offset;
262 - (void)synchronizeFile;
263 - (void)closeFile;
264 
265 - (instancetype)initWithFileDescriptor:(int)fd closeOnDealloc:(BOOL)closeopt;
266 - (GD_NSNULLABLE instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
267 
268 + (GD_NSNULLABLE instancetype)fileHandleForReadingAtPath:(NSString *)path;
269 + (GD_NSNULLABLE instancetype)fileHandleForWritingAtPath:(NSString *)path;
270 + (GD_NSNULLABLE instancetype)fileHandleForUpdatingAtPath:(NSString *)path;
271 
272 + (GD_NSNULLABLE instancetype)fileHandleForReadingFromURL:(NSURL *)url error:(NSError **)error;
273 + (GD_NSNULLABLE instancetype)fileHandleForWritingToURL:(NSURL *)url error:(NSError **)error;
274 + (GD_NSNULLABLE instancetype)fileHandleForUpdatingURL:(NSURL *)url error:(NSError **)error;
275 
276 @property (atomic, readonly, copy) NSData *availableData;
277 @property (atomic, readonly) unsigned long long offsetInFile;
278 @property (atomic, readonly) int fileDescriptor;
279 
280 // unavailable
281 + (NSFileHandle *)fileHandleWithStandardInput;
282 + (NSFileHandle *)fileHandleWithStandardOutput;
283 + (NSFileHandle *)fileHandleWithStandardError;
284 + (NSFileHandle *)fileHandleWithNullDevice;
285 - (void)readInBackgroundAndNotifyForModes:(GD_NSNULLABLE GD_NSArray(NSString *) *)modes;
287 - (void)readToEndOfFileInBackgroundAndNotifyForModes:(GD_NSNULLABLE GD_NSArray(NSString *) *)modes;
289 - (void)acceptConnectionInBackgroundAndNotifyForModes:(GD_NSNULLABLE GD_NSArray(NSString *) *)modes;
291 - (void)waitForDataInBackgroundAndNotifyForModes:(GD_NSNULLABLE GD_NSArray(NSString *) *)modes;
293 //
294 
295 @end
296 
GD_NSNULLABLE
#define GD_NSNULLABLE
Definition: GDPortability.h:71
-[GDFileHandle readInBackgroundAndNotify]
void readInBackgroundAndNotify()
-[GDFileHandle waitForDataInBackgroundAndNotify]
void waitForDataInBackgroundAndNotify()
-[GDFileHandle acceptConnectionInBackgroundAndNotify]
void acceptConnectionInBackgroundAndNotify()
+[GDFileHandle fileHandleWithStandardInput]
NSFileHandle * fileHandleWithStandardInput()
GDFileHandle
File handle access to the secure file system.
Definition: GDFileHandle.h:253
GDFileHandle::fileDescriptor
int fileDescriptor
Definition: GDFileHandle.h:278
-[GDFileHandle seekToEndOfFile]
unsigned long long seekToEndOfFile()
+[GDFileHandle fileHandleWithNullDevice]
NSFileHandle * fileHandleWithNullDevice()
+[GDFileHandle fileHandleWithStandardOutput]
NSFileHandle * fileHandleWithStandardOutput()
+[GDFileHandle fileHandleWithStandardError]
NSFileHandle * fileHandleWithStandardError()
GDFileHandle::availableData
NSData * availableData
Definition: GDFileHandle.h:276
-[GDFileHandle synchronizeFile]
void synchronizeFile()
GD_NS_ASSUME_NONNULL_END
#define GD_NS_ASSUME_NONNULL_END
Definition: GDPortability.h:89
-[GDFileHandle closeFile]
void closeFile()
GD_NSArray
#define GD_NSArray(ObjectType)
Definition: GDPortability.h:112
GDFileHandle::offsetInFile
unsigned long long offsetInFile
Definition: GDFileHandle.h:277
-[GDFileHandle readDataToEndOfFile]
NSData * readDataToEndOfFile()
-[GDFileHandle readToEndOfFileInBackgroundAndNotify]
void readToEndOfFileInBackgroundAndNotify()
GD_NS_ASSUME_NONNULL_BEGIN
#define GD_NS_ASSUME_NONNULL_BEGIN
Definition: GDPortability.h:88
GDPortability.h