2 source.cc -- implement Sources
4 source file of the LilyPond music typesetter
6 (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
11 #include "killing-cons.tcc"
12 #include "source-file.hh"
13 #include "file-path.hh"
23 Sources::set_binary (bool bo)
29 Sources::set_path (File_path *f)
37 @param file_string the file to be opened, name might be changed if it
38 is found in a search path. UGH!
40 @return 0 if no file found
43 Sources::get_file (String &file_string) //UGH
45 if ((file_string != "-") && path_)
47 String file_string_o = path_->find (file_string);
48 if ((file_string_o == "") && (file_string != ""))
50 file_string = file_string_o;
52 Source_file * f = new Source_file (file_string) ;
58 Sources::add (Source_file* sourcefile)
60 sourcefile_list_ = new Killing_cons<Source_file> (sourcefile, sourcefile_list_);
65 delete sourcefile_list_;
68 search the list for file whose map contains pointer #str0#
70 @return 0 if not found.
73 Sources::get_sourcefile (char const* str0)
76 for (Cons<Source_file> *i = sourcefile_list_; i; i = i->next_)
77 if (i->car_->contains (str0))