2 source.cc -- implement Source
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"
20 Sources::set_path(File_path *f_C)
28 @param file_str the file to be opened, name might be changed if it
29 is found in a search path.
31 @return 0 if no file found
34 Sources::get_file_l(String &file_str )
37 file_str = path_C_->find(file_str);
41 Source_file * f_p= (!binary_b_) ?
42 new Source_file(file_str) : new Binary_source_file(file_str);
54 Sources::add( Source_file* sourcefile_p )
56 sourcefile_p_iplist_.bottom().add( sourcefile_p );
60 search the list for file whose map contains pointer #ch_C#
62 @return 0 if not found.
65 Sources::sourcefile_l( char const* ch_C )
67 PCursor<Source_file*> sourcefile_l_pcur( sourcefile_p_iplist_.top() );
68 for ( ; sourcefile_l_pcur.ok(); sourcefile_l_pcur++ )
69 if ( sourcefile_l_pcur->in_b( ch_C ) )
70 return *sourcefile_l_pcur;