mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
set svn:eol-style=native for **.h
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1438 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1,61 +1,61 @@
|
||||
#ifndef __LAMEFILE_H__
|
||||
#define __LAMEFILE_H__
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#include <windows.h>
|
||||
|
||||
namespace W32Util
|
||||
{
|
||||
|
||||
enum eFileMode
|
||||
{
|
||||
FILE_READ=5,
|
||||
FILE_WRITE=6,
|
||||
FILE_ERROR=0xff
|
||||
};
|
||||
|
||||
class File
|
||||
{
|
||||
HANDLE fileHandle;
|
||||
eFileMode mode;
|
||||
bool isOpen;
|
||||
public:
|
||||
File();
|
||||
virtual ~File();
|
||||
|
||||
bool Open(const TCHAR *filename, eFileMode mode);
|
||||
void Adopt(HANDLE h) { fileHandle = h;}
|
||||
void Close();
|
||||
|
||||
void WriteInt(int i);
|
||||
void WriteChar(char i);
|
||||
int Write(void *data, int size);
|
||||
|
||||
|
||||
int ReadInt();
|
||||
char ReadChar();
|
||||
int Read(void *data, int size);
|
||||
|
||||
int WR(void *data, int size); //write or read depending on open mode
|
||||
bool MagicCookie(int cookie);
|
||||
|
||||
int GetSize();
|
||||
eFileMode GetMode() {return mode;}
|
||||
void SeekBeg(int pos)
|
||||
{
|
||||
if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_BEGIN);
|
||||
}
|
||||
void SeekEnd(int pos)
|
||||
{
|
||||
if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_END);
|
||||
}
|
||||
void SeekCurrent(int pos)
|
||||
{
|
||||
if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_CURRENT);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifndef __LAMEFILE_H__
|
||||
#define __LAMEFILE_H__
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#include <windows.h>
|
||||
|
||||
namespace W32Util
|
||||
{
|
||||
|
||||
enum eFileMode
|
||||
{
|
||||
FILE_READ=5,
|
||||
FILE_WRITE=6,
|
||||
FILE_ERROR=0xff
|
||||
};
|
||||
|
||||
class File
|
||||
{
|
||||
HANDLE fileHandle;
|
||||
eFileMode mode;
|
||||
bool isOpen;
|
||||
public:
|
||||
File();
|
||||
virtual ~File();
|
||||
|
||||
bool Open(const TCHAR *filename, eFileMode mode);
|
||||
void Adopt(HANDLE h) { fileHandle = h;}
|
||||
void Close();
|
||||
|
||||
void WriteInt(int i);
|
||||
void WriteChar(char i);
|
||||
int Write(void *data, int size);
|
||||
|
||||
|
||||
int ReadInt();
|
||||
char ReadChar();
|
||||
int Read(void *data, int size);
|
||||
|
||||
int WR(void *data, int size); //write or read depending on open mode
|
||||
bool MagicCookie(int cookie);
|
||||
|
||||
int GetSize();
|
||||
eFileMode GetMode() {return mode;}
|
||||
void SeekBeg(int pos)
|
||||
{
|
||||
if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_BEGIN);
|
||||
}
|
||||
void SeekEnd(int pos)
|
||||
{
|
||||
if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_END);
|
||||
}
|
||||
void SeekCurrent(int pos)
|
||||
{
|
||||
if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_CURRENT);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif //__LAMEFILE_H__
|
Reference in New Issue
Block a user