]> git.donarmstrong.com Git - lilypond.git/blob - lib/include/source-file.hh
release: 0.0.44
[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 #include "fproto.hh"
9 #include "string.hh"
10 class istream;
11 /// class for reading and mapping a file. 
12 class Source_file
13 {
14 public:
15     /** Ugh! filename gets changed! The path to the opened file may
16        change, since it might be searched in multiple directories.  */
17     Source_file( String filename_str_r );
18     virtual ~Source_file();
19
20     char const* ch_C();
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 );
28
29 private:
30     void close();
31     void map();
32     void open();
33     void unmap();
34
35     istream* istream_p_;
36     int fildes_i_;
37     String name_str_;
38     off_t size_off_;
39     caddr_t data_caddr_;
40 };
41
42 #endif // SOURCE_FILE_HH //