From d71eec8062e852e56f03102ba4b4e87dc485821d Mon Sep 17 00:00:00 2001 From: docwhat Date: Sun, 14 Nov 1999 06:43:18 +0000 Subject: Initial revision git-svn-id: http://svn.leocad.org/trunk@2 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- common/file.h | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 common/file.h (limited to 'common/file.h') diff --git a/common/file.h b/common/file.h new file mode 100644 index 0000000..8608092 --- /dev/null +++ b/common/file.h @@ -0,0 +1,63 @@ +// +// file.h +//////////////////////////////////////////////////// + +#ifndef _FILE_H_ +#define _FILE_H_ + +#include + +class File +{ +public: +// Constructors + File(bool bMemFile); + ~File(); + +// Implementation +protected: + bool m_bMemFile; + + // MemFile specific: + unsigned long m_nGrowBytes; + unsigned long m_nPosition; + unsigned long m_nBufferSize; + unsigned long m_nFileSize; + unsigned char* m_pBuffer; + bool m_bAutoDelete; + void GrowFile(unsigned long nNewLen); + + // DiscFile specific: + FILE* m_hFile; + bool m_bCloseOnDelete; + +public: + unsigned long GetPosition() const; + unsigned long Seek(long lOff, int nFrom); + void SetLength(unsigned long nNewLen); + unsigned long GetLength() const; + + char* ReadString(char* pBuf, unsigned long nMax); + unsigned long Read(void* pBuf, unsigned long nCount); + unsigned long Write(const void* pBuf, unsigned long nCount); + int GetChar(); + int PutChar(int c); + + void Abort(); + void Flush(); + void Close(); + bool Open(const char *filename, const char *mode); + +public: +// Attributes +// CString GetFileName() const; +// CString GetFileTitle() const; +// CString GetFilePath() const; +// void SetFilePath(LPCTSTR lpszNewName); + +protected: +// CString m_strFileName; +}; + + +#endif // _FILE_H_ -- cgit v1.2.3