1// UniqBlocks.h 2 3#ifndef ZIP7_INC_UNIQ_BLOCKS_H 4#define ZIP7_INC_UNIQ_BLOCKS_H 5 6#include "../../Common/MyBuffer.h" 7#include "../../Common/MyString.h" 8 9struct C_UInt32_UString_Map 10{ 11 CRecordVector<UInt32> Numbers; 12 UStringVector Strings; 13 14 void Add_UInt32(const UInt32 n) 15 { 16 Numbers.AddToUniqueSorted(n); 17 } 18 int Find(const UInt32 n) 19 { 20 return Numbers.FindInSorted(n); 21 } 22}; 23 24 25struct CUniqBlocks 26{ 27 CObjectVector<CByteBuffer> Bufs; 28 CUIntVector Sorted; 29 CUIntVector BufIndexToSortedIndex; 30 31 unsigned AddUniq(const Byte *data, size_t size); 32 UInt64 GetTotalSizeInBytes() const; 33 void GetReverseMap(); 34 35 bool IsOnlyEmpty() const 36 { 37 return (Bufs.Size() == 0 || (Bufs.Size() == 1 && Bufs[0].Size() == 0)); 38 } 39}; 40 41#endif 42