-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfigFile.H
39 lines (37 loc) · 1.28 KB
/
ConfigFile.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/***********************************************************************
ConfigFile.H
BOOM : Bioinformatics Object Oriented Modules
Copyright (C)2012 William H. Majoros ([email protected]).
This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
License (GPL) version 3, as described at www.opensource.org.
***********************************************************************/
#ifndef INCL_BOOM_ConfigFile_H
#define INCL_BOOM_ConfigFile_H
#include <iostream>
#include "StrTokenizer.H"
#include "Map.H"
using namespace std;
namespace BOOM {
class ConfigFile
{
public:
ConfigFile();
ConfigFile(BOOM::String fname);
virtual BOOM::String lookup(BOOM::String attr);
virtual BOOM::String lookupOrDie(BOOM::String attr);
virtual double getDoubleOrDie(BOOM::String attr);
virtual float getFloatOrDie(BOOM::String attr);
virtual int getIntOrDie(BOOM::String attr);
virtual long getLongOrDie(BOOM::String attr);
virtual bool getBoolOrDie(BOOM::String attr);
virtual bool isDefined(BOOM::String key);
void enter(BOOM::String,BOOM::String);
BOOM::Map<BOOM::String,BOOM::String> &peek();
private:
BOOM::Map<BOOM::String,BOOM::String> dict;
const char *charLookupOrDie(BOOM::String attr);
void load(BOOM::String fname);
void processLine(BOOM::StrTokenizer &);
};
}
#endif