add more spacing
[personal-kdebase.git] / runtime / nepomuk / strigibackend / sopranoindexwriter.h
blob85ba1d1e2cb1b8696c18d03705c934981b15cdf6
1 /*
2 Copyright (C) 2007-2008 Sebastian Trueg <trueg@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of
7 the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this library; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef _SOPRANO_STRIGI_INDEXER_H_
21 #define _SOPRANO_STRIGI_INDEXER_H_
23 #include <strigi/indexwriter.h>
24 #include <strigi/analysisresult.h>
25 #include <strigi/analyzerconfiguration.h>
27 namespace Soprano {
28 class Model;
29 namespace Index {
30 class IndexFilterModel;
35 namespace Strigi {
36 namespace Soprano {
38 class IndexWriter : public Strigi::IndexWriter
40 public:
41 IndexWriter( ::Soprano::Model* );
42 ~IndexWriter();
44 void commit();
46 /**
47 * Delete the entries with the given paths from the index.
49 * @param entries the paths of the files that should be deleted
50 **/
51 void deleteEntries( const std::vector<std::string>& entries );
53 /**
54 * Delete all indexed documents from the index.
55 **/
56 void deleteAllEntries();
58 void initWriterData( const Strigi::FieldRegister& );
59 void releaseWriterData( const Strigi::FieldRegister& );
61 void startAnalysis( const AnalysisResult* );
62 void addText( const AnalysisResult*, const char* text, int32_t length );
63 void addValue( const AnalysisResult*, const RegisteredField* field,
64 const std::string& value );
65 void addValue( const AnalysisResult*, const RegisteredField* field,
66 const unsigned char* data, uint32_t size );
67 void addValue( const AnalysisResult*, const RegisteredField* field,
68 int32_t value );
69 void addValue( const AnalysisResult*, const RegisteredField* field,
70 uint32_t value );
71 void addValue( const AnalysisResult*, const RegisteredField* field,
72 double value );
73 void addTriplet( const std::string& subject,
74 const std::string& predicate, const std::string& object );
75 void addValue( const AnalysisResult*, const RegisteredField* field,
76 const std::string& name, const std::string& value );
77 void finishAnalysis( const AnalysisResult* );
79 private:
80 class Private;
81 Private* d;
86 uint qHash( const std::string& s );
88 #endif