WWFILE.H 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // Copyright 2020 Electronic Arts Inc.
  3. //
  4. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free
  5. // software: you can redistribute it and/or modify it under the terms of
  6. // the GNU General Public License as published by the Free Software Foundation,
  7. // either version 3 of the License, or (at your option) any later version.
  8. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
  9. // in the hope that it will be useful, but with permitted additional restrictions
  10. // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
  11. // distributed with this program. You should have received a copy of the
  12. // GNU General Public License along with permitted additional restrictions
  13. // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
  14. /* $Header: F:\projects\c&c\vcs\code\wwfile.h_v 2.14 06 Sep 1995 16:30:00 JOE_BOSTIC $ */
  15. /***********************************************************************************************
  16. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  17. ***********************************************************************************************
  18. * *
  19. * Project Name : Westwood Library *
  20. * *
  21. * File Name : WWFILE.H *
  22. * *
  23. * Programmer : Joe L. Bostic *
  24. * *
  25. * Start Date : August 8, 1994 *
  26. * *
  27. * Last Update : August 8, 1994 [JLB] *
  28. * *
  29. *---------------------------------------------------------------------------------------------*
  30. * Functions: *
  31. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  32. #ifndef WWFILE_H
  33. #define WWFILE_H
  34. #include <stdio.h>
  35. #ifndef READ
  36. #define READ _READ
  37. #endif
  38. #ifndef WRITE
  39. #define WRITE _WRITE
  40. #endif
  41. class FileClass
  42. {
  43. public:
  44. virtual ~FileClass(void) {};
  45. virtual char const * File_Name(void) const = 0;
  46. virtual char const * Set_Name(char const *filename) = 0;
  47. virtual int Create(void) = 0;
  48. virtual int Delete(void) = 0;
  49. virtual int Is_Available(int forced=false) = 0;
  50. virtual int Is_Open(void) const = 0;
  51. virtual int Open(char const *filename, int rights=READ) = 0;
  52. virtual int Open(int rights=READ) = 0;
  53. virtual long Read(void *buffer, long size) = 0;
  54. virtual long Seek(long pos, int dir=SEEK_CUR) = 0;
  55. virtual long Size(void) = 0;
  56. virtual long Write(void const *buffer, long size) = 0;
  57. virtual void Close(void) = 0;
  58. operator char const * () {return File_Name();};
  59. };
  60. #endif