21 #include <strigi/analyzerplugin.h>
22 #include <strigi/streamendanalyzer.h>
23 #include <strigi/streamsaxanalyzer.h>
24 #include <strigi/streamthroughanalyzer.h>
25 #include <strigi/streamlineanalyzer.h>
26 #include <strigi/streameventanalyzer.h>
27 #include <config-strigi.h>
29 using namespace Strigi;
32 class DummyEndAnalyzerFactory;
33 class DummyThroughAnalyzerFactory;
34 class DummySaxAnalyzerFactory;
35 class DummyLineAnalyzerFactory;
36 class DummyEventAnalyzerFactory;
38 class STRIGI_PLUGIN_API DummyEndAnalyzer :
public StreamEndAnalyzer {
41 bool checkHeader(
const char*, int32_t)
const {
44 STRIGI_ENDANALYZER_RETVAL analyze(Strigi::AnalysisResult&, InputStream*) {
47 const char*
name()
const {
return "DummyEndAnalyzer"; }
49 class STRIGI_PLUGIN_API DummyEndAnalyzerFactory :
public StreamEndAnalyzerFactory {
50 const char*
name()
const {
51 return "DummyEndAnalyzerFactory";
53 void registerFields(Strigi::FieldRegister&) {}
54 StreamEndAnalyzer* newInstance()
const {
55 return new DummyEndAnalyzer();
58 class STRIGI_PLUGIN_API DummyThroughAnalyzer :
public StreamThroughAnalyzer {
60 DummyThroughAnalyzer() {}
61 const char*
name()
const {
62 return "DummyThroughAnalyzer";
64 void setIndexable(Strigi::AnalysisResult*) {}
65 InputStream* connectInputStream(InputStream *in) {
68 bool isReadyWithStream() {
return true; }
70 class STRIGI_PLUGIN_API DummyThroughAnalyzerFactory :
public StreamThroughAnalyzerFactory {
71 const char*
name()
const {
72 return "DummyThroughAnalyzerFactory";
74 void registerFields(Strigi::FieldRegister&) {}
75 StreamThroughAnalyzer* newInstance()
const {
76 return new DummyThroughAnalyzer();
79 class STRIGI_PLUGIN_API DummySaxAnalyzer :
public StreamSaxAnalyzer {
82 const char*
name()
const {
return "DummySaxAnalyzer"; }
83 void startAnalysis(AnalysisResult*) {}
84 void endAnalysis(
bool ) {}
85 bool isReadyWithStream() {
return true; }
87 class STRIGI_PLUGIN_API DummySaxAnalyzerFactory :
public StreamSaxAnalyzerFactory {
88 const char*
name()
const {
89 return "DummySaxAnalyzerFactory";
91 void registerFields(Strigi::FieldRegister&) {}
92 StreamSaxAnalyzer* newInstance()
const {
93 return new DummySaxAnalyzer();
96 class STRIGI_PLUGIN_API DummyLineAnalyzer :
public StreamLineAnalyzer {
98 DummyLineAnalyzer() {}
99 const char*
name()
const {
return "DummyLineAnalyzer"; }
100 void startAnalysis(AnalysisResult*) {}
101 void endAnalysis(
bool ) {}
102 void handleLine(
const char*, uint32_t) {}
103 bool isReadyWithStream() {
return true; }
105 class STRIGI_PLUGIN_API DummyLineAnalyzerFactory :
public StreamLineAnalyzerFactory {
106 const char*
name()
const {
107 return "DummyLineAnalyzerFactory";
109 void registerFields(Strigi::FieldRegister&) {}
110 StreamLineAnalyzer* newInstance()
const {
111 return new DummyLineAnalyzer();
114 class STRIGI_PLUGIN_API DummyEventAnalyzer :
public StreamEventAnalyzer {
116 DummyEventAnalyzer() {}
117 const char*
name()
const {
return "DummyEventAnalyzer"; }
118 void startAnalysis(AnalysisResult*) {}
119 void endAnalysis(
bool ) {}
120 void handleData(
const char*, uint32_t) {}
121 bool isReadyWithStream() {
return true; }
123 class STRIGI_PLUGIN_API DummyEventAnalyzerFactory :
public StreamEventAnalyzerFactory {
124 const char*
name()
const {
125 return "DummyEventAnalyzerFactory";
127 void registerFields(Strigi::FieldRegister&) {}
128 StreamEventAnalyzer* newInstance()
const {
129 return new DummyEventAnalyzer();
133 class Factory :
public AnalyzerFactoryFactory {
135 list<StreamEndAnalyzerFactory*>
136 streamEndAnalyzerFactories()
const {
137 list<StreamEndAnalyzerFactory*> af;
138 af.push_back(
new DummyEndAnalyzerFactory());
141 list<StreamThroughAnalyzerFactory*>
142 streamThroughAnalyzerFactories()
const {
143 list<StreamThroughAnalyzerFactory*> af;
144 af.push_back(
new DummyThroughAnalyzerFactory());
147 list<StreamSaxAnalyzerFactory*>
148 streamSaxAnalyzerFactories()
const {
149 list<StreamSaxAnalyzerFactory*> af;
150 af.push_back(
new DummySaxAnalyzerFactory());
153 list<StreamLineAnalyzerFactory*>
154 streamLineAnalyzerFactories()
const {
155 list<StreamLineAnalyzerFactory*> af;
156 af.push_back(
new DummyLineAnalyzerFactory());
159 list<StreamEventAnalyzerFactory*>
160 streamEventAnalyzerFactories()
const {
161 list<StreamEventAnalyzerFactory*> af;
162 af.push_back(
new DummyEventAnalyzerFactory());
170 STRIGI_ANALYZER_FACTORY(Factory)