This commit is contained in:
2025-05-13 02:46:21 +03:00
parent 143e16692e
commit 86914b7fcc
610 changed files with 92343 additions and 2 deletions
+52
View File
@@ -0,0 +1,52 @@
#ifndef IFILE_H__
#define IFILE_H__
#include "../IDataStream.h"
#include "../LString.h"
#include "IContentProvider.h"
#include "../Types.h"
#include "../delegate/Delegate.h"
namespace LifeCore
{
enum FILE_ACCESS
{
FA_READ = 1,
FA_WRITE = 2,
FA_READ_WRITE = 3
};
enum FILE_MODE
{
FM_CREATE_NEW = 1,
FM_CREATE = 2,
FM_OPEN = 3,
FM_OPEN_OR_CREATE = 4,
FM_TRUNCATE = 5,
FM_APPEND = 6,
};
class IFile
{
public:
EVENT1(FileEvent, LifeCore::IFile*);
FileEvent Event_EndReadAsync;
int Size;
IContentProvider* Provider;
String FileName;
virtual ~IFile(){}
virtual bool ReadAsync(char* buffer, size_t count_read)
{
UNREFERENCED_PARAMETER(buffer);
UNREFERENCED_PARAMETER(count_read);
return false;
}
virtual IDataStreamPtr OpenRead() = 0;
virtual IDataStreamPtr OpenWrite(int mode) = 0;
virtual IDataStreamPtr OpenReadWrite(int mode) = 0;
protected:
_bool isOpen;
};
}
#endif