2 file-storage.hh -- declare File_storage, Mapped_file_storage, Simple_file_storage
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
10 #ifndef FILE_STORAGE_HH
11 #define FILE_STORAGE_HH
16 store a file in-memory.
21 virtual char const* ch_C() const=0;
22 virtual int length_i() const=0;
23 virtual ~File_storage(){}
27 Use mmap to "copy" a file into memory
29 class Mapped_file_storage:public File_storage
32 Mapped_file_storage(String);
34 virtual char const* ch_C() const;
35 virtual int length_i() const;
36 virtual ~Mapped_file_storage();
38 void open(String name);
49 read file char by char and copy into a malloc array.
51 class Simple_file_storage : public File_storage
56 virtual char const*ch_C() const;
57 virtual int length_i() const;
58 virtual ~Simple_file_storage();
60 Simple_file_storage(String);
62 #endif // FILE_STORAGE_HH