Jouni's Incremental BWT integrated into TextCollection
[SXSI/TextCollection.git] / incbwt / misc / parameters.h
1 #ifndef PARAMETERS_H
2 #define PARAMETERS_H
3
4 #include <fstream>
5 #include <map>
6
7 #include "definitions.h"
8
9
10 namespace CSA
11 {
12
13
14 typedef std::pair<std::string, usint> parameter_type;
15
16
17 class Parameters
18 {
19   public:
20     Parameters();
21     ~Parameters();
22
23     bool contains(const std::string& key);
24     usint get(const std::string& key);
25     usint get(const parameter_type& param);
26     void set(const std::string& key, usint value);
27     void set(const parameter_type& param);
28
29     void read(std::ifstream& file);
30     void read(const std::string& file_name);
31     void print();
32     void write(std::ostream& stream);
33     void write(const std::string& file_name);
34
35   private:
36     std::map<std::string, usint> parameters;
37 };
38
39
40 } // namespace CSA
41
42
43 #endif