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"
21 Sources::set_path(File_path *f_C)
29 @param file_str the file to be opened, name might be changed if it
30 is found in a search path. UGH!
32 @return 0 if no file found
35 Sources::get_file_l(String &file_str ) //UGH
38 String file_str_o = path_C_->find(file_str);
39 if ( ( file_str_o == "" ) && ( file_str != "" ) )
41 file_str = file_str_o;
43 Source_file * f_p= (!binary_b_) ?
44 new Source_file(file_str) : new Binary_source_file(file_str);
56 Sources::add( Source_file* sourcefile_p )
58 sourcefile_p_list_.bottom().add( sourcefile_p );
62 search the list for file whose map contains pointer #ch_C#
64 @return 0 if not found.
67 Sources::sourcefile_l( char const* ch_C )
69 PCursor<Source_file*> sourcefile_l_pcur( sourcefile_p_list_.top() );
70 for ( ; sourcefile_l_pcur.ok(); sourcefile_l_pcur++ )
71 if ( sourcefile_l_pcur->in_b( ch_C ) )
72 return *sourcefile_l_pcur;