From: Han-Wen Nienhuys Date: Thu, 18 Jan 2007 14:55:15 +0000 (+0100) Subject: rename source.{hh,cc} -> sources.{hh,cc} X-Git-Tag: release/2.11.13-1~18 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9b507a508f88cc53dbadd76e6bf735eb48bda186;p=lilypond.git rename source.{hh,cc} -> sources.{hh,cc} --- diff --git a/lily/includable-lexer.cc b/lily/includable-lexer.cc index ee971d7cad..617b1ace32 100644 --- a/lily/includable-lexer.cc +++ b/lily/includable-lexer.cc @@ -17,7 +17,7 @@ using namespace std; #include "international.hh" #include "main.hh" #include "source-file.hh" -#include "source.hh" +#include "sources.hh" #include "warn.hh" #ifndef YY_BUF_SIZE diff --git a/lily/include/source.hh b/lily/include/source.hh index 9cc52192c6..09c7cfafd0 100644 --- a/lily/include/source.hh +++ b/lily/include/source.hh @@ -1,31 +1 @@ -/* - source.hh -- part of LilyPond - - (c) 1997--2007 Jan Nieuwenhuizen -*/ - -#ifndef SOURCE_HH -#define SOURCE_HH - -#include "flower-proto.hh" -#include "std-vector.hh" - -/* A set of sourcefiles. */ -class Sources -{ - Sources (Sources const &); - vector sourcefiles_; - -public: - Sources (); - ~Sources (); - - Source_file *get_file (string *file_name); - Source_file *get_sourcefile (char const *); - void add (Source_file *sourcefile); - void set_path (File_path *); - - const File_path *path_; -}; - -#endif /* SOURCE_HH */ +#error diff --git a/lily/include/sources.hh b/lily/include/sources.hh new file mode 100644 index 0000000000..13776f31be --- /dev/null +++ b/lily/include/sources.hh @@ -0,0 +1,30 @@ +/* + sources.hh -- part of LilyPond + + (c) 1997--2007 Jan Nieuwenhuizen +*/ + +#ifndef SOURCES_HH +#define SOURCES_HH + +#include "flower-proto.hh" +#include "std-vector.hh" + +class Sources +{ + Sources (Sources const &); + vector sourcefiles_; + +public: + Sources (); + ~Sources (); + + Source_file *get_file (string *file_name); + Source_file *get_sourcefile (char const *); + void add (Source_file *sourcefile); + void set_path (File_path *); + + const File_path *path_; +}; + +#endif /* SOURCE_HH */ diff --git a/lily/input.cc b/lily/input.cc index 3d998b384e..09028d0858 100644 --- a/lily/input.cc +++ b/lily/input.cc @@ -13,7 +13,7 @@ using namespace std; #include "international.hh" #include "source-file.hh" -#include "source.hh" +#include "sources.hh" #include "warn.hh" Input::Input (Input const &i) diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index c3ac4afa3c..ca1d224bd6 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -18,7 +18,7 @@ #include "ly-module.hh" #include "main.hh" #include "program-option.hh" -#include "source.hh" +#include "sources.hh" #include "warn.hh" /* Do not append `!' suffix, since 1st argument is not modified. */ diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 356615adc3..456acd1a9e 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -20,7 +20,7 @@ #include "paper-book.hh" #include "parser.hh" #include "score.hh" -#include "source.hh" +#include "sources.hh" #include "text-metrics.hh" #include "warn.hh" diff --git a/lily/source.cc b/lily/source.cc index 068baed379..e69de29bb2 100644 --- a/lily/source.cc +++ b/lily/source.cc @@ -1,66 +0,0 @@ -/* - source.cc -- implement Sources - - source file of the LilyPond music typesetter - - (c) 1997--2007 Han-Wen Nienhuys -*/ - -#include "source.hh" - -#include "source-file.hh" -#include "file-path.hh" - -Sources::Sources () -{ - path_ = 0; -} - - -Sources::Sources (Sources const &) -{ - assert (false); -} - - -void -Sources::set_path (File_path *f) -{ - path_ = f; -} - -/** - open a file - - File_string the file to be opened, name might be changed if it is - found in a search path. -*/ -Source_file * -Sources::get_file (string *file_string) //UGH -{ - if (*file_string != "-" && path_) - { - string file_string_o = path_->find (*file_string); - if ((file_string_o == "") && (*file_string != "")) - return 0; - *file_string = file_string_o; - } - Source_file *f = new Source_file (*file_string); - add (f); - return f; -} - -void -Sources::add (Source_file *sourcefile) -{ - sourcefiles_.push_back (sourcefile); -} - -Sources::~Sources () -{ - for (vsize i = 0; i < sourcefiles_.size (); i++) - { - sourcefiles_[i]->unprotect (); - } -} - diff --git a/lily/sources.cc b/lily/sources.cc new file mode 100644 index 0000000000..bfd3e0d295 --- /dev/null +++ b/lily/sources.cc @@ -0,0 +1,66 @@ +/* + source.cc -- implement Sources + + source file of the LilyPond music typesetter + + (c) 1997--2007 Han-Wen Nienhuys +*/ + +#include "sources.hh" + +#include "source-file.hh" +#include "file-path.hh" + +Sources::Sources () +{ + path_ = 0; +} + + +Sources::Sources (Sources const &) +{ + assert (false); +} + + +void +Sources::set_path (File_path *f) +{ + path_ = f; +} + +/** + open a file + + File_string the file to be opened, name might be changed if it is + found in a search path. +*/ +Source_file * +Sources::get_file (string *file_string) //UGH +{ + if (*file_string != "-" && path_) + { + string file_string_o = path_->find (*file_string); + if ((file_string_o == "") && (*file_string != "")) + return 0; + *file_string = file_string_o; + } + Source_file *f = new Source_file (*file_string); + add (f); + return f; +} + +void +Sources::add (Source_file *sourcefile) +{ + sourcefiles_.push_back (sourcefile); +} + +Sources::~Sources () +{ + for (vsize i = 0; i < sourcefiles_.size (); i++) + { + sourcefiles_[i]->unprotect (); + } +} +