zstd_dict_codec.h 948 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include "codecs.h"
  3. #include <util/generic/ptr.h>
  4. namespace NCodecs {
  5. // benchmarks are here: https://st.yandex-team.ru/SEARCH-1655
  6. class TZStdDictCodec: public ICodec {
  7. class TImpl;
  8. TIntrusivePtr<TImpl> Impl;
  9. public:
  10. explicit TZStdDictCodec(ui32 comprLevel = 1);
  11. ~TZStdDictCodec() override;
  12. static TStringBuf MyName() {
  13. return "zstd08d";
  14. }
  15. TString GetName() const override;
  16. ui8 Encode(TStringBuf in, TBuffer& out) const override;
  17. void Decode(TStringBuf in, TBuffer& out) const override;
  18. static TVector<TString> ListCompressionNames();
  19. static int ParseCompressionName(TStringBuf);
  20. protected:
  21. void DoLearn(ISequenceReader& in) override;
  22. bool DoTryToLearn(ISequenceReader& in) final;
  23. void Save(IOutputStream* out) const override;
  24. void Load(IInputStream* in) override;
  25. };
  26. }