blob: c80d0f4a2244f2adb852a3655b8f9e89d236f514 (
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 "FileStrategy.h"
class LocalFile : FileStrategy {
protected:
virtual void open(const std::string url);
public:
virtual void close();
virtual const std::string read();
public:
virtual ~LocalFile();
private:
LocalFile(const LocalFile *);
virtual LocalFile * clone() const;
private:
using FileStrategy::FileStrategy;
constexpr static const std::string protocol = "file://";
static LocalFile instance;
private:
std::ifstream * file = nullptr;
std::string * content = nullptr;
};
|