PageRenderTime 40ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/strigi-0.7.7/libstreamanalyzer/lib/endanalyzers/bz2endanalyzer.h

#
C++ Header | 54 lines | 30 code | 5 blank | 19 comment | 0 complexity | 26fbf7152d40b70ff2bb432b445c6424 MD5 | raw file
Possible License(s): LGPL-2.0
  1. /* This file is part of Strigi Desktop Search
  2. *
  3. * Copyright (C) 2006 Jos van den Oever <jos@vandenoever.info>
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Library General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Library General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Library General Public License
  16. * along with this library; see the file COPYING.LIB. If not, write to
  17. * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18. * Boston, MA 02110-1301, USA.
  19. */
  20. #ifndef BZ2ENDANALYZER
  21. #define BZ2ENDANALYZER
  22. #include <strigi/streamendanalyzer.h>
  23. #include <strigi/streambase.h>
  24. class Bz2EndAnalyzerFactory;
  25. class Bz2EndAnalyzer : public Strigi::StreamEndAnalyzer {
  26. private:
  27. const Bz2EndAnalyzerFactory* factory;
  28. public:
  29. Bz2EndAnalyzer(const Bz2EndAnalyzerFactory* f)
  30. :factory(f) {}
  31. bool checkHeader(const char* header, int32_t headersize) const;
  32. signed char analyze(Strigi::AnalysisResult& idx, Strigi::InputStream* in);
  33. const char* name() const { return "Bz2EndAnalyzer"; }
  34. };
  35. class Bz2EndAnalyzerFactory : public Strigi::StreamEndAnalyzerFactory {
  36. friend class Bz2EndAnalyzer;
  37. private:
  38. const Strigi::RegisteredField* typeField;
  39. public:
  40. const char* name() const {
  41. return "Bz2EndAnalyzer";
  42. }
  43. Strigi::StreamEndAnalyzer* newInstance() const {
  44. return new Bz2EndAnalyzer(this);
  45. }
  46. bool analyzesSubStreams() const { return true; }
  47. void registerFields(Strigi::FieldRegister&);
  48. };
  49. #endif