diff --git a/apps/trimeshinfo/SlotsNode.h b/apps/trimeshinfo/SlotsNode.h index 1902479c..cbe5b6df 100644 --- a/apps/trimeshinfo/SlotsNode.h +++ b/apps/trimeshinfo/SlotsNode.h @@ -5,12 +5,13 @@ #include "Node.h" using namespace std; + class ValueNode: public Node { public: ValueNode(void){node_type = VALUE_NODE;value = "empty";}; int node_type; - const char* value; //tra due tag + string value; //tra due tag virtual void printNode(); virtual int qualifyNode(); diff --git a/apps/trimeshinfo/XMLTree.h b/apps/trimeshinfo/XMLTree.h index afb7ddac..8df8828c 100644 --- a/apps/trimeshinfo/XMLTree.h +++ b/apps/trimeshinfo/XMLTree.h @@ -154,7 +154,7 @@ void XMLTree::finalizeMain() void XMLTree::addHeaders(const char* str, const char*val) { - MainNode* mn = (MainNode*) root.Sons.front(); + MainNode* mn = dynamic_cast(root.Sons.front()); mn->headers.push_back(pair(str,val)); } @@ -176,7 +176,6 @@ void XMLTree::addClasses(ClassNode* cn) void XMLTree::addNode(const char* s, int value_type, const char* name) { - ValueNode* vn = new ValueNode; EntryNode* en = new EntryNode; OwnSlotNode* osn = new OwnSlotNode; @@ -275,7 +274,7 @@ void XMLTree::printXMLTree() osn = dynamic_cast(*it3); fprintf(fp,"\t\t\t\n",osn->name); fprintf(fp,"\t\t\t\t\n",osn->entry.type); - fprintf(fp,"\t\t\t\t\t%s", osn->entry.value.value); + fprintf(fp,"\t\t\t\t\t%s", osn->entry.value.value.c_str()); fprintf(fp,"\n"); fprintf(fp,"\t\t\t\t\n"); fprintf(fp,"\t\t\t\n"); @@ -302,7 +301,7 @@ void XMLTree::printXMLTree() osn = dynamic_cast(*it3); fprintf(fp,"\t\t\t\t\n",osn->name); fprintf(fp,"\t\t\t\t\t\n",osn->entry.type); - fprintf(fp,"\t\t\t\t\t\t%s", osn->entry.value.value); + fprintf(fp,"\t\t\t\t\t\t%s", osn->entry.value.value.c_str()); fprintf(fp,"\n"); fprintf(fp,"\t\t\t\t\t\n"); fprintf(fp,"\t\t\t\t\n"); @@ -337,7 +336,7 @@ void XMLTree::printXMLTree() osn = dynamic_cast(*it3); fprintf(fp,"\t\t\t\t\n",osn->name); fprintf(fp,"\t\t\t\t\t\n",osn->entry.type); - fprintf(fp,"\t\t\t\t\t\t%s", osn->entry.value.value); + fprintf(fp,"\t\t\t\t\t\t%s", osn->entry.value.value.c_str()); fprintf(fp,"\n"); fprintf(fp,"\t\t\t\t\t\n"); fprintf(fp,"\t\t\t\t\n");