diff options
author | Max <post@wickenrode.com> | 2015-10-08 13:50:38 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-10-08 13:50:38 +0200 |
commit | 1dedadcaba2cd474a251a24d893dc3b7b2a719a7 (patch) | |
tree | 6859a81f84293266e340517a49b0edd4318a5c8b /Source/SPFileHandle.h | |
parent | e3b8f07f34cd630bc285357d016e38c1926e362a (diff) | |
download | sequelpro-1dedadcaba2cd474a251a24d893dc3b7b2a719a7.tar.gz sequelpro-1dedadcaba2cd474a251a24d893dc3b7b2a719a7.tar.bz2 sequelpro-1dedadcaba2cd474a251a24d893dc3b7b2a719a7.zip |
* Change a method name to fit standard naming conventions
* Remove a redundant ivar (and while we are at it, restructure some code)
* And then there was this gem:
(...)
if (fileMode == O_RDONLY) {
int i, c;
char bzbuf[4];
const char *charFileMode = fileMode == O_WRONLY ? "wb" : "rb";
(...)
Diffstat (limited to 'Source/SPFileHandle.h')
-rw-r--r-- | Source/SPFileHandle.h | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/Source/SPFileHandle.h b/Source/SPFileHandle.h index 23162385..5622b1b6 100644 --- a/Source/SPFileHandle.h +++ b/Source/SPFileHandle.h @@ -28,6 +28,7 @@ // // More info at <https://github.com/sequelpro/sequelpro> +union SPSomeFileHandle; /** * @class SPFileHandle SPFileHandle.h * @@ -39,7 +40,7 @@ */ @interface SPFileHandle : NSObject { - void *wrappedFile; + union SPSomeFileHandle *wrappedFile; char *wrappedFilePath; NSMutableData *buffer; @@ -53,7 +54,6 @@ BOOL dataWritten; BOOL allDataWritten; BOOL fileIsClosed; - BOOL useCompression; SPFileCompressionFormat compressionFormat; } @@ -69,7 +69,7 @@ #pragma mark Initialisation // Returns a file handle initialised with a file -- (id)initWithFile:(void *)theFile fromPath:(const char *)path mode:(int)mode; +- (id)initWithFile:(FILE *)theFile fromPath:(const char *)path mode:(int)mode; #pragma mark - #pragma mark Data reading @@ -87,7 +87,11 @@ #pragma mark Data writing // Set whether data should be written in the supplied compression format (defaults to NO on a fresh object) -- (void)setShouldWriteWithCompressionFormat:(SPFileCompressionFormat)useCompressionFormat; +// This has no influence on reading data. +- (void)setCompressionFormat:(SPFileCompressionFormat)useCompressionFormat; + +// Returns the compression format being used. Currently gzip or bzip2 only. +- (SPFileCompressionFormat)compressionFormat; // Write the provided data to the file - (void)writeData:(NSData *)data; @@ -98,13 +102,4 @@ // Prevents further access to the file - (void)closeFile; -#pragma mark - -#pragma mark File information - -// Returns whether compression is enabled on the file -- (BOOL)isCompressed; - -// Returns the compression format being used. Currently gzip or bzip2 only. -- (SPFileCompressionFormat)compressionFormat; - @end |