/strigi-0.7.7/libstreamanalyzer/lib/endanalyzers/lzmaendanalyzer.h
C Header | 54 lines | 30 code | 5 blank | 19 comment | 0 complexity | 0db8c8dc6d3aa939be58c39dae7308f0 MD5 | raw file
Possible License(s): LGPL-2.0
1/* This file is part of Strigi Desktop Search
2 *
3 * Copyright (C) 2009 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 LZMAENDANALYZER
21#define LZMAENDANALYZER
22
23#include <strigi/streamendanalyzer.h>
24#include <strigi/streambase.h>
25
26class LzmaEndAnalyzerFactory;
27class LzmaEndAnalyzer : public Strigi::StreamEndAnalyzer {
28private:
29 const LzmaEndAnalyzerFactory* factory;
30public:
31 LzmaEndAnalyzer(const LzmaEndAnalyzerFactory* f)
32 :factory(f) {}
33
34 bool checkHeader(const char* header, int32_t headersize) const;
35 signed char analyze(Strigi::AnalysisResult& idx, Strigi::InputStream* in);
36 const char* name() const { return "LzmaEndAnalyzer"; }
37};
38
39class LzmaEndAnalyzerFactory : public Strigi::StreamEndAnalyzerFactory {
40friend class LzmaEndAnalyzer;
41private:
42 const Strigi::RegisteredField* typeField;
43public:
44 const char* name() const {
45 return "LzmaEndAnalyzer";
46 }
47 Strigi::StreamEndAnalyzer* newInstance() const {
48 return new LzmaEndAnalyzer(this);
49 }
50 bool analyzesSubStreams() const { return true; }
51 void registerFields(Strigi::FieldRegister&);
52};
53
54#endif