lilypond-0.0.39
[lilypond.git] / hdr / sourcefile.hh
blob251efd517e91ea126f611df5cc5176f5d1743ccb
1 //
2 // sourcefile.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 /**
14 @return path to opened file.
16 // jcn: ugh! filename gets changed!, why?
17 Source_file( String& filename_str );
18 virtual ~Source_file();
20 char const* ch_c_l();
21 virtual String error_str( char const* pos_ch_c_l );
22 istream* istream_l();
23 bool in_b( char const* pos_ch_c_l );
24 off_t length_off();
25 virtual int line_i( char const* pos_ch_c_l );
26 String name_str();
27 String file_line_no_str( char const* ch_c_l );
29 private:
30 void close();
31 void map();
32 void open();
33 void unmap();
35 istream* istream_p_;
36 int fildes_i_;
37 String name_str_;
38 off_t size_off_;
39 caddr_t data_caddr_;
42 #endif // SOURCE_FILE_HH //