/** * This source file is part of OgreColladaPlugin * an addon for OGRE (Object-oriented Graphics Rendering Engine) * For the latest info, see http://www.ogre3d.org/ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA, or go to * http://www.gnu.org/copyleft/lesser.txt. * * @author Philipp Hartl * @see README */ #ifndef __COLLADA_UTILS_H__ #define __COLLADA_UTILS_H__ #include "OgreColladaPrerequisites.h" namespace Ogre { /** * some functions to get information out of xml data nodes */ class ColladaUtils { public: /** * search for the id in the childs of start node * and return the node corresponding to the id string * in first child line, no more! * * * @param start the xml node where we start to search * @param id the string identifier we are looking for * @return the xmlNode if found, else NULL */ static xmlNode *getChildById(xmlNode *start, const char *id); /** * search for the tagname in the childs of start node * and return the node corresponding to the string * in first child line, no more! * * * @param start the xml node where to start * @param tagname the string element we are looking for * @return the xmlNode if found, else NULL */ static xmlNode *getChildByTagName(xmlNode *start, const String &tagname); /** * similar to getChildByTagName, but returns a node list * * @see getChildByTagName * @return a list with xmlNode * */ static xmlNodePtrVector getChildsByTagName(xmlNode *start, const String &tagname); /** * get content of node, between ... * interior entities will be substituted !! * * @param node the xml node that holds the content * @return the string content which is hold by the xml node */ static String getContent(xmlNode *node); static String getContentDirect(xmlNode *node); /** * look for the attribute property name we want * and return its value * * * @param node the actual xml node * @param property the property we want to get out * @return the string value of the property */ static String getProperty(xmlNode *node, const char *property); static String getProperty(xmlNode *node, const String &property); /** * print all child elements of this node * * @param node a node in tree hierachy * @return void */ static void printChildElements(xmlNode *node); /** * print all elements of this node * children of their children and so on * * @param node a node in tree hierachy * @return void */ static void printAllElements(xmlNode *node); }; } #endif // __COLLADA_UTILS_H__