merge successful with staging
[biocity.git] / src / ConfReader.hh
blobe2794a278d98ae0200323d469aae2c57684cbabb
1 #ifndef _CONFREADER_HH_
2 #define _CONFREADER_HH_
3 #include <string>
4 #include <iostream>
5 #include <fstream>
6 #include <sstream>
8 using namespace std;
10 class ConfReader
12 string filename;
13 string fields[16];
14 string values[16];
15 bool read_success;
17 public:
19 /**
20 * From a loaded configuration file, this function
21 * attempts to find the associated (int) value and if
22 * it is found, then it is stored in the variable
23 * pointed to by the pointer.
24 * @param _field: The field to find
25 * @param value: a pointer to the storage location
26 * @return: true if found, false if not found
27 * */
28 bool field_int( string _field, int *value);
30 /**
31 * From a loaded configuration file, this function
32 * attempts to find the associated (double) value and if
33 * it is found, then it is stored in the variable
34 * pointed to by the pointer.
35 * @param _field The field to find.
36 * @param value a pointer to the storage location
37 * @return true if the value is found, false otherwise
39 bool field_double( string _field, double *value);
41 /**
42 * From a loaded configuration file, this function
43 * attempts to find the associated (double) value and if
44 * it is found, then it is stored in the variable
45 * pointed to by the pointer.
46 * @param _field The field to find.
47 * @param value a pointer to the storage location
48 * @return true if the value is found, false otherwise
50 bool field_string( string _field, string *value);
52 ConfReader( string _filename );
53 bool success();
56 #endif