ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
file_reader.h
Go to the documentation of this file.
1#ifndef FILE_READER_H
2#define FILE_READER_H
3
4#include <fstream>
5#include <sstream>
6#include <string>
7
8namespace ModuleIO
9{
10
19{
20 public:
21 // Default constructor
22 FileReader(std::string filename);
24
25 // Check if file is open
26 bool isOpen() const;
27
28 // read a line to string stream
29 void readLine();
30
31 // read unitcell
32 void read_ucell();
33
34 std::stringstream ss;
35
36 protected:
37 // Inspect the next line without consuming it; false at end of file.
38 bool peekLine(std::string& line);
39
40 private:
41 std::ifstream ifs;
42};
43
44} // namespace ModuleIO
45
46#endif
void readLine()
Definition file_reader.cpp:34
std::stringstream ss
Definition file_reader.h:34
bool peekLine(std::string &line)
Definition file_reader.cpp:50
FileReader(std::string filename)
Definition file_reader.cpp:9
bool isOpen() const
Definition file_reader.cpp:28
void read_ucell()
Definition file_reader.cpp:60
~FileReader()
Definition file_reader.cpp:19
std::ifstream ifs
Definition file_reader.h:41
Internal helpers shared by the R-space sparse text writers. Declared here (instead of duplicated in e...
Definition csr_reader.cpp:8