forked from schrodinger/maeparser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReader.hpp
More file actions
47 lines (37 loc) · 1.27 KB
/
Reader.hpp
File metadata and controls
47 lines (37 loc) · 1.27 KB
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
#pragma once
#include <boost/iostreams/filtering_streambuf.hpp>
#include <cstdio>
#include <string>
#include "Buffer.hpp"
#include "MaeBlock.hpp"
#include "MaeParser.hpp"
#include "MaeParserConfig.hpp"
namespace schrodinger
{
namespace mae
{
class EXPORT_MAEPARSER Reader
{
private:
std::shared_ptr<MaeParser> m_mae_parser;
std::shared_ptr<std::ifstream> m_pregzip_stream;
std::shared_ptr<boost::iostreams::filtering_istreambuf> m_gzip_stream;
public:
Reader(FILE* file, size_t buffer_size = BufferLoader::DEFAULT_SIZE)
{
m_mae_parser.reset(new MaeParser(file, buffer_size));
}
Reader(std::shared_ptr<std::istream> stream,
size_t buffer_size = BufferLoader::DEFAULT_SIZE)
{
m_mae_parser.reset(new MaeParser(stream, buffer_size));
}
Reader(std::string fname, size_t buffer_size = BufferLoader::DEFAULT_SIZE);
// Should be made private if we conclude there's no need for the
// DirectParser. The only current purpose of allowing construction from a
// MaeParser is to allow direct/buffered behavior difference.
Reader(std::shared_ptr<MaeParser> mae_parser) : m_mae_parser(mae_parser) {}
std::shared_ptr<Block> next(const std::string& outer_block_name);
};
} // namespace mae
} // namespace schrodinger