X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fprint.cpp;h=218bb9c9d3a63e517f26eebd556033371c70c3f5;hp=2b1e323bffad93013b635f483c99220660c5f5a2;hb=308cd44009b6753631a267093f6e2baff73cc963;hpb=3a63743e24046766b37c3d1bd38605542ee0a536 diff --git a/ginac/print.cpp b/ginac/print.cpp index 2b1e323b..218bb9c9 100644 --- a/ginac/print.cpp +++ b/ginac/print.cpp @@ -3,7 +3,7 @@ * Implementation of helper classes for expression output. */ /* - * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,49 +26,71 @@ namespace GiNaC { +/** Next free ID for print_context types. */ +unsigned next_print_context_id = 0; + + +GINAC_IMPLEMENT_PRINT_CONTEXT(print_context, void) +GINAC_IMPLEMENT_PRINT_CONTEXT(print_dflt, print_context) +GINAC_IMPLEMENT_PRINT_CONTEXT(print_latex, print_context) +GINAC_IMPLEMENT_PRINT_CONTEXT(print_python, print_context) +GINAC_IMPLEMENT_PRINT_CONTEXT(print_python_repr, print_context) +GINAC_IMPLEMENT_PRINT_CONTEXT(print_tree, print_context) +GINAC_IMPLEMENT_PRINT_CONTEXT(print_csrc, print_context) +GINAC_IMPLEMENT_PRINT_CONTEXT(print_csrc_float, print_csrc) +GINAC_IMPLEMENT_PRINT_CONTEXT(print_csrc_double, print_csrc) +GINAC_IMPLEMENT_PRINT_CONTEXT(print_csrc_cl_N, print_csrc) + print_context::print_context() - : s(std::cout) {} -print_context::print_context(std::ostream & os) - : s(os) {} + : s(std::cout), options(0) {} +print_context::print_context(std::ostream & os, unsigned opt) + : s(os), options(opt) {} + +print_dflt::print_dflt() + : print_context(std::cout) {} +print_dflt::print_dflt(std::ostream & os, unsigned opt) + : print_context(os, opt) {} print_latex::print_latex() : print_context(std::cout) {} -print_latex::print_latex(std::ostream & os) - : print_context(os) {} +print_latex::print_latex(std::ostream & os, unsigned opt) + : print_context(os, opt) {} print_python::print_python() : print_context(std::cout) {} -print_python::print_python(std::ostream & os) - : print_context(os) {} +print_python::print_python(std::ostream & os, unsigned opt) + : print_context(os, opt) {} print_python_repr::print_python_repr() : print_context(std::cout) {} -print_python_repr::print_python_repr(std::ostream & os) - : print_context(os) {} +print_python_repr::print_python_repr(std::ostream & os, unsigned opt) + : print_context(os, opt) {} +print_tree::print_tree() + : print_context(std::cout), delta_indent(4) {} print_tree::print_tree(unsigned d) : print_context(std::cout), delta_indent(d) {} -print_tree::print_tree(std::ostream & os, unsigned d) - : print_context(os), delta_indent(d) {} +print_tree::print_tree(std::ostream & os, unsigned opt, unsigned d) + : print_context(os, opt), delta_indent(d) {} print_csrc::print_csrc() : print_context(std::cout) {} -print_csrc::print_csrc(std::ostream & os) - : print_context(os) {} +print_csrc::print_csrc(std::ostream & os, unsigned opt) + : print_context(os, opt) {} print_csrc_float::print_csrc_float() : print_csrc(std::cout) {} -print_csrc_float::print_csrc_float(std::ostream & os) - : print_csrc(os) {} +print_csrc_float::print_csrc_float(std::ostream & os, unsigned opt) + : print_csrc(os, opt) {} print_csrc_double::print_csrc_double() : print_csrc(std::cout) {} -print_csrc_double::print_csrc_double(std::ostream & os) - : print_csrc(os) {} +print_csrc_double::print_csrc_double(std::ostream & os, unsigned opt) + : print_csrc(os, opt) {} print_csrc_cl_N::print_csrc_cl_N() : print_csrc(std::cout) {} -print_csrc_cl_N::print_csrc_cl_N(std::ostream & os) - : print_csrc(os) {} +print_csrc_cl_N::print_csrc_cl_N(std::ostream & os, unsigned opt) + : print_csrc(os, opt) {} } // namespace GiNaC