]> git.donarmstrong.com Git - lilypond.git/blob - lib/include/source-file.hh
partial: 1.0.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 #include "proto.hh"
10 #include "string.hh"
11 #include "interval.hh"
12
13 class istream;
14
15
16 /// class for reading and mapping a file. 
17 class Source_file
18 {
19 public:
20   /** Ugh! filename gets changed! The path to the opened file may
21     change, since it might be searched in multiple directories.  */
22   Source_file (String filename_str_r );
23   virtual ~Source_file ();
24
25   char const* ch_C () const;
26   virtual String error_str (char const* pos_ch_c_l ) const;
27   istream * istream_l ();
28   bool in_b (char const* pos_ch_c_l ) const;
29   int length_i () const;
30   virtual int line_i (char const* pos_ch_c_l ) const;
31   String name_str () const;
32   String file_line_column_str (char const* ch_c_l ) const;
33
34 protected:
35   Slice line_slice (char const* pos_ch_C) const;
36   String line_str (char const* pos_ch_C) const;
37   int column_i (char const* pos_ch_C) const;
38   int char_i (char const* pos_ch_C) const;
39
40 private:
41   String name_str_;
42   istream* istream_p_;
43   File_storage * storage_p_;
44 };
45
46 #endif // SOURCE_FILE_HH //
47