source: golgotha/src/i4/file/sub_section.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 12 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.3 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef I4_SUB_SECTION
10#define I4_SUB_SECTION
11
12#include "file/file.hh"
13
14/*
15The sub section file maps part of another file, it uses dup() on the other
16file so seeks and closes won't cause problems.  The subsection file's offset 0,
17begins somewhere inside the other file and reads are only allowed in this area.
18
19
20 */
21
22class i4_sub_section_file : public i4_file_class
23{
24  i4_file_class *fp;
25  int fstart, fsize, foffset;
26public:
27  virtual w32 read (void *buffer, w32 size);
28  virtual w32 write(const void *buffer, w32 size);
29  virtual w32 seek (w32 offset);
30  virtual w32 size ();
31  virtual w32 tell ();
32
33  virtual i4_bool async_read (void *buffer, w32 size,
34                              async_callback call,
35                              void *context=0);
36
37  i4_sub_section_file(i4_file_class *fp, int start, int size);
38  ~i4_sub_section_file();
39};
40
41
42#endif
Note: See TracBrowser for help on using the repository browser.