00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 1999, 2002, 2005, 2006, 2008 Peter Miller 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program. If not, see 00017 // <http://www.gnu.org/licenses/>. 00018 // 00019 00020 #ifndef LIBAEGIS_OUTPUT_GZIP_H 00021 #define LIBAEGIS_OUTPUT_GZIP_H 00022 00023 #include <common/ac/zlib.h> 00024 00025 #include <libaegis/output.h> 00026 00031 class output_gzip: 00032 public output 00033 { 00034 public: 00038 virtual ~output_gzip(); 00039 00040 private: 00048 output_gzip(const output::pointer &deeper); 00049 00050 public: 00058 static pointer create(const output::pointer &deeper); 00059 00060 protected: 00061 // See base class for documentation. 00062 nstring filename() const; 00063 00064 // See base class for documentation. 00065 long ftell_inner() const; 00066 00067 // See base class for documentation. 00068 void write_inner(const void *data, size_t length); 00069 00070 // See base class for documentation. 00071 int page_width() const; 00072 00073 // See base class for documentation. 00074 int page_length() const; 00075 00076 // See base class for documentation. 00077 const char *type_name() const; 00078 00079 // See base class for documentation. 00080 void end_of_line_inner(); 00081 00082 private: 00087 output::pointer deeper; 00088 00093 z_stream stream; 00094 00099 Byte *outbuf; 00100 00105 uLong crc; 00106 00111 long pos; 00112 00117 bool bol; 00118 00123 void drop_dead(int err); 00124 00128 output_gzip(); 00129 00133 output_gzip(const output_gzip &); 00134 00138 output_gzip &operator=(const output_gzip &); 00139 }; 00140 00141 #endif // LIBAEGIS_OUTPUT_GZIP_H