aboutsummaryrefslogtreecommitdiff
path: root/LocalFileReader.h
blob: 6ea4f84edef71d99feee37cf5efa46106f64b644 (plain)
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
#pragma once

#include <fstream>

#include "FileReader.h"

class LocalFileReader : FileReader {
protected:
	virtual void open(const std::string url);
public:
	virtual void close();
	virtual const std::string read();

public:
	virtual ~LocalFileReader();

private:
	LocalFileReader(const LocalFileReader *);
	virtual LocalFileReader * clone() const;

private:
	using FileReader::FileReader;
	constexpr static const std::string protocol = "file://";
	static LocalFileReader instance;

private:
	std::ifstream * file = nullptr;
	std::string * content = nullptr;
};