Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

bitstream.h

Go to the documentation of this file.
00001 
00006 #ifndef _BITSTREAM_H_
00007 #define _BITSTREAM_H_
00008 
00009 #include <fstream>
00010 
00024 class Bitstream
00025 {    
00026   public:  
00027     
00029     enum { in, 
00030            out 
00031          };
00032     
00040     Bitstream(const char *filename, int mode);
00041     
00051     Bitstream(const char **files, int mode);
00052     
00062     void Read(unsigned int *data, int numbits);
00063     
00073     void Write(const unsigned int *data, int numbits);
00074     
00080     void Seek(int numbits);
00081     
00092     int Find(unsigned int pattern, int numbits);
00093     
00105     void ReadBytes(char *bytes, int num);
00106     
00116     void WriteBytes(const char *bytes, int num);
00117     
00123     void WriteNullBytes(int num);
00124     
00125   private:
00126     void Open(const char *filename); //Open file
00127     void CheckTag(); //If ID3v1 tag is present, decrease filesize by its length
00128     
00129     std::fstream m_stream; //C++ I/O stream
00130     const char **m_files; //Null-terminated array of filenames
00131     int m_mode; //Input/Output
00132     int m_size; //Size of input file
00133     int m_leftbits; //Number of bits kept in m_char
00134     unsigned char m_char; //Left-over bits, ### must be unsigned for shifts!
00135     static const char *m_NULL; //Null pointer
00136 };
00137     
00138 #endif //_BITSTREAM_H_

Generated on Wed Sep 6 00:17:56 2006 for Kraken by  doxygen 1.4.4