-
Notifications
You must be signed in to change notification settings - Fork 0
/
TextFile.h
41 lines (26 loc) · 939 Bytes
/
TextFile.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
/*
-------------------------------------------------------------------------
OBJECT NAME: textfile.c
FULL NAME: Read/Free Text File
DESCRIPTION: Reads a text file into the user supplied list of pointers.
Comment lines and blank lines are removed. A comment line
is one which starts with '#'.
COPYRIGHT: University Corporation for Atmospheric Research, 2020
-------------------------------------------------------------------------
*/
#ifndef _libraf_textfile_h_
#define _libraf_textfile_h_
#include <string>
#include <vector>
/* -------------------------------------------------------------------- */
class TextFile {
public:
TextFile(const std::string& filename);
size_t size() { return _lines.size(); }
std::string& Line(int index) { return _lines[index]; }
// const char * Line(int index) { return _lines[index].c_str(); }
protected:
std::vector<std::string> _lines;
static const char COMMENT;
};
#endif