GPKGIOUtils
Objective-C
@interface GPKGIOUtils : NSObject
/**
 *  Get the path of the property list file with name
 *
 *  @param name plist base file name
 *
 *  @return property list file path
 */
+(NSString *) propertyListPathWithName: (NSString *) name;
/**
 *  Get the path of the resource file with name and file type
 *
 *  @param name file name
 *  @param type extension type
 *
 *  @return file resource path
 */
+(NSString *) resourcePathWithName: (NSString *) name andType: (NSString *) type;
/**
 *  Get the documents directory path
 *
 *  @return documents directory
 */
+(NSString *) documentsDirectory;
/**
 *  Get a sub directory path within the document directory
 *
 *  @param subDirectory sub directory path
 *
 *  @return documents sub directory path
 */
+(NSString *) documentsDirectoryWithSubDirectory: (NSString *) subDirectory;
/**
 *  Get the GeoPackage directory path for saving GeoPackage related files
 *
 *  @return GeoPackage directory
 */
+(NSString *) geoPackageDirectory;
/**
 *  Get the GeoPackage database directory path for saving GeoPackages
 *
 *  @return GeoPackage database directory
 */
+(NSString *) databaseDirectory;
/**
 *  Get the GeoPackage metadata directory path for saving metadata
 *
 *  @return GeoPackage metadata directory
 */
+(NSString *) metadataDirectory;
/**
 *  Get the GeoPackage metadata database file path
 *
 *  @return GeoPackage metadata database file path
 */
+(NSString *) metadataDatabaseFile;
/**
 *  Create a directory if it does not exist
 *
 *  @param directory directory to create
 */
+(void) createDirectoryIfNotExists: (NSString *) directory;
/**
 *  Get the local path within the provided directory by removing the documents directory
 *
 *  @param directory full directory path
 *
 *  @return sub path
 */
+(NSString *) localDocumentsDirectoryPath: (NSString *) directory;
/**
 *  Copy a file
 *
 *  @param copyFrom file to copy
 *  @param copyTo   file location to copy to
 */
+(void) copyFile: (NSString *) copyFrom toFile: (NSString *) copyTo;
/**
 *  Copy an input stream to a file
 *
 *  @param copyFrom input stream to copy
 *  @param copyTo   file location to copy to
 */
+(void) copyInputStream: (NSInputStream *) copyFrom toFile: (NSString *) copyTo;
/**
 *  Copy an input stream to a file with progress callbacks
 *
 *  @param copyFrom input stream to copy
 *  @param copyTo   file location to copy to
 *  @param progress progress callbacks
 */
+(void) copyInputStream: (NSInputStream *) copyFrom toFile: (NSString *) copyTo withProgress: (NSObject<GPKGProgress> *) progress;
/**
 *  Get the file byte data
 *
 *  @param file file path
 *
 *  @return byte data
 */
+(NSData *) fileData: (NSString *) file;
/**
 *  Get the input stream byte data
 *
 *  @param stream input stream
 *
 *  @return input stream byte data
 */
+(NSData *) streamData: (NSInputStream *) stream;
/**
 *  Get the input stream string
 *
 *  @param stream input stream
 *
 *  @return input stream string
 */
+(NSString *) streamString: (NSInputStream *) stream;
/**
 *  Get the input stream string
 *
 *  @param stream   input stream
 *  @param encoding string encoding
 *
 *  @return input stream string
 */
+(NSString *) streamString: (NSInputStream *) stream withEncoding: (NSStringEncoding) encoding;
/**
 *  Copy the input stream to an output stream
 *
 *  @param copyFrom input stream
 *  @param copyTo   output stream
 */
+(void) copyInputStream: (NSInputStream *) copyFrom toOutputStream: (NSOutputStream *) copyTo;
/**
 *  Copy the input stream to an output stream with progress callbacks
 *
 *  @param copyFrom input stream
 *  @param copyTo   output stream
 *  @param progress progress callbacks
 */
+(void) copyInputStream: (NSInputStream *) copyFrom toOutputStream: (NSOutputStream *) copyTo withProgress: (NSObject<GPKGProgress> *) progress;
/**
 *  Delete the file
 *
 *  @param file file path
 *
 *  @return true if deleted
 */
+(BOOL) deleteFile: (NSString *) file;
/**
 *  Format the bytes into readable text
 *
 *  @param bytes bytes
 *
 *  @return byte text
 */
+(NSString *) formatBytes: (int) bytes;
/**
 *  Decode a URL
 *
 *  @param url url
 *
 *  @return decoded url
 */
+(NSString *) decodeUrl: (NSString *) url;
@endSwift
class GPKGIOUtils : NSObjectUndocumented
- 
                  
                  Get the path of the property list file with name DeclarationObjective-C + (NSString *)propertyListPathWithName:(NSString *)name;Swift class func propertyListPath(withName name: String!) -> String!Parametersnameplist base file name Return Valueproperty list file path 
- 
                  
                  Get the path of the resource file with name and file type DeclarationObjective-C + (NSString *)resourcePathWithName:(NSString *)name andType:(NSString *)type;Swift class func resourcePath(withName name: String!, andType type: String!) -> String!Parametersnamefile name typeextension type Return Valuefile resource path 
- 
                  
                  Get the documents directory path DeclarationObjective-C + (NSString *)documentsDirectory;Swift class func documentsDirectory() -> String!Return Valuedocuments directory 
- 
                  
                  Get a sub directory path within the document directory DeclarationObjective-C + (NSString *)documentsDirectoryWithSubDirectory:(NSString *)subDirectory;Swift class func documentsDirectory(withSubDirectory subDirectory: String!) -> String!ParameterssubDirectorysub directory path Return Valuedocuments sub directory path 
- 
                  
                  Get the GeoPackage directory path for saving GeoPackage related files DeclarationObjective-C + (NSString *)geoPackageDirectory;Swift class func geoPackageDirectory() -> String!Return ValueGeoPackage directory 
- 
                  
                  Get the GeoPackage database directory path for saving GeoPackages DeclarationObjective-C + (NSString *)databaseDirectory;Swift class func databaseDirectory() -> String!Return ValueGeoPackage database directory 
- 
                  
                  Get the GeoPackage metadata directory path for saving metadata DeclarationObjective-C + (NSString *)metadataDirectory;Swift class func metadataDirectory() -> String!Return ValueGeoPackage metadata directory 
- 
                  
                  Get the GeoPackage metadata database file path DeclarationObjective-C + (NSString *)metadataDatabaseFile;Swift class func metadataDatabaseFile() -> String!Return ValueGeoPackage metadata database file path 
- 
                  
                  Create a directory if it does not exist DeclarationObjective-C + (void)createDirectoryIfNotExists:(NSString *)directory;Swift class func createDirectoryIfNotExists(_ directory: String!)Parametersdirectorydirectory to create 
- 
                  
                  Get the local path within the provided directory by removing the documents directory DeclarationObjective-C + (NSString *)localDocumentsDirectoryPath:(NSString *)directory;Swift class func localDocumentsDirectoryPath(_ directory: String!) -> String!Parametersdirectoryfull directory path Return Valuesub path 
- 
                  
                  Copy a file DeclarationObjective-C + (void)copyFile:(NSString *)copyFrom toFile:(NSString *)copyTo;Swift class func copyFile(_ copyFrom: String!, toFile copyTo: String!)ParameterscopyFromfile to copy copyTofile location to copy to 
- 
                  
                  Copy an input stream to a file DeclarationObjective-C + (void)copyInputStream:(NSInputStream *)copyFrom toFile:(NSString *)copyTo;Swift class func copy(_ copyFrom: InputStream!, toFile copyTo: String!)ParameterscopyFrominput stream to copy copyTofile location to copy to 
- 
                  
                  Copy an input stream to a file with progress callbacks DeclarationObjective-C + (void)copyInputStream:(NSInputStream *)copyFrom toFile:(NSString *)copyTo withProgress:(NSObject<GPKGProgress> *)progress;Swift class func copy(_ copyFrom: InputStream!, toFile copyTo: String!, with progress: (any GPKGProgress)!)ParameterscopyFrominput stream to copy copyTofile location to copy to progressprogress callbacks 
- 
                  
                  Get the file byte data DeclarationObjective-C + (NSData *)fileData:(NSString *)file;Swift class func fileData(_ file: String!) -> Data!Parametersfilefile path Return Valuebyte data 
- 
                  
                  Get the input stream byte data DeclarationObjective-C + (NSData *)streamData:(NSInputStream *)stream;Swift class func streamData(_ stream: InputStream!) -> Data!Parametersstreaminput stream Return Valueinput stream byte data 
- 
                  
                  Get the input stream string DeclarationObjective-C + (NSString *)streamString:(NSInputStream *)stream;Swift class func streamString(_ stream: InputStream!) -> String!Parametersstreaminput stream Return Valueinput stream string 
- 
                  
                  Get the input stream string DeclarationObjective-C + (NSString *)streamString:(NSInputStream *)stream withEncoding:(NSStringEncoding)encoding;Swift class func streamString(_ stream: InputStream!, withEncoding encoding: UInt) -> String!Parametersstreaminput stream encodingstring encoding Return Valueinput stream string 
- 
                  
                  Copy the input stream to an output stream DeclarationObjective-C + (void)copyInputStream:(NSInputStream *)copyFrom toOutputStream:(NSOutputStream *)copyTo;Swift class func copy(_ copyFrom: InputStream!, to copyTo: OutputStream!)ParameterscopyFrominput stream copyTooutput stream 
- 
                  
                  Copy the input stream to an output stream with progress callbacks DeclarationObjective-C + (void)copyInputStream:(NSInputStream *)copyFrom toOutputStream:(NSOutputStream *)copyTo withProgress:(NSObject<GPKGProgress> *)progress;Swift class func copy(_ copyFrom: InputStream!, to copyTo: OutputStream!, with progress: (any GPKGProgress)!)ParameterscopyFrominput stream copyTooutput stream progressprogress callbacks 
- 
                  
                  Delete the file DeclarationObjective-C + (BOOL)deleteFile:(NSString *)file;Swift class func deleteFile(_ file: String!) -> BoolParametersfilefile path Return Valuetrue if deleted 
- 
                  
                  Format the bytes into readable text DeclarationObjective-C + (NSString *)formatBytes:(int)bytes;Swift class func formatBytes(_ bytes: Int32) -> String!Parametersbytesbytes Return Valuebyte text 
- 
                  
                  Decode a URL DeclarationObjective-C + (NSString *)decodeUrl:(NSString *)url;Swift class func decodeUrl(_ url: String!) -> String!Parametersurlurl Return Valuedecoded url 
 View on GitHub
View on GitHub GPKGIOUtils Class Reference
        GPKGIOUtils Class Reference