• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kio
  • dummyanalyzers
dummyanalyzers.cpp
Go to the documentation of this file.
1/* This file is part of Strigi Desktop Search
2 *
3 * Copyright (C) 2006 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//#include <strigi/strigiconfig.h>
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
28using namespace Strigi;
29using namespace std;
30
31class DummyEndAnalyzerFactory;
32class DummyThroughAnalyzerFactory;
33class DummySaxAnalyzerFactory;
34class DummyLineAnalyzerFactory;
35class DummyEventAnalyzerFactory;
36
37class STRIGI_PLUGIN_API DummyEndAnalyzer : public StreamEndAnalyzer {
38public:
39 DummyEndAnalyzer() {}
40 bool checkHeader(const char*, int32_t) const {
41 return false;
42 }
43 signed char analyze(Strigi::AnalysisResult&, InputStream*) {
44 return -1;
45 }
46 const char* name() const { return "DummyEndAnalyzer"; }
47};
48class STRIGI_PLUGIN_API DummyEndAnalyzerFactory : public StreamEndAnalyzerFactory {
49 const char* name() const {
50 return "DummyEndAnalyzerFactory";
51 }
52 void registerFields(Strigi::FieldRegister&) {}
53 StreamEndAnalyzer* newInstance() const {
54 return new DummyEndAnalyzer();
55 }
56};
57class STRIGI_PLUGIN_API DummyThroughAnalyzer : public StreamThroughAnalyzer {
58public:
59 DummyThroughAnalyzer() {}
60 const char* name() const {
61 return "DummyThroughAnalyzer";
62 }
63 void setIndexable(Strigi::AnalysisResult*) {}
64 InputStream* connectInputStream(InputStream *in) {
65 return in;
66 }
67 bool isReadyWithStream() { return true; }
68};
69class STRIGI_PLUGIN_API DummyThroughAnalyzerFactory : public StreamThroughAnalyzerFactory {
70 const char* name() const {
71 return "DummyThroughAnalyzerFactory";
72 }
73 void registerFields(Strigi::FieldRegister&) {}
74 StreamThroughAnalyzer* newInstance() const {
75 return new DummyThroughAnalyzer();
76 }
77};
78class STRIGI_PLUGIN_API DummySaxAnalyzer : public StreamSaxAnalyzer {
79public:
80 DummySaxAnalyzer() {}
81 const char* name() const { return "DummySaxAnalyzer"; }
82 void startAnalysis(AnalysisResult*) {}
83 void endAnalysis(bool /*complete*/) {}
84 bool isReadyWithStream() { return true; }
85};
86class STRIGI_PLUGIN_API DummySaxAnalyzerFactory : public StreamSaxAnalyzerFactory {
87 const char* name() const {
88 return "DummySaxAnalyzerFactory";
89 }
90 void registerFields(Strigi::FieldRegister&) {}
91 StreamSaxAnalyzer* newInstance() const {
92 return new DummySaxAnalyzer();
93 }
94};
95class STRIGI_PLUGIN_API DummyLineAnalyzer : public StreamLineAnalyzer {
96public:
97 DummyLineAnalyzer() {}
98 const char* name() const { return "DummyLineAnalyzer"; }
99 void startAnalysis(AnalysisResult*) {}
100 void endAnalysis(bool /*complete*/) {}
101 void handleLine(const char*, uint32_t) {}
102 bool isReadyWithStream() { return true; }
103};
104class STRIGI_PLUGIN_API DummyLineAnalyzerFactory : public StreamLineAnalyzerFactory {
105 const char* name() const {
106 return "DummyLineAnalyzerFactory";
107 }
108 void registerFields(Strigi::FieldRegister&) {}
109 StreamLineAnalyzer* newInstance() const {
110 return new DummyLineAnalyzer();
111 }
112};
113class STRIGI_PLUGIN_API DummyEventAnalyzer : public StreamEventAnalyzer {
114public:
115 DummyEventAnalyzer() {}
116 const char* name() const { return "DummyEventAnalyzer"; }
117 void startAnalysis(AnalysisResult*) {}
118 void endAnalysis(bool /*complete*/) {}
119 void handleData(const char*, uint32_t) {}
120 bool isReadyWithStream() { return true; }
121};
122class STRIGI_PLUGIN_API DummyEventAnalyzerFactory : public StreamEventAnalyzerFactory {
123 const char* name() const {
124 return "DummyEventAnalyzerFactory";
125 }
126 void registerFields(Strigi::FieldRegister&) {}
127 StreamEventAnalyzer* newInstance() const {
128 return new DummyEventAnalyzer();
129 }
130};
131
132class Factory : public AnalyzerFactoryFactory {
133public:
134 list<StreamEndAnalyzerFactory*>
135 streamEndAnalyzerFactories() const {
136 list<StreamEndAnalyzerFactory*> af;
137 af.push_back(new DummyEndAnalyzerFactory());
138 return af;
139 }
140 list<StreamThroughAnalyzerFactory*>
141 streamThroughAnalyzerFactories() const {
142 list<StreamThroughAnalyzerFactory*> af;
143 af.push_back(new DummyThroughAnalyzerFactory());
144 return af;
145 }
146 list<StreamSaxAnalyzerFactory*>
147 streamSaxAnalyzerFactories() const {
148 list<StreamSaxAnalyzerFactory*> af;
149 af.push_back(new DummySaxAnalyzerFactory());
150 return af;
151 }
152 list<StreamLineAnalyzerFactory*>
153 streamLineAnalyzerFactories() const {
154 list<StreamLineAnalyzerFactory*> af;
155 af.push_back(new DummyLineAnalyzerFactory());
156 return af;
157 }
158 list<StreamEventAnalyzerFactory*>
159 streamEventAnalyzerFactories() const {
160 list<StreamEventAnalyzerFactory*> af;
161 af.push_back(new DummyEventAnalyzerFactory());
162 return af;
163 }
164};
165
166/*
167 Register the AnalyzerFactoryFactory
168*/
169STRIGI_ANALYZER_FACTORY(Factory)
name
const char * name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal