]> git.donarmstrong.com Git - lilypond.git/blob - lib/include/source-file.hh
partial: 0.0.39-1.jcn
[lilypond.git] / lib / include / source-file.hh
1 //
2 //  source-file.hh -- declare Source_file
3 //
4 //  copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
5
6 #ifndef SOURCE_FILE_HH
7 #define SOURCE_FILE_HH
8
9 /// class for reading and mapping a file. 
10 class Source_file
11 {
12 public:
13     /** Ugh! filename gets changed! The path to the opened file may
14        change, since it might be searched in multiple directories.  */
15     Source_file( String& filename_str_r );
16     virtual ~Source_file();
17
18     char const* ch_c_l();
19     virtual String error_str( char const* pos_ch_c_l );
20     istream* istream_l();
21     bool in_b( char const* pos_ch_c_l );
22     off_t length_off();
23     virtual int line_i( char const* pos_ch_c_l );
24     String name_str();
25     String file_line_no_str( char const* ch_c_l );
26
27 private:
28     void close();
29     void map();
30     void open();
31     void unmap();
32
33     istream* istream_p_;
34     int fildes_i_;
35     String name_str_;
36     off_t size_off_;
37     caddr_t data_caddr_;
38 };
39
40 #endif // SOURCE_FILE_HH //