#include "archive.h"
#include "debugmsg.h"
#include "utils.h"
+#include "print.h"
namespace GiNaC {
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