Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/downloader/decompressor.h

Go to the documentation of this file.
00001 // Filename: decompressor.h
00002 // Created by:  mike (09Jan97)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef DECOMPRESSOR_H
00020 #define DECOMPRESSOR_H
00021 
00022 #include "pandabase.h"
00023 #include "filename.h"
00024 
00025 class Ramfile;
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //       Class : Decompressor
00029 // Description : This manages run-time decompression of a
00030 //               zlib-compressed stream, as a background or foreground
00031 //               task.
00032 ////////////////////////////////////////////////////////////////////
00033 class EXPCL_PANDAEXPRESS Decompressor {
00034 PUBLISHED:
00035   Decompressor();
00036   ~Decompressor();
00037 
00038   int initiate(const Filename &source_file);
00039   int initiate(const Filename &source_file, const Filename &dest_file);
00040   int run();
00041 
00042   bool decompress(const Filename &source_file);
00043   bool decompress(Ramfile &source_and_dest_file);
00044 
00045   float get_progress() const;
00046 
00047 private:
00048   void cleanup(void);
00049 
00050   Filename _source_filename;
00051   
00052   istream *_source;
00053   istream *_decompress;
00054   ostream *_dest;
00055 
00056   size_t _source_length;
00057 };
00058 
00059 #include "decompressor.I"
00060 
00061 #endif

Generated on Fri May 2 00:36:44 2003 for Panda by doxygen1.3