diff Plugins/Input/console/Gzip_File.h @ 493:c04dff121e1d trunk

[svn] hostile merge, phase 2: reimport based on new plugin code
author nenolod
date Tue, 24 Jan 2006 20:19:01 -0800
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Plugins/Input/console/Gzip_File.h	Tue Jan 24 20:19:01 2006 -0800
@@ -0,0 +1,43 @@
+
+// Gzip file access
+
+#ifndef GZIP_FILE_H
+#define GZIP_FILE_H
+
+#include "abstract_file.h"
+
+// Get size of gzipped file data (or size of file if not gzipped). NULL
+// on success, otherwise error string.
+const char* get_gzip_eof( const char* path, long* eof_out );
+
+class Gzip_File_Reader : public File_Reader {
+	void* file_;
+	long size_;
+public:
+	Gzip_File_Reader();
+	~Gzip_File_Reader();
+	
+	error_t open( const char* );
+	
+	long size() const;
+	long read_avail( void*, long );
+	
+	long tell() const;
+	error_t seek( long );
+	
+	void close();
+};
+
+class Gzip_File_Writer : public Data_Writer {
+	void* file_;
+public:
+	Gzip_File_Writer();
+	~Gzip_File_Writer();
+	
+	error_t open( const char* );
+	error_t write( const void*, long );
+	void close();
+};
+
+#endif
+