2 source.cc -- implement Sources
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
12 #include "binary-source-file.hh"
16 #include "source-file.hh"
27 Sources::set_binary (bool bo)
33 Sources::set_path (File_path *f_C)
41 @param file_str the file to be opened, name might be changed if it
42 is found in a search path. UGH!
44 @return 0 if no file found
47 Sources::get_file_l (String &file_str) //UGH
51 String file_str_o = path_C_->find (file_str);
52 if ((file_str_o == "") && (file_str != ""))
54 file_str = file_str_o;
56 Source_file * f_p= (!binary_b_) ?
57 new Source_file (file_str) : new Binary_source_file (file_str);
63 Sources::add (Source_file* sourcefile_p)
65 sourcefile_p_list_.bottom ().add (sourcefile_p);
69 search the list for file whose map contains pointer #ch_C#
71 @return 0 if not found.
74 Sources::sourcefile_l (char const* ch_C)
76 PCursor<Source_file*> sourcefile_l_pcur (sourcefile_p_list_.top ());
77 for (; sourcefile_l_pcur.ok (); sourcefile_l_pcur++)
78 if (sourcefile_l_pcur->in_b (ch_C))
79 return *sourcefile_l_pcur;