DeflatedArchiveTextFile.h
Go to the documentation of this file.00001 #ifndef DEFLATEDARCHIVETEXTFILE_H_
00002 #define DEFLATEDARCHIVETEXTFILE_H_
00003
00004 #include "iarchive.h"
00005 #include "archivelib.h"
00006 #include "zlibstream.h"
00007
00011 class DeflatedArchiveTextFile: public ArchiveTextFile
00012 {
00013 std::string m_name;
00014 std::size_t m_size;
00015 std::size_t m_filesize;
00016 FileInputStream m_istream;
00017 SubFileInputStream m_substream;
00018 DeflatedInputStream m_zipstream;
00019 BinaryToTextInputStream<DeflatedInputStream> m_textStream;
00020 public:
00021 typedef FileInputStream::size_type size_type;
00022 typedef FileInputStream::position_type position_type;
00023
00024 DeflatedArchiveTextFile (const std::string& name, const std::string& archiveName, position_type position,
00025 size_type stream_size, size_type filesize) :
00026 m_name(name), m_size(stream_size), m_filesize(filesize), m_istream(archiveName), m_substream(m_istream,
00027 position, stream_size), m_zipstream(m_substream), m_textStream(m_zipstream)
00028 {
00029 }
00030
00032 std::size_t size ()
00033 {
00034 return m_filesize;
00035 }
00036 const std::string getName () const
00037 {
00038 return m_name;
00039 }
00040 TextInputStream& getInputStream ()
00041 {
00042 return m_textStream;
00043 }
00044 };
00045
00046 #endif