TorqueScript  0.2
filehandlebase.hpp
1 
15 #pragma once
16 
17 #include <string>
18 #include <iostream>
19 
20 namespace TorqueScript
21 {
23  {
24  public:
25  FileHandleBase(const std::string& path);
26  virtual ~FileHandleBase();
27 
28  virtual bool isOpen() = 0;
29 
30  virtual void seek(const std::streampos& position) = 0;
31  virtual void seek(const std::streampos& offset, std::ios_base::seekdir way) = 0;
32 
33  virtual void read(char* out, const std::size_t size) = 0;
34  virtual void close();
35  virtual bool isEOF() = 0;
36  virtual void write(const char* buffer, const std::size_t size) = 0;
37  virtual std::string readLine() = 0;
38 
39  virtual std::streampos tell() = 0;
40 
41  virtual void openForWrite() = 0;
42  virtual void openForRead() = 0;
43  virtual void openForReadAndWrite() = 0;
44 
45  virtual bool exists() = 0;
46  virtual bool deleteFile() = 0;
47 
49  const std::string mPath;
50  };
51 }
Definition: filehandlebase.hpp:23
const std::string mPath
The file path this handle refers to.
Definition: filehandlebase.hpp:49
Definition: ast.hpp:28