From 6a488d0df3d0dc469081d2ac5773b891e91b0132 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 3 Jan 2005 19:29:47 +0000 Subject: [PATCH] More detailed debug output. --- src/common/commonebml.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/common/commonebml.cpp b/src/common/commonebml.cpp index 5ff5c9cbf..ded296b9e 100644 --- a/src/common/commonebml.cpp +++ b/src/common/commonebml.cpp @@ -24,6 +24,12 @@ #include #endif +#include +#include +#include +#include +#include + #include "common.h" #include "commonebml.h" @@ -35,6 +41,11 @@ __debug_dump_elements(EbmlElement *e, int level) { int i; EbmlMaster *m; + EbmlString *s; + EbmlUnicodeString *us; + EbmlSInteger *si; + EbmlUInteger *ui; + EbmlFloat *f; for (i = 0; i < level; i++) mxprint(stdout, " "); @@ -48,7 +59,17 @@ __debug_dump_elements(EbmlElement *e, mxprint(stdout, " (size: %u)\n", m->ListSize()); for (i = 0; i < m->ListSize(); i++) debug_dump_elements((*m)[i], level + 1); - } else + } else if ((s = dynamic_cast(e)) != NULL) + mxprint(stdout, " (%s)\n", string(*s).c_str()); + else if ((us = dynamic_cast(e)) != NULL) + mxprint(stdout, " (%s)\n", UTFstring_to_cstrutf8(UTFstring(*us)).c_str()); + else if ((si = dynamic_cast(e)) != NULL) + mxprint(stdout, " (%lld)\n", int64(*si)); + else if ((ui = dynamic_cast(e)) != NULL) + mxprint(stdout, " (%llu)\n", uint64(*ui)); + else if ((f = dynamic_cast(e)) != NULL) + mxprint(stdout, " (%f)\n", double(*f)); + else mxprint(stdout, "\n"); } #endif