PageRenderTime 55ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/strigi-0.7.7/libstreamanalyzer/plugins/throughplugins/sidthroughanalyzer.h

#
C Header | 66 lines | 40 code | 7 blank | 19 comment | 0 complexity | d2748a782189d9dc77653c7b041e900c MD5 | raw file
Possible License(s): LGPL-2.0
  1. /* This file is part of Strigi Desktop Search
  2. *
  3. * Copyright (C) 2007 Flavio Castelli <flavio.castelli@gmail.com>
  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 STRIGI_SIDTHROUGHANALYZER
  21. #define STRIGI_SIDTHROUGHANALYZER
  22. #include <strigi/streamthroughanalyzer.h>
  23. #include <strigi/analyzerplugin.h>
  24. #include <string>
  25. namespace Strigi {
  26. class RegisteredField;
  27. }
  28. class SidThroughAnalyzerFactory;
  29. class STRIGI_PLUGIN_API SidThroughAnalyzer
  30. : public Strigi::StreamThroughAnalyzer {
  31. private:
  32. Strigi::AnalysisResult* analysisResult;
  33. const SidThroughAnalyzerFactory* factory;
  34. public:
  35. SidThroughAnalyzer(const SidThroughAnalyzerFactory* f) :factory(f) {}
  36. ~SidThroughAnalyzer() {}
  37. void setIndexable(Strigi::AnalysisResult* i);
  38. Strigi::InputStream *connectInputStream(Strigi::InputStream *in);
  39. bool isReadyWithStream();
  40. const char* name() const { return "SidThroughAnalyzer"; }
  41. };
  42. class SidThroughAnalyzerFactory
  43. : public Strigi::StreamThroughAnalyzerFactory {
  44. friend class SidThroughAnalyzer;
  45. private:
  46. const Strigi::RegisteredField* titleField;
  47. const Strigi::RegisteredField* artistField;
  48. const Strigi::RegisteredField* copyrightField;
  49. const Strigi::RegisteredField* versionField;
  50. const Strigi::RegisteredField* trackNumberField;
  51. const char* name() const {
  52. return "SidThroughAnalyzer";
  53. }
  54. Strigi::StreamThroughAnalyzer* newInstance() const {
  55. return new SidThroughAnalyzer(this);
  56. }
  57. void registerFields(Strigi::FieldRegister&);
  58. };
  59. #endif