blackberry.com
BlackBerry Dynamics
Runtime library for iOS applications
from the application developer portal

GDFileHandle.h

Go to the documentation of this file.
00001 /*
00002  * (c) 2017 BlackBerry Limited. All rights reserved.
00003  *
00004  */
00005 
00006 #pragma once
00007 
00008 #import <Foundation/Foundation.h>
00009 #import "GDPortability.h"
00010 
00011 GD_NS_ASSUME_NONNULL_BEGIN
00012 
00255 @interface GDFileHandle : NSFileHandle
00256 
00257 - (NSData *)readDataToEndOfFile;
00258 - (NSData *)readDataOfLength:(NSUInteger)length;
00259 
00260 - (void)writeData:(NSData *)data;
00261 - (unsigned long long)seekToEndOfFile;
00262 - (void)seekToFileOffset:(unsigned long long)offset;
00263 - (void)truncateFileAtOffset:(unsigned long long)offset;
00264 - (void)synchronizeFile;
00265 - (void)closeFile;
00266 
00267 - (instancetype)initWithFileDescriptor:(int)fd closeOnDealloc:(BOOL)closeopt;
00268 - (GD_NSNULLABLE instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
00269 
00270 + (GD_NSNULLABLE instancetype)fileHandleForReadingAtPath:(NSString *)path;
00271 + (GD_NSNULLABLE instancetype)fileHandleForWritingAtPath:(NSString *)path;
00272 + (GD_NSNULLABLE instancetype)fileHandleForUpdatingAtPath:(NSString *)path;
00273 
00274 + (GD_NSNULLABLE instancetype)fileHandleForReadingFromURL:(NSURL *)url error:(NSError **)error;
00275 + (GD_NSNULLABLE instancetype)fileHandleForWritingToURL:(NSURL *)url error:(NSError **)error;
00276 + (GD_NSNULLABLE instancetype)fileHandleForUpdatingURL:(NSURL *)url error:(NSError **)error;
00277 
00278 @property (atomic, readonly, copy) NSData *availableData;
00279 @property (atomic, readonly) unsigned long long offsetInFile;
00280 @property (atomic, readonly) int fileDescriptor;
00281 
00282 // unavailable
00283 + (NSFileHandle *)fileHandleWithStandardInput;
00284 + (NSFileHandle *)fileHandleWithStandardOutput;
00285 + (NSFileHandle *)fileHandleWithStandardError;
00286 + (NSFileHandle *)fileHandleWithNullDevice;
00287 - (void)readInBackgroundAndNotifyForModes:(GD_NSNULLABLE GD_NSArray(NSString *) *)modes;
00288 - (void)readInBackgroundAndNotify;
00289 - (void)readToEndOfFileInBackgroundAndNotifyForModes:(GD_NSNULLABLE GD_NSArray(NSString *) *)modes;
00290 - (void)readToEndOfFileInBackgroundAndNotify;
00291 - (void)acceptConnectionInBackgroundAndNotifyForModes:(GD_NSNULLABLE GD_NSArray(NSString *) *)modes;
00292 - (void)acceptConnectionInBackgroundAndNotify;
00293 - (void)waitForDataInBackgroundAndNotifyForModes:(GD_NSNULLABLE GD_NSArray(NSString *) *)modes;
00294 - (void)waitForDataInBackgroundAndNotify;
00295 //
00296 
00297 @end
00298 
00299 GD_NS_ASSUME_NONNULL_END