AppEasy Core SDK
1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
|
00001 // 00002 // 00003 // AppEasy SDK - Cross Platform Multi-purpose Game and App Engine 00004 // 00005 // Developed by Matthew Hopwood of Pocketeers Limited - www.pocketeers.co.uk 00006 // 00007 // For updates, tutorials and more details check out www.appeasymobile.com 00008 // 00009 // This code is provided free of charge and without any warranty whatsoever. You must ensure that this whole notice is present in all files and derivatives, so the reader knows its origin. 00010 // If you use this SDK in your product then please ensure that you credit AppEasy's usage appropriately. Please see www.appeasymobile.com for licensing details and support 00011 // 00012 // 00013 00014 #if !defined(_CIZ_PLATFORM_FILE_H_) 00015 #define _CIZ_PLATFORM_FILE_H_ 00016 00017 #include "CzPlatform.h" 00018 00019 #define PLATFORM_FILE PLATFORM->getFile() 00020 00021 enum eCzFileSeekOrigin 00022 { 00023 CzFileSeek_Set, 00024 CzFileSeek_Current, 00025 CzFileSeek_End, 00026 }; 00027 00028 enum eCzFileError 00029 { 00030 CzFileErrorNone, 00031 CzFileErrorInvalidPath, 00032 CzFileErrorOpenFailed, 00033 CzFileErrorAlreadyOpen, 00034 CzFileErrorEmptyMode, 00035 CzFileErrorHttp, 00036 }; 00037 00038 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 00039 // 00040 // IzPlatformFile 00041 // 00042 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 00043 class IzPlatformFile 00044 { 00045 // Properties 00046 protected: 00047 bool Initialised; 00048 public: 00049 bool isInitialised() const { return Initialised; } 00050 // Properties end 00051 public: 00052 virtual int Init() = 0; 00053 virtual void Release() = 0; 00054 00055 virtual CzFileHandle Open(const char* filename, const char* mode) = 0; 00056 virtual CzFileHandle OpenFromMemory(void* memory, uint num_bytes) = 0; 00057 virtual void Close(CzFileHandle file) = 0; 00058 virtual bool Seek(CzFileHandle file, int offset, eCzFileSeekOrigin origin) = 0; 00059 virtual uint Read(CzFileHandle file, void* buffer, uint num_bytes) = 0; 00060 virtual uint Write(CzFileHandle file, void* buffer, uint num_bytes) = 0; 00061 virtual bool Exists(const char* filename) = 0; 00062 virtual bool Delete(const char* filename) = 0; 00063 virtual int getSize(CzFileHandle file) = 0; 00064 virtual const char* getErrorString() = 0; 00065 }; 00066 00067 #endif // _CIZ_PLATFORM_FILE_H_