1 /* 2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET 4 * 5 * Copyright (C) 2012 - 2016 - Scilab Enterprises 6 * 7 * This file is hereby licensed under the terms of the GNU GPL v2.0, 8 * pursuant to article 5.3.4 of the CeCILL v.2.1. 9 * This file was originally licensed under the terms of the CeCILL v2.1, 10 * and continues to be available under such terms. 11 * For more information, see the COPYING file which you should have received 12 * along with this program. 13 * 14 */ 15 16 #include "XMLObject.hxx" 17 #include "XMLNotHandledElement.hxx" 18 #include "VariableScope.hxx" 19 20 extern "C" 21 { 22 extern const char *nodes_type[]; 23 } 24 25 namespace org_modules_xml 26 { XMLNotHandledElement(const XMLObject & _parent,xmlNode * _node)27XMLNotHandledElement::XMLNotHandledElement(const XMLObject & _parent, xmlNode * _node): XMLObject(), parent(_parent) 28 { 29 node = _node; 30 scilabType = XMLNOTHANDLED; 31 id = scope->getVariableId(*this); 32 scope->registerPointers(node, this); 33 } 34 ~XMLNotHandledElement()35XMLNotHandledElement::~XMLNotHandledElement() 36 { 37 scope->unregisterPointer(node); 38 scope->removeId(id); 39 } 40 getRealXMLPointer() const41void *XMLNotHandledElement::getRealXMLPointer() const 42 { 43 return static_cast < void *>(node); 44 } 45 getXMLObjectParent() const46const XMLObject *XMLNotHandledElement::getXMLObjectParent() const 47 { 48 return &parent; 49 } 50 toString() const51const std::string XMLNotHandledElement::toString() const 52 { 53 std::ostringstream oss; 54 55 oss << "Not handled XML Element" << std::endl; 56 oss << "type: " << nodes_type[node->type - 1]; 57 58 return oss.str(); 59 } 60 } 61