-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDgInputStream.h
56 lines (38 loc) · 1.57 KB
/
DgInputStream.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
////////////////////////////////////////////////////////////////////////////////
//
// DgInputStream.h: DgInputStream class definition
//
// This class provides wrappers around some basic input stream functionality
// to increase ease of use.
//
// Version 6.2 - Kevin Sahr, 9/10/13
//
////////////////////////////////////////////////////////////////////////////////
#ifndef DGINPUTSTREAM_H
#define DGINPUTSTREAM_H
#include <fstream>
#include <string>
using namespace std;
#include "DgBase.h"
////////////////////////////////////////////////////////////////////////////////
class DgInputStream : public ifstream, public DgBase {
public:
DgInputStream (void) : DgBase ("DgInputStream") {}
DgInputStream (const string& fileNameIn,
const string& suffixIn = string(""),
DgReportLevel failLevel = DgBase::Fatal);
bool open (string fileName, DgReportLevel failLevel = DgBase::Fatal);
static void setDefaultDir (const string& defaultDirIn)
{ defaultDirectory_ = defaultDirIn; }
void setSuffix (const string& suffixIn) { suffix_ = suffixIn; }
const string& defaultDir (void) const { return defaultDirectory_; }
const string& fileName (void) const { return fileName_; }
const string& suffix (void) const { return suffix_; }
void rewind (void) { seekg(streampos(0)); clear(); }
private:
static string defaultDirectory_;
string fileName_;
string suffix_;
};
////////////////////////////////////////////////////////////////////////////////
#endif