summaryrefslogtreecommitdiff
path: root/common/file.h
diff options
context:
space:
mode:
authordocwhat1999-11-14 06:43:18 +0000
committerdocwhat1999-11-14 06:43:18 +0000
commitd71eec8062e852e56f03102ba4b4e87dc485821d (patch)
tree452368ad0e7e24627e517a0c88c2508d02cea6dc /common/file.h
parent2046090b7ce8dd901ce43e650be5acf44016d714 (diff)
Initial revision
git-svn-id: http://svn.leocad.org/trunk@2 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common/file.h')
-rw-r--r--common/file.h63
1 files changed, 63 insertions, 0 deletions
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 <stdio.h>
+
+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_