Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1.  
  2. #ifndef __compressedfiles_h__
  3. #define __compressedfiles_h__
  4.  
  5. #include "lisptype.h"
  6. #include "lispassert.h"
  7.  
  8. class CompressedFiles
  9. {
  10. public:
  11.   CompressedFiles(unsigned char * aBuffer, LispInt aFullSize, LispInt aCompressed);
  12.   ~CompressedFiles();
  13.   LispInt FindFile(LispChar * aName);
  14.   LispChar * Name(LispInt aIndex);
  15.   LispChar * Contents(LispInt aIndex);
  16.   inline LispInt NrFiles() const {return iNrFiles;}
  17.   void Sizes(LispInt& aOriginalSize, LispInt& aCompressedSize, LispInt aIndex);
  18.   inline LispInt IsValid() const {return iIsValid;}
  19. protected:
  20.   LispInt GetInt(unsigned char*&indptr);
  21.  
  22. private:
  23.   // copy constructor not implemented yet, so an assert is in order
  24.   CompressedFiles(const CompressedFiles& aOther)
  25.     : iFullBuffer(NULL),iCompressed(0),iFullSize(0),iIndex(NULL),iNrFiles(0),iIndexSize(0),iIsValid(LispFalse)
  26.   {
  27.     LISPASSERT(0);
  28.   }
  29.   inline CompressedFiles& operator=(const CompressedFiles& aOther)
  30.   {
  31.     iFullBuffer = NULL;
  32.     iCompressed = 0;
  33.     iFullSize = 0;
  34.     iIndex = NULL;
  35.     iNrFiles = 0;
  36.     iIndexSize = 0;
  37.     iIsValid = LispFalse;
  38.     LISPASSERT(0);
  39.     return *this;
  40.   }
  41. private:
  42.   unsigned char * iFullBuffer;
  43.   LispInt iCompressed;
  44.   LispInt iFullSize;
  45.   unsigned char * *iIndex;
  46.   LispInt iNrFiles;
  47.   LispInt iIndexSize;
  48.   LispInt iIsValid;
  49. };
  50.  
  51. #endif // __compressedfiles_h__
  52.