All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WindowsFileIO.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "IFileIO.h"
6 #include "Types.h"
7 #include <set>
8 #include <vector>
9 #include <string>
10 #include <iostream>
11 #include <sys/stat.h>
12 
13 struct WindowsNativeState;
14 
15 namespace Eegeo
16 {
17  namespace Windows
18  {
20  {
21  WindowsNativeState* m_pState;
22  std::wstring m_appReadFileDirPath;
23  std::wstring m_appWriteFileDirPath;
24 
25  std::wstring QueryAppFileDirPath(WindowsNativeState& nativeState) const;
26  public:
27 
29  const std::string& overrideReadPath = std::string(""),
30  const std::string& overrideWritePath = std::string(""));
31  ~WindowsFileIO();
32 
33  bool OpenFile(std::fstream& stream, size_t& size, const std::string& name, std::ios_base::openmode mode=std::ifstream::in);
34  bool WriteFile(const Byte* data, size_t size, const std::string& name, std::ios_base::openmode mode=std::ifstream::out);
35  bool DeleteFile(const std::string& name);
36  bool Exists(const std::string& name);
37  std::string GetAppFilePathname(const std::string& filename);
38  bool TryStat(const std::string& name, Helpers::FileStat& out_s);
39  };
40  }
41 }