WWFILE.H 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. ** Command & Conquer(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /* $Header: F:\projects\c&c\vcs\code\wwfile.h_v 2.15 16 Oct 1995 16:46:06 JOE_BOSTIC $ */
  19. /***********************************************************************************************
  20. *** 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 ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Westwood Library *
  24. * *
  25. * File Name : WWFILE.H *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : August 8, 1994 *
  30. * *
  31. * Last Update : August 8, 1994 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef WWFILE_H
  37. #define WWFILE_H
  38. //#include <stdio.h>
  39. #ifndef READ
  40. #define READ _READ
  41. #endif
  42. #ifndef WRITE
  43. #define WRITE _WRITE
  44. #endif
  45. class FileClass
  46. {
  47. public:
  48. virtual ~FileClass(void) {};
  49. virtual char const * File_Name(void) const = 0;
  50. virtual char const * Set_Name(char const *filename) = 0;
  51. virtual int Create(void) = 0;
  52. virtual int Delete(void) = 0;
  53. virtual int Is_Available(int forced=false) = 0;
  54. virtual int Is_Open(void) const = 0;
  55. virtual int Open(char const *filename, int rights=READ) = 0;
  56. virtual int Open(int rights=READ) = 0;
  57. virtual long Read(void *buffer, long size) = 0;
  58. virtual long Seek(long pos, int dir=SEEK_CUR) = 0;
  59. virtual long Size(void) = 0;
  60. virtual long Write(void const *buffer, long size) = 0;
  61. virtual void Close(void) = 0;
  62. operator char const * () {return File_Name();};
  63. };
  64. #endif