FUtils/FUXmlWriter.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2005-2006 Feeling Software Inc.
00003     MIT License: http://www.opensource.org/licenses/mit-license.php
00004 */
00005 
00011 #ifndef _FU_XML_WRITER_H_
00012 #define _FU_XML_WRITER_H_
00013 
00014 #ifdef HAS_LIBXML
00015 
00024 namespace FUXmlWriter
00025 {
00029     FCOLLADA_EXPORT xmlNode* CreateNode(const char* name);
00030 
00035     FCOLLADA_EXPORT void AddChild(xmlNode* parent, xmlNode* child);
00036 
00042     FCOLLADA_EXPORT xmlNode* AddChild(xmlNode* parent, const char* name);
00043 
00051     FCOLLADA_EXPORT xmlNode* AddChild(xmlNode* parent, const char* name, const char* content);
00052 #ifdef UNICODE
00053     FCOLLADA_EXPORT xmlNode* AddChild(xmlNode* parent, const char* name, const fstring& content); 
00054 #endif
00055     inline xmlNode* AddChild(xmlNode* parent, const char* name, const string& content) { return AddChild(parent, name, content.c_str()); } 
00056     inline xmlNode* AddChild(xmlNode* parent, const char* name, FUSStringBuilder& content) { return AddChild(parent, name, content.ToCharPtr()); } 
00065     template <typename T> inline xmlNode* AddChild(xmlNode* parent, const char* name, const T& value) { globalSBuilder.set(value); return AddChild(parent, name, globalSBuilder); }
00066 
00072     FCOLLADA_EXPORT void AddSibling(xmlNode* sibling, xmlNode* dangling);
00073 
00080     FCOLLADA_EXPORT xmlNode* AddSibling(xmlNode* sibling, const char* name);
00081 
00089     FCOLLADA_EXPORT xmlNode* AddChildOnce(xmlNode* parent, const char* name, const char* content=NULL);
00090     inline xmlNode* AddChildOnce(xmlNode* parent, const char* name, const string& content) { return AddChildOnce(parent, name, content.c_str()); } 
00091     inline xmlNode* AddChildOnce(xmlNode* parent, const char* name, FUSStringBuilder& content) { return AddChildOnce(parent, name, content.ToCharPtr()); } 
00100     template <typename T> inline xmlNode* AddChildOnce(xmlNode* parent, const char* name, const T& value) { globalSBuilder.set(value); return AddChildOnce(parent, name, globalSBuilder); }
00101 
00106     FCOLLADA_EXPORT void AddContent(xmlNode* node, const char* content);
00107 #ifdef UNICODE
00108     FCOLLADA_EXPORT void AddContent(xmlNode* node, const fstring& content); 
00109 #endif
00110     inline void AddContent(xmlNode* node, const string& content) { AddContent(node, content.c_str()); } 
00111     inline void AddContent(xmlNode* node, FUSStringBuilder& content) { AddContent(node, content.ToCharPtr()); } 
00117     template <typename T> inline void AddContent(xmlNode* node, const T& value) { globalSBuilder.set(value); return AddContent(node, globalSBuilder); }
00118 
00124     FCOLLADA_EXPORT void AddAttribute(xmlNode* node, const char* attributeName, const char* attributeValue);
00125 #ifdef UNICODE
00126     FCOLLADA_EXPORT void AddAttribute(xmlNode* node, const char* attributeName, const fstring& attributeValue); 
00127 #endif
00128     inline void AddAttribute(xmlNode* node, const char* attributeName, FUSStringBuilder& attributeValue) { AddAttribute(node, attributeName, attributeValue.ToCharPtr()); } 
00129     inline void AddAttribute(xmlNode* node, const char* attributeName, const string& attributeValue) { AddAttribute(node, attributeName, attributeValue.c_str()); } 
00136     template <typename T> inline void AddAttribute(xmlNode* node, const char* attributeName, const T& attributeValue) { globalSBuilder.set(attributeValue); AddAttribute(node, attributeName, globalSBuilder.ToCharPtr()); }
00137 
00143     FCOLLADA_EXPORT void AddChildSorted(xmlNode* parent, xmlNode* child);
00144 
00152     FCOLLADA_EXPORT xmlNode* AddChildSorted(xmlNode* parent, const char* name, const char* content=NULL);
00153 };
00154 
00155 #endif // HAS_LIBXML
00156 
00157 #endif // _FU_XML_WRITER_H_

Generated on Fri May 12 16:44:39 2006 for FCollada by  doxygen 1.4.6-NO