X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpaper-outputter.cc;h=c321c6f8df4e4d7701d925bc5ad5284706b20242;hb=459d4d5eaa90373349eb0461af7b6e3cdfd56981;hp=5da3ca0607ed7b1981632248a261f480f77e0ce3;hpb=58bcc84c9480dae1b21bc24d8396b91fe19e0131;p=lilypond.git diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 5da3ca0607..c321c6f8df 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -3,15 +3,17 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2005 Han-Wen Nienhuys + (c) 1997--2006 Han-Wen Nienhuys Jan Nieuwenhuizen */ #include "paper-outputter.hh" -#include +#include #include +using namespace std; + #include "dimensions.hh" #include "file-name.hh" #include "font-metric.hh" @@ -27,15 +29,14 @@ #include "ly-smobs.icc" -Paper_outputter::Paper_outputter (String file_name, String format) +Paper_outputter::Paper_outputter (SCM port, string format) { - file_ = SCM_EOL; + file_ = port; output_module_ = SCM_EOL; smobify_self (); - file_name_ = file_name; - String module_name = "scm output-" + format; - output_module_ = scm_c_resolve_module (module_name.to_str0 ()); + string module_name = "scm output-" + format; + output_module_ = scm_c_resolve_module (module_name.c_str ()); } Paper_outputter::~Paper_outputter () @@ -62,14 +63,8 @@ Paper_outputter::print_smob (SCM x, SCM p, scm_print_state*) } SCM -Paper_outputter::file () +Paper_outputter::file () const { - if (file_ == SCM_EOL) - if (file_name_ == "-") - file_ = scm_current_output_port (); - else - file_ = scm_open_file (scm_makfrom0str (file_name_.to_str0 ()), - scm_makfrom0str ("w")); return file_; }