All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
AndroidCacheFileIO.h
1 // Copyright (c) 2014 eeGeo. All rights reserved.
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "IFileIO.h"
7 #include "AndroidNativeState.h"
8 #include "AndroidStorageFullAlertBoxHandler.h"
9 
10 #include <string>
11 
12 namespace Eegeo
13 {
14  namespace Android
15  {
17  {
18  std::string m_assetPathPrefix;
19 
20  std::string GetPath(const std::string& name) const;
21 
22  AndroidStorageFullAlertBoxHandler* m_pAndroidStorageFullAlertBoxHandler;
23  public:
24  AndroidCacheFileIO(AndroidNativeState* pState, AndroidStorageFullAlertBoxHandler* pAndroidStorageFullAlertBoxHandler = nullptr);
25  virtual ~AndroidCacheFileIO();
26 
27  virtual bool OpenFile(std::fstream& stream, size_t& size, const std::string& name, std::ios_base::openmode mode=std::ifstream::in);
28  virtual bool WriteFile(const Byte* data, size_t size, const std::string& name, std::ios_base::openmode mode=std::ifstream::out);
29  virtual bool DeleteFile(const std::string& name);
30  virtual bool Exists(const std::string& name);
31  virtual std::string GetAppFilePathname(const std::string& filename);
32  virtual bool TryStat(const std::string& name, Helpers::FileStat& out_filestat);
33  };
34 
35  }
36 }