xapian-core  1.4.20
index_utils.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2005,2007,2013 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef XAPIAN_HGUARD_INDEX_UTILS_H
22 #define XAPIAN_HGUARD_INDEX_UTILS_H
23 
24 #include <fstream>
25 #include <string>
26 #include <vector>
27 
28 #include <xapian.h>
29 
30 class FileIndexer {
31  std::string datadir;
32  std::vector<std::string>::const_iterator file, end;
33  std::ifstream input;
34 
35  void next_file();
36 
37  public:
38  FileIndexer(const std::string & datadir_,
39  const std::vector<std::string> & files)
40  : datadir(datadir_), file(files.begin()), end(files.end())
41  {
42  next_file();
43  }
44 
46 };
47 
48 #endif /* XAPIAN_HGUARD_INDEX_UTILS_H */
void next_file()
Definition: index_utils.cc:158
std::string datadir
Definition: index_utils.h:31
std::vector< std::string >::const_iterator end
Definition: index_utils.h:32
This class provides read/write access to a database.
Definition: database.h:785
Public interfaces for the Xapian library.
std::ifstream input
Definition: index_utils.h:33
void index_to(Xapian::WritableDatabase &db)
Definition: index_utils.cc:52
FileIndexer(const std::string &datadir_, const std::vector< std::string > &files)
Definition: index_utils.h:38
std::vector< std::string >::const_iterator file
Definition: index_utils.h:32