mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-12-14 14:21:17 +00:00
87d46ddd11
## 1.5.0 2020-09-28 * Drum note length expanding is now supported in real-time mode (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!) * Added support for OPNA chip with Neko Project II Kai YM2602 emulator usage (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!) * Added VGM file dumper which allows to output OPN2 commands into VGM file. (A new MIDI to VGM tool is now created with basing on libOPNMIDI) * Fixed an incorrect work of CC-121 (See https://github.com/Wohlstand/libADLMIDI/issues/227 for details) * Internality has been refactored and improved
64 lines
1.1 KiB
C++
64 lines
1.1 KiB
C++
// $Id: file.h,v 1.6 1999/11/26 10:14:09 cisc Exp $
|
|
|
|
#if !defined(win32_file_h)
|
|
#define win32_file_h
|
|
|
|
#include "fmgen_types.h"
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
class FileIO
|
|
{
|
|
public:
|
|
enum Flags
|
|
{
|
|
open = 0x000001,
|
|
readonly = 0x000002,
|
|
create = 0x000004
|
|
};
|
|
|
|
enum SeekMethod
|
|
{
|
|
begin = 0, current = 1, end = 2
|
|
};
|
|
|
|
enum Error
|
|
{
|
|
success = 0,
|
|
file_not_found,
|
|
sharing_violation,
|
|
unknown = -1
|
|
};
|
|
|
|
public:
|
|
FileIO();
|
|
FileIO(const char* filename, uint flg = 0);
|
|
virtual ~FileIO();
|
|
|
|
bool Open(const char* filename, uint flg = 0);
|
|
bool CreateNew(const char* filename);
|
|
bool Reopen(uint flg = 0);
|
|
void Close();
|
|
Error GetError() { return error; }
|
|
|
|
int32 Read(void* dest, int32 len);
|
|
int32 Write(const void* src, int32 len);
|
|
bool Seek(int32 fpos, SeekMethod method);
|
|
int32 Tellp();
|
|
bool SetEndOfFile();
|
|
|
|
uint GetFlags() { return flags; }
|
|
void SetLogicalOrigin(int32 origin) { lorigin = origin; }
|
|
|
|
private:
|
|
FILE* pfile;
|
|
uint flags;
|
|
uint32 lorigin;
|
|
Error error;
|
|
char path[MAX_PATH];
|
|
|
|
FileIO(const FileIO&);
|
|
const FileIO& operator=(const FileIO&);
|
|
};
|
|
|
|
#endif //
|