PageRenderTime 19ms CodeModel.GetById 10ms app.highlight 7ms 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
23#include <strigi/streamthroughanalyzer.h>
24#include <strigi/analyzerplugin.h>
25
26#include <string>
27
28namespace Strigi {
29    class RegisteredField;
30}
31class SidThroughAnalyzerFactory;
32
33class STRIGI_PLUGIN_API SidThroughAnalyzer
34    : public Strigi::StreamThroughAnalyzer {
35private:
36    Strigi::AnalysisResult* analysisResult;
37    const SidThroughAnalyzerFactory* factory;
38public:
39    SidThroughAnalyzer(const SidThroughAnalyzerFactory* f) :factory(f) {}
40    ~SidThroughAnalyzer() {}
41    void setIndexable(Strigi::AnalysisResult* i);
42    Strigi::InputStream *connectInputStream(Strigi::InputStream *in);
43    bool isReadyWithStream();
44    const char* name() const { return "SidThroughAnalyzer"; }
45};
46
47class SidThroughAnalyzerFactory
48    : public Strigi::StreamThroughAnalyzerFactory {
49friend class SidThroughAnalyzer;
50private:
51    const Strigi::RegisteredField* titleField;
52    const Strigi::RegisteredField* artistField;
53    const Strigi::RegisteredField* copyrightField;
54    const Strigi::RegisteredField* versionField;
55    const Strigi::RegisteredField* trackNumberField;
56
57    const char* name() const {
58        return "SidThroughAnalyzer";
59    }
60    Strigi::StreamThroughAnalyzer* newInstance() const {
61        return new SidThroughAnalyzer(this);
62    }
63    void registerFields(Strigi::FieldRegister&);
64};
65
66#endif