X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fstructure.cpp;h=e1ea6d56577349461171b03969942affcb68c5cd;hp=c084096c49ff3d8509924d87ef4174e0ff934c89;hb=834bacb25c9427fb03b8f9b34605738fb59202e1;hpb=06eb6b761f4b9d9eed4decd8ed50d94b40b94a0e diff --git a/ginac/structure.cpp b/ginac/structure.cpp index c084096c..e1ea6d56 100644 --- a/ginac/structure.cpp +++ b/ginac/structure.cpp @@ -26,6 +26,7 @@ #include "archive.h" #include "debugmsg.h" #include "utils.h" +#include "print.h" namespace GiNaC { @@ -44,36 +45,21 @@ DEFAULT_CTORS(structure) DEFAULT_ARCHIVING(structure) ////////// -// functions overriding virtual functions from bases classes +// functions overriding virtual functions from base classes ////////// -void structure::printraw(std::ostream & os) const -{ - debugmsg("structure printraw",LOGLEVEL_PRINT); - - os << class_name() << "(hash=" << hashvalue << ",flags=" << flags << ")"; -} - -void structure::print(std::ostream & os, unsigned upper_precedence) const +void structure::print(const print_context & c, unsigned level) const { debugmsg("structure print",LOGLEVEL_PRINT); - os << class_name() << "()"; -} - -void structure::printtree(std::ostream & os, unsigned indent) const -{ - debugmsg("structure printtree",LOGLEVEL_PRINT); + if (is_of_type(c, print_tree)) { - os << std::string(indent,' ') << class_name() << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec - << std::endl; -} - -void structure::printcsrc(std::ostream & os, unsigned type, unsigned upper_precedence) const -{ - debugmsg("structure print csrc",LOGLEVEL_PRINT); + c.s << std::string(level, ' ') << class_name() + << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec + << std::endl; - os << "structure()"; + } else + c.s << class_name() << "()"; } // protected