KFile.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:1k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //---------------------------------------------------------------------------
  2. // Sword3 Engine (c) 1999-2000 by Kingsoft
  3. //
  4. // File: KFile.h
  5. // Date: 2000.08.08
  6. // Code: WangWei(Daphnis)
  7. // Desc: Header File
  8. //---------------------------------------------------------------------------
  9. #ifndef KFile_H
  10. #define KFile_H
  11. //---------------------------------------------------------------------------
  12. #define SEEK_ERROR 0xFFFFFFFF
  13. //---------------------------------------------------------------------------
  14. #ifndef __linux
  15. class ENGINE_API KFile
  16. #else
  17. class KFile
  18. #endif
  19. {
  20. private:
  21. //#ifndef __linux
  22. // HANDLE m_hFile; // File Handle
  23. //#else
  24. FILE * m_hFile; // File Handle
  25. //#endif
  26. DWORD m_dwLen; // File Size
  27. DWORD m_dwPos; // File Pointer
  28. public:
  29. KFile();
  30. ~KFile();
  31. BOOL Open(LPSTR FileName);
  32. BOOL Create(LPSTR FileName);
  33. BOOL Append(LPSTR FileName);
  34. void Close();
  35. DWORD Read(LPVOID lpBuffer, DWORD dwReadBytes);
  36. DWORD Write(LPVOID lpBuffer, DWORD dwWriteBytes);
  37. DWORD Seek(LONG lDistance, DWORD dwMoveMethod);
  38. DWORD Tell();
  39. DWORD Size();
  40. };
  41. //---------------------------------------------------------------------------
  42. #endif