]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/mapped-file-storage.hh
release: 1.3.24
[lilypond.git] / flower / include / mapped-file-storage.hh
1 /*   
2   mapped-file-storage.hh -- declare Mapped_file_storage
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #ifndef MAPPED_FILE_STORAGE_HH
11 #define MAPPED_FILE_STORAGE_HH
12
13
14
15 #include "file-storage.hh"
16
17 /**
18   Use mmap to "copy"  a file into memory
19  */
20 class Mapped_file_storage:public File_storage
21 {
22 public:
23   Mapped_file_storage (String);    
24 protected:
25   virtual char const* ch_C () const;
26   virtual int length_i () const;
27   virtual ~Mapped_file_storage ();
28 private:
29   void open (String name);
30   void close ();
31
32   void map ();
33   void unmap ();
34   int fildes_i_;
35   off_t size_off_;
36   caddr_t data_caddr_;
37 };
38
39 #endif /* MAPPED_FILE_STORAGE_HH */
40