- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# FUtils/FUXmlParser.h

    00001 /*
    00002     Copyright (C) 2005-2007 Feeling Software Inc.
    00003     Portions of the code are:
    00004     Copyright (C) 2005-2007 Sony Computer Entertainment America
    00005
    00006     MIT License: http://www.opensource.org/licenses/mit-license.php
    00007 */
    00008 /*
    00009     Based on the FS Import classes:
    00010     Copyright (C) 2005-2006 Feeling Software Inc
    00011     Copyright (C) 2005-2006 Autodesk Media Entertainment
    00012     MIT License: http://www.opensource.org/licenses/mit-license.php
    00013 */
    00014
    00015 #ifndef _FU_XML_PARSER_H_
    00016 #define _FU_XML_PARSER_H_
    00017
    00018 #ifdef HAS_LIBXML
    00019
    00020 typedef fm::pvector<struct _xmlNode> xmlNodeList;
    00022 namespace FUXmlParser
    00023 {
    00024     // Parse an XML compatable string for the std representation
    00025     FCOLLADA_EXPORT fm::string XmlToString(const char* s);
    00026 #ifdef UNICODE
    00027     FCOLLADA_EXPORT fstring XmlToString(const fchar* s);
    00028 #endif // UNICODE
    00029
    00030     // Retrieve specific child nodes
    00031     FCOLLADA_EXPORT xmlNode* FindChildByType(xmlNode* parent, const char* type);
    00032     FCOLLADA_EXPORT xmlNode* FindChildByName(xmlNode* parent, const char* name);
    00033     FCOLLADA_EXPORT void FindChildrenByType(xmlNode* parent, const char* type, xmlNodeList& nodes);
    00034     FCOLLADA_EXPORT xmlNode* FindChildByProperty(xmlNode* parent, const char* prop, const char* val);
    00035     FCOLLADA_EXPORT xmlNode* FindNodeInListByProperty(xmlNodeList list, const char* property, const char* prop);
    00036
    00037     // Retrieve node property and content
    00038     FCOLLADA_EXPORT bool HasNodeProperty(xmlNode* node, const char* property);
    00039     FCOLLADA_EXPORT fm::string ReadNodeProperty(xmlNode* node, const char* property);
    00040     FCOLLADA_EXPORT FUCrc32::crc32 ReadNodePropertyCRC(xmlNode* node, const char* property);
    00041     FCOLLADA_EXPORT const char* ReadNodeContentDirect(xmlNode* node);
    00042     FCOLLADA_EXPORT fm::string ReadNodeContentFull(xmlNode* node);
    00043 };
    00044
    00045 inline bool IsEquivalent(const xmlChar* sz1, const char* sz2) { return IsEquivalent((const char*) sz1, sz2); }
    00046
    00047 #endif // HAS_LIBXML
    00048
    00049 #endif //_FU_XML_PARSER_H_