CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

WWFILE.H (4211B)


      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 
      9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 
     10 // in the hope that it will be useful, but with permitted additional restrictions 
     11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 
     12 // distributed with this program. You should have received a copy of the 
     13 // GNU General Public License along with permitted additional restrictions 
     14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
     15 
     16 /* $Header: /CounterStrike/WWFILE.H 1     3/03/97 10:26a Joe_bostic $ */
     17 /***********************************************************************************************
     18  ***              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               ***
     19  ***********************************************************************************************
     20  *                                                                                             *
     21  *                 Project Name : Westwood Library                                             *
     22  *                                                                                             *
     23  *                    File Name : WWFILE.H                                                     *
     24  *                                                                                             *
     25  *                   Programmer : Joe L. Bostic                                                *
     26  *                                                                                             *
     27  *                   Start Date : August 8, 1994                                               *
     28  *                                                                                             *
     29  *                  Last Update : August 8, 1994   [JLB]                                       *
     30  *                                                                                             *
     31  *---------------------------------------------------------------------------------------------*
     32  * Functions:                                                                                  *
     33  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     34 
     35 #ifndef WWFILE_Hx
     36 #define WWFILE_Hx
     37 
     38 #define YEAR(dt)	(((dt & 0xFE000000) >> (9 + 16)) + 1980)
     39 #define MONTH(dt)	 ((dt & 0x01E00000) >> (5 + 16))
     40 #define DAY(dt)	 ((dt & 0x001F0000) >> (0 + 16))
     41 #define HOUR(dt)	 ((dt & 0x0000F800) >> 11)
     42 #define MINUTE(dt) ((dt & 0x000007E0) >> 5)
     43 #define SECOND(dt) ((dt & 0x0000001F) << 1)
     44 
     45 #include	<io.h>
     46 #include	<stddef.h>
     47 
     48 #ifndef READ
     49 #define READ 1
     50 #endif
     51 #ifndef WRITE
     52 #define WRITE 2
     53 #endif
     54 
     55 /*
     56 **	The "bool" integral type was defined by the C++ committee in
     57 **	November of '94. Until the compiler supports this, use the following
     58 **	definition.
     59 */
     60 #ifndef __BORLANDC__
     61 #ifndef TRUE_FALSE_DEFINED
     62 #define TRUE_FALSE_DEFINED
     63 enum {false=0,true=1};
     64 typedef int bool;
     65 #endif
     66 #endif
     67 
     68 
     69 class FileClass
     70 {
     71 	public:
     72 		virtual ~FileClass(void) {};
     73 		virtual char const * File_Name(void) const = 0;
     74 		virtual char const * Set_Name(char const *filename) = 0;
     75 		virtual int Create(void) = 0;
     76 		virtual int Delete(void) = 0;
     77 		virtual int Is_Available(int forced=false) = 0;
     78 		virtual int Is_Open(void) const = 0;
     79 		virtual int Open(char const *filename, int rights=READ) = 0;
     80 		virtual int Open(int rights=READ) = 0;
     81 		virtual long Read(void *buffer, long size) = 0;
     82 		virtual long Seek(long pos, int dir=SEEK_CUR) = 0;
     83 		virtual long Size(void) = 0;
     84 		virtual long Write(void const *buffer, long size) = 0;
     85 		virtual void Close(void) = 0;
     86 		virtual unsigned long Get_Date_Time(void) {return(0);}
     87 		virtual bool Set_Date_Time(unsigned long ) {return(false);}
     88 		virtual void Error(int error, int canretry = false, char const * filename=NULL) = 0;
     89 
     90 		operator char const * () {return File_Name();};
     91 };
     92 
     93 #endif