source: golgotha/src/i4/test/sound_test/drive_map.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 15 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.9 KB
RevLine 
[80]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 DRIVE_MAP_HH
10#define DRIVE_MAP_HH
11
12#include "file/file.hh"
13#include "string/string.hh"
14
15class i4_drive_map : public i4_file_manager_class
16
17protected:
18  i4_str *drive_path;
19
20public:
21
22  i4_drive_map(const i4_const_str &path)
23  //{{{
24  {
25    drive_path=new i4_str(path,path.length()+1);
26  }
27  //}}}
28
29
30  virtual i4_file_class *default_open(const i4_const_str &name, w32 flags)
31  //{{{
32  {
33    i4_str *cat=new i4_str(*drive_path,drive_path->length()+name.length()+1);
34    cat->insert(cat->end(),name);
35    i4_file_class *fp=i4_file_manager_class::default_open(*cat,flags);
36    delete cat;
37    return fp;
38  }
39  //}}}
40
41
42  virtual i4_bool get_status(const i4_const_str &filename,
43                             i4_file_status_struct &return_stat)
44  //{{{
45  {
46    i4_str *cat=new i4_str(*drive_path,drive_path->length()+filename.length()+1);
47    cat->insert(cat->end(),filename);
48    i4_bool ret=i4_file_manager_class::get_status(*cat,return_stat);
49    delete cat;
50    return ret;
51  }
52  //}}}
53
54
55  virtual i4_bool mkdir(const i4_const_str &name)
56  //{{{
57  {
58    i4_str *cat=new i4_str(*drive_path,drive_path->length()+name.length()+1);
59    cat->insert(cat->end(),name);
60    i4_bool ret=i4_file_manager_class::mkdir(*cat);
61    delete cat;
62    return ret;
63  }
64  //}}}
65};
66
67#endif
68
69//{{{ Emacs Locals
70// Local Variables:
71// folded-file: t
72// End:
73//}}}
Note: See TracBrowser for help on using the repository browser.