]> git.donarmstrong.com Git - lilypond.git/blobdiff - lib/include/source-file.hh
release: 0.1.63
[lilypond.git] / lib / include / source-file.hh
index 6fdcc5d88a56dd6c2e7200df10d2fcaf2fe68b79..ccf80eededcf2c5907e639e033e427c52bebfa92 100644 (file)
@@ -5,38 +5,43 @@
 
 #ifndef SOURCE_FILE_HH
 #define SOURCE_FILE_HH
-#include "fproto.hh"
+
+#include "proto.hh"
 #include "string.hh"
+#include "interval.hh"
+
 class istream;
+
+
 /// class for reading and mapping a file. 
 class Source_file
 {
 public:
-    /** Ugh! filename gets changed! The path to the opened file may
-       change, since it might be searched in multiple directories.  */
-    Source_file( String filename_str_r );
-    virtual ~Source_file();
-
-    char const* ch_C();
-    virtual String error_str( char const* pos_ch_c_l );
-    istream * istream_l();
-    bool in_b( char const* pos_ch_c_l );
-    off_t length_off();
-    virtual int line_i( char const* pos_ch_c_l );
-    String name_str();
-    String file_line_no_str( char const* ch_c_l );
+  /** Ugh! filename gets changed! The path to the opened file may
+    change, since it might be searched in multiple directories.  */
+  Source_file (String filename_str_r );
+  virtual ~Source_file ();
+
+  char const* ch_C () const;
+  virtual String error_str (char const* pos_ch_c_l ) const;
+  istream * istream_l ();
+  bool in_b (char const* pos_ch_c_l ) const;
+  int length_i () const;
+  virtual int line_i (char const* pos_ch_c_l ) const;
+  String name_str () const;
+  String file_line_column_str (char const* ch_c_l ) const;
+
+protected:
+  Slice line_slice (char const* pos_ch_C) const;
+  String line_str (char const* pos_ch_C) const;
+  int column_i (char const* pos_ch_C) const;
+  int position_i (char const* pos_ch_C) const;
 
 private:
-    void close();
-    void map();
-    void open();
-    void unmap();
-
-    istream* istream_p_;
-    int fildes_i_;
-    String name_str_;
-    off_t size_off_;
-    caddr_t data_caddr_;
+  String name_str_;
+  istream* istream_p_;
+  File_storage * storage_p_;
 };
 
 #endif // SOURCE_FILE_HH //
+