OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
FileStream.h
Go to the documentation of this file.
1#ifndef CLASSIC_FileStream_HH
2#define CLASSIC_FileStream_HH
3
4// ------------------------------------------------------------------------
5// $RCSfile: FileStream.h,v $
6// ------------------------------------------------------------------------
7// $Revision: 1.1.1.1 $
8// ------------------------------------------------------------------------
9// Copyright: see Copyright.readme
10// ------------------------------------------------------------------------
11//
12// Class: FileStream
13//
14// ------------------------------------------------------------------------
15// Class category: Parser
16// ------------------------------------------------------------------------
17//
18// $Date: 2000/03/27 09:32:37 $
19// $Author: fci $
20//
21// ------------------------------------------------------------------------
22
24#include <fstream>
25
26
27// Class FileStream
28// ------------------------------------------------------------------------
30// The source of tokens is a named disk file.
31
33
34public:
35
37 // Open associated file.
38 explicit FileStream(const std::string &name);
39
41 // Close associated file.
42 virtual ~FileStream();
43
45 virtual bool fillLine();
46
48 // If [b]flag[/b] is true, the subsequent input lines are echoed to
49 // the standard error stream.
50 static void setEcho(bool flag);
51
53 static bool getEcho();
54
55private:
56
57 // Not implemented.
60 void operator=(const FileStream &);
61
62 // Current file stream.
63 std::ifstream is;
64
65 // Flag for statement echo.
66 static bool echoFlag;
67};
68
69#endif // CLASSIC_FileStream_HH
const std::string name
A stream of input tokens.
Definition: AbsFileStream.h:31
A stream of input tokens.
Definition: FileStream.h:32
static bool getEcho()
Return echo flag.
Definition: FileStream.cpp:52
std::ifstream is
Definition: FileStream.h:63
virtual ~FileStream()
Destructor.
Definition: FileStream.cpp:43
static void setEcho(bool flag)
Set echo flag.
Definition: FileStream.cpp:47
FileStream(const FileStream &)
void operator=(const FileStream &)
static bool echoFlag
Definition: FileStream.h:66
virtual bool fillLine()
Read next input line.
Definition: FileStream.cpp:57