lilypond-0.0.40
[lilypond.git] / hdr / source-file.hh
blob7f7168eb7ec1f4ca1268227846a4c84b74b15325
1 //
2 // source-file.hh -- declare Source_file
3 //
4 // copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
6 #ifndef SOURCE_FILE_HH
7 #define SOURCE_FILE_HH
9 /// class for reading and mapping a file.
10 class Source_file
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();
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 );
27 private:
28 void close();
29 void map();
30 void open();
31 void unmap();
33 istream* istream_p_;
34 int fildes_i_;
35 String name_str_;
36 off_t size_off_;
37 caddr_t data_caddr_;
40 #endif // SOURCE_FILE_HH //