2 source-file.hh -- declare Source_file
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2006 Jan Nieuwenhuizen <janneke@gnu.org>
10 #define SOURCE_FILE_HH
12 #include "flower-proto.hh"
13 #include "std-vector.hh"
14 #include "lily-proto.hh"
21 class for reading and mapping a file.
23 duplicates a lot of Data_file and Text_stream.
24 should look at including Data_file's functionality:
25 get_line (), get_word () here.
30 vector<char*> newline_locations_;
32 vector<char> characters_;
35 char const *contents_str0 () const;
40 DECLARE_SMOBS(Source_file, bla);
42 Source_file (string fn);
43 Source_file (string, string);
45 char const *c_str () const;
46 virtual string quote_input (char const *pos_str0) const;
47 istream *get_istream ();
48 bool contains (char const *pos_str0) const;
50 virtual int get_line (char const *pos_str0) const;
51 void set_line (char const *pos_str0, int i);
52 string name_string () const;
53 string file_line_column_string (char const *str0) const;
56 Slice line_slice (char const *pos_str0) const;
57 string line_string (char const *pos_str0) const;
58 void get_counts (char const *pos_str0, int *, int *, int *) const;
60 SCM get_port () const;
67 vector<char> gulp_file (string fn, int desired);
69 #endif /* SOURCE_FILE_HH */