XMLObject.cpp
Go to the documentation of this file.00001 //*** XMLObject.cpp *** 00002 00003 #include "XMLObject.h" 00004 #include "XMLTextParser.h" 00005 #include "Asset.h" 00006 00007 //*** XML_Element *** 00008 00009 XMLObject* XMLObject::XML_Element(StringId _name, const XMLAttributeList& _attributes) 00010 { 00011 // If running a debug build, report unknown XML elements and stop the parsing, 00012 // if running a release build, just ignore them and continue parsing 00013 #ifdef _DEBUG 00014 char buffer[256]; 00015 SNPrintF(buffer,255,"Unexpected XML element \"%s\"",_name.GetString()); 00016 Assert(false,buffer); 00017 return 0; 00018 #else 00019 return this; 00020 #endif 00021 } 00022 00023 00024 //*** XML_ElementEnd *** 00025 00026 void XMLObject::XML_ElementEnd(StringId _name) 00027 { 00028 } 00029 00030 00031 //*** XML_Attribute *** 00032 00033 void XMLObject::XML_Attribute(StringId _name, const XMLVariant& _value) 00034 { 00035 // If running a debug build, report unknown XML attributes 00036 #ifdef _DEBUG 00037 char buffer[256]; 00038 SNPrintF(buffer,255,"Unexpected XML attribute \"%s\"",_name.GetString()); 00039 Assert(false,buffer); 00040 #endif 00041 } 00042 00043 00044 //*** XML_Text *** 00045 00046 void XMLObject::XML_Text(StringId _name, const char* text) 00047 { 00048 } 00049 00050 00051 //*** LoadXML *** 00052 00053 void XMLObject::LoadXML(const Asset& asset) 00054 { 00055 XMLTextParser parser; 00056 parser.Parse(asset,this); 00057 } 00058 00059 00060 //*** SaveToStream *** 00061 00062 void XMLObject::SaveToStream(const XMLWriteStream& stream) 00063 { 00064 } 00065 00066
Reproduction/republishing of any material on this site without permission is strictly prohibited.
