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>
28using namespace Strigi;
31class DummyEndAnalyzerFactory;
32class DummyThroughAnalyzerFactory;
33class DummySaxAnalyzerFactory;
34class DummyLineAnalyzerFactory;
35class DummyEventAnalyzerFactory;
37class STRIGI_PLUGIN_API DummyEndAnalyzer :
public StreamEndAnalyzer {
40 bool checkHeader(
const char*, int32_t)
const {
43 signed char analyze(Strigi::AnalysisResult&, InputStream*) {
46 const char*
name()
const {
return "DummyEndAnalyzer"; }
48class STRIGI_PLUGIN_API DummyEndAnalyzerFactory :
public StreamEndAnalyzerFactory {
49 const char*
name()
const {
50 return "DummyEndAnalyzerFactory";
52 void registerFields(Strigi::FieldRegister&) {}
53 StreamEndAnalyzer* newInstance()
const {
54 return new DummyEndAnalyzer();
57class STRIGI_PLUGIN_API DummyThroughAnalyzer :
public StreamThroughAnalyzer {
59 DummyThroughAnalyzer() {}
60 const char*
name()
const {
61 return "DummyThroughAnalyzer";
63 void setIndexable(Strigi::AnalysisResult*) {}
64 InputStream* connectInputStream(InputStream *in) {
67 bool isReadyWithStream() {
return true; }
69class STRIGI_PLUGIN_API DummyThroughAnalyzerFactory :
public StreamThroughAnalyzerFactory {
70 const char*
name()
const {
71 return "DummyThroughAnalyzerFactory";
73 void registerFields(Strigi::FieldRegister&) {}
74 StreamThroughAnalyzer* newInstance()
const {
75 return new DummyThroughAnalyzer();
78class STRIGI_PLUGIN_API DummySaxAnalyzer :
public StreamSaxAnalyzer {
81 const char*
name()
const {
return "DummySaxAnalyzer"; }
82 void startAnalysis(AnalysisResult*) {}
83 void endAnalysis(
bool ) {}
84 bool isReadyWithStream() {
return true; }
86class STRIGI_PLUGIN_API DummySaxAnalyzerFactory :
public StreamSaxAnalyzerFactory {
87 const char*
name()
const {
88 return "DummySaxAnalyzerFactory";
90 void registerFields(Strigi::FieldRegister&) {}
91 StreamSaxAnalyzer* newInstance()
const {
92 return new DummySaxAnalyzer();
95class STRIGI_PLUGIN_API DummyLineAnalyzer :
public StreamLineAnalyzer {
97 DummyLineAnalyzer() {}
98 const char*
name()
const {
return "DummyLineAnalyzer"; }
99 void startAnalysis(AnalysisResult*) {}
100 void endAnalysis(
bool ) {}
101 void handleLine(
const char*, uint32_t) {}
102 bool isReadyWithStream() {
return true; }
104class STRIGI_PLUGIN_API DummyLineAnalyzerFactory :
public StreamLineAnalyzerFactory {
105 const char*
name()
const {
106 return "DummyLineAnalyzerFactory";
108 void registerFields(Strigi::FieldRegister&) {}
109 StreamLineAnalyzer* newInstance()
const {
110 return new DummyLineAnalyzer();
113class STRIGI_PLUGIN_API DummyEventAnalyzer :
public StreamEventAnalyzer {
115 DummyEventAnalyzer() {}
116 const char*
name()
const {
return "DummyEventAnalyzer"; }
117 void startAnalysis(AnalysisResult*) {}
118 void endAnalysis(
bool ) {}
119 void handleData(
const char*, uint32_t) {}
120 bool isReadyWithStream() {
return true; }
122class STRIGI_PLUGIN_API DummyEventAnalyzerFactory :
public StreamEventAnalyzerFactory {
123 const char*
name()
const {
124 return "DummyEventAnalyzerFactory";
126 void registerFields(Strigi::FieldRegister&) {}
127 StreamEventAnalyzer* newInstance()
const {
128 return new DummyEventAnalyzer();
132class Factory :
public AnalyzerFactoryFactory {
134 list<StreamEndAnalyzerFactory*>
135 streamEndAnalyzerFactories()
const {
136 list<StreamEndAnalyzerFactory*> af;
137 af.push_back(
new DummyEndAnalyzerFactory());
140 list<StreamThroughAnalyzerFactory*>
141 streamThroughAnalyzerFactories()
const {
142 list<StreamThroughAnalyzerFactory*> af;
143 af.push_back(
new DummyThroughAnalyzerFactory());
146 list<StreamSaxAnalyzerFactory*>
147 streamSaxAnalyzerFactories()
const {
148 list<StreamSaxAnalyzerFactory*> af;
149 af.push_back(
new DummySaxAnalyzerFactory());
152 list<StreamLineAnalyzerFactory*>
153 streamLineAnalyzerFactories()
const {
154 list<StreamLineAnalyzerFactory*> af;
155 af.push_back(
new DummyLineAnalyzerFactory());
158 list<StreamEventAnalyzerFactory*>
159 streamEventAnalyzerFactories()
const {
160 list<StreamEventAnalyzerFactory*> af;
161 af.push_back(
new DummyEventAnalyzerFactory());
169STRIGI_ANALYZER_FACTORY(Factory)
const char * name(StandardAction id)