• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 12.0.1.79
GDFileHandle.h
Go to the documentation of this file.
1 /*
2  * Copyright 2023 BlackBerry Limited. All rights reserved.
3  *
4  */
5 
6 #pragma once
7 
8 #import <Foundation/Foundation.h>
9 
10 NS_ASSUME_NONNULL_BEGIN
11 
213 @interface GDFileHandle : NSFileHandle
214 
215 - (NSData *)readDataToEndOfFile;
216 - (NSData *)readDataOfLength:(NSUInteger)length;
217 
218 - (void)writeData:(NSData *)data;
219 - (unsigned long long)seekToEndOfFile;
220 - (void)seekToFileOffset:(unsigned long long)offset;
221 - (void)truncateFileAtOffset:(unsigned long long)offset;
222 - (void)synchronizeFile;
223 - (void)closeFile;
224 
225 - (instancetype)initWithFileDescriptor:(int)fd closeOnDealloc:(BOOL)closeopt;
226 - (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
227 
228 + (nullable instancetype)fileHandleForReadingAtPath:(NSString *)path;
229 + (nullable instancetype)fileHandleForWritingAtPath:(NSString *)path;
230 + (nullable instancetype)fileHandleForUpdatingAtPath:(NSString *)path;
231 
232 + (nullable instancetype)fileHandleForReadingFromURL:(NSURL *)url error:(NSError **)error;
233 + (nullable instancetype)fileHandleForWritingToURL:(NSURL *)url error:(NSError **)error;
234 + (nullable instancetype)fileHandleForUpdatingURL:(NSURL *)url error:(NSError **)error;
235 
236 @property (atomic, readonly, copy) NSData *availableData;
237 @property (atomic, readonly) unsigned long long offsetInFile;
238 @property (atomic, readonly) int fileDescriptor;
239 
240 // unavailable
241 + (NSFileHandle *)fileHandleWithStandardInput;
242 + (NSFileHandle *)fileHandleWithStandardOutput;
243 + (NSFileHandle *)fileHandleWithStandardError;
244 + (NSFileHandle *)fileHandleWithNullDevice;
245 - (void)readInBackgroundAndNotifyForModes:(nullable NSArray<NSString *> *)modes;
247 - (void)readToEndOfFileInBackgroundAndNotifyForModes:(nullable NSArray<NSString *> *)modes;
249 - (void)acceptConnectionInBackgroundAndNotifyForModes:(nullable NSArray<NSString *> *)modes;
251 - (void)waitForDataInBackgroundAndNotifyForModes:(nullable NSArray<NSString *> *)modes;
253 //
254 
255 @end
256 
257 NS_ASSUME_NONNULL_END
-[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:213
GDFileHandle::fileDescriptor
int fileDescriptor
Definition: GDFileHandle.h:238
-[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:236
-[GDFileHandle synchronizeFile]
void synchronizeFile()
-[GDFileHandle closeFile]
void closeFile()
GDFileHandle::offsetInFile
unsigned long long offsetInFile
Definition: GDFileHandle.h:237
-[GDFileHandle readDataToEndOfFile]
NSData * readDataToEndOfFile()
-[GDFileHandle readToEndOfFileInBackgroundAndNotify]
void readToEndOfFileInBackgroundAndNotify()