Home | History | Annotate | Download | only in Common
      1 // UniqBlocks.h
      2 
      3 #ifndef __UNIQ_BLOCKS_H
      4 #define __UNIQ_BLOCKS_H
      5 
      6 #include "../../Common/MyTypes.h"
      7 #include "../../Common/MyBuffer.h"
      8 #include "../../Common/MyVector.h"
      9 
     10 struct CUniqBlocks
     11 {
     12   CObjectVector<CByteBuffer> Bufs;
     13   CIntVector Sorted;
     14   CIntVector BufIndexToSortedIndex;
     15 
     16   int AddUniq(const Byte *data, size_t size);
     17   UInt64 GetTotalSizeInBytes() const;
     18   void GetReverseMap();
     19 
     20   bool IsOnlyEmpty() const
     21   {
     22     if (Bufs.Size() == 0)
     23       return true;
     24     if (Bufs.Size() > 1)
     25       return false;
     26     return Bufs[0].Size() == 0;
     27   }
     28 };
     29 
     30 #endif
     31