7 #include "flower-proto.hh"
10 #include "protected-scm.hh"
14 class for reading and mapping a file.
16 duplicates a lot of Data_file and Text_stream.
17 should look at including Data_file's functionality:
18 get_line (), get_word () here.
24 Source_file (String fn);
25 Source_file (String, String );
27 virtual ~Source_file ();
29 char const* to_str0 () const;
30 virtual String error_string (char const* pos_str0 ) const;
31 std::istream * get_istream ();
32 bool in_b (char const* pos_str0 ) const;
34 virtual int get_line (char const* pos_str0 ) const;
35 String name_string () const;
36 String file_line_column_string (char const* str0 ) const;
39 char const* seek_str0 (int n);
42 // return here + n bytes
43 char const* forward_str0 (int n);
44 char const* pos_str0 () { return pos_str0_; }
45 String get_string (int n);
46 void set_pos (char const * pos_str0);
48 Slice line_slice (char const* pos_str0) const;
49 String line_string (char const* pos_str0) const;
50 int get_column (char const* pos_str0) const;
51 int get_char (char const* pos_str0) const;
56 This thing doubles as a file-storage/file-iterator object.
58 char const* pos_str0_;
60 SCM get_port()const { return str_port_; }
64 Link_array<char> newline_locations_;
65 std::istream* istream_;
66 char * contents_str0_;
71 Protected_scm str_port_;
75 char * gulp_file (String fn, int *len);
77 #endif // SOURCE_FILE_HH //