doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DemoFile.h
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 #ifndef __DEMOFILE_H__
30 #define __DEMOFILE_H__
31 
32 /*
33 ===============================================================================
34 
35  Demo file
36 
37 ===============================================================================
38 */
39 
40 typedef enum {
45 } demoSystem_t;
46 
47 class idDemoFile : public idFile {
48 public:
49  idDemoFile();
50  ~idDemoFile();
51 
52  const char * GetName( void ) { return (f?f->GetName():""); }
53  const char * GetFullPath( void ) { return (f?f->GetFullPath():""); }
54 
55  void SetLog( bool b, const char *p );
56  void Log( const char *p );
57  bool OpenForReading( const char *fileName );
58  bool OpenForWriting( const char *fileName );
59  void Close();
60 
61  const char * ReadHashString();
62  void WriteHashString( const char *str );
63 
64  void ReadDict( idDict &dict );
65  void WriteDict( const idDict &dict );
66 
67  int Read( void *buffer, int len );
68  int Write( const void *buffer, int len );
69 
70 private:
71  static idCompressor *AllocCompressor( int type );
72 
73  bool writing;
75  idFile * f;
77 
80  bool log;
82 
86 };
87 
88 #endif /* !__DEMOFILE_H__ */
static idCVar com_compressDemos
Definition: DemoFile.h:84
bool OpenForWriting(const char *fileName)
Definition: DemoFile.cpp:153
idFile * fLog
Definition: DemoFile.h:79
GLuint GLuint GLsizei GLenum type
Definition: glext.h:2845
GLenum GLsizei len
Definition: glext.h:3472
demoSystem_t
Definition: DemoFile.h:40
virtual const char * GetName(void)
Definition: File.cpp:161
static idCVar com_preloadDemos
Definition: DemoFile.h:85
Definition: File.h:50
static idCVar com_logDemos
Definition: DemoFile.h:83
idFile * f
Definition: DemoFile.h:75
Definition: Dict.h:65
GLuint buffer
Definition: glext.h:3108
void Log(const char *p)
Definition: DemoFile.cpp:142
const char * GetFullPath(void)
Definition: DemoFile.h:53
bool writing
Definition: DemoFile.h:73
GLubyte GLubyte b
Definition: glext.h:4662
const char * GetName(void)
Definition: DemoFile.h:52
int Write(const void *buffer, int len)
Definition: DemoFile.cpp:322
bool OpenForReading(const char *fileName)
Definition: DemoFile.cpp:81
unsigned char byte
Definition: Lib.h:75
void WriteDict(const idDict &dict)
Definition: DemoFile.cpp:293
void SetLog(bool b, const char *p)
Definition: DemoFile.cpp:130
Definition: Str.h:116
idList< idStr * > demoStrings
Definition: DemoFile.h:78
idCompressor * compressor
Definition: DemoFile.h:76
void Close()
Definition: DemoFile.cpp:182
const char * ReadHashString()
Definition: DemoFile.cpp:212
GLfloat GLfloat p
Definition: glext.h:4674
int Read(void *buffer, int len)
Definition: DemoFile.cpp:309
virtual const char * GetFullPath(void)
Definition: File.cpp:170
idStr logStr
Definition: DemoFile.h:81
bool log
Definition: DemoFile.h:80
void ReadDict(idDict &dict)
Definition: DemoFile.cpp:275
byte * fileImage
Definition: DemoFile.h:74
void WriteHashString(const char *str)
Definition: DemoFile.cpp:248
static idCompressor * AllocCompressor(int type)
Definition: DemoFile.cpp:66