Gnash
0.8.10
|
Implements XML (AS2) and flash.xml.XMLDocument (AS3) class. More...
#include <XML_as.h>
Public Types | |
enum | ParseStatus { XML_OK = 0, XML_UNTERMINATED_CDATA = -2, XML_UNTERMINATED_XML_DECL = -3, XML_UNTERMINATED_DOCTYPE_DECL = -4, XML_UNTERMINATED_COMMENT = -5, XML_UNTERMINATED_ELEMENT = -6, XML_OUT_OF_MEMORY = -7, XML_UNTERMINATED_ATTRIBUTE = -8, XML_MISSING_CLOSE_TAG = -9, XML_MISSING_OPEN_TAG = -10 } |
enum | LoadStatus { XML_LOADED_UNDEFINED = -1, XML_LOADED_FALSE = false, XML_LOADED_TRUE = true } |
typedef std::string::const_iterator | xml_iterator |
Public Member Functions | |
XML_as (as_object &object) | |
Create an XML object. | |
XML_as (as_object &object, const std::string &xml) | |
~XML_as () | |
void | toString (std::ostream &o, bool encode) const |
Convert the XML object to a string. | |
const std::string & | getXMLDecl () const |
void | setXMLDecl (const std::string &xml) |
const std::string & | getDocTypeDecl () const |
void | setDocTypeDecl (const std::string &docType) |
const std::string & | getContentType () const |
void | setContentType (const std::string &contentType) |
void | parseXML (const std::string &xml) |
Parses an XML document into the specified XML object tree. | |
ParseStatus | status () const |
void | setStatus (ParseStatus st) |
LoadStatus | loaded () const |
void | setLoaded (LoadStatus st) |
bool | ignoreWhite () const |
Return current ignoreWhite property. | |
void | ignoreWhite (bool ignore) |
Set ignoreWhite property. |
Implements XML (AS2) and flash.xml.XMLDocument (AS3) class.
This class interface is identical in AS3 and AS2; it is probably included in AS3 for backward compatibility. The class definition is necessary because XML is encoded differently in AMF.
typedef std::string::const_iterator gnash::XML_as::xml_iterator |
gnash::XML_as::XML_as | ( | as_object & | object | ) |
Create an XML object.
An XMLDocument is always user-created, so always starts with an associated object.
References gnash::XMLNode_as::setObject().
gnash::XML_as::XML_as | ( | as_object & | object, |
const std::string & | xml | ||
) |
References gnash::XMLNode_as::setObject(), and parseXML().
gnash::XML_as::~XML_as | ( | ) | [inline] |
const std::string& gnash::XML_as::getContentType | ( | ) | const [inline] |
const std::string& gnash::XML_as::getDocTypeDecl | ( | ) | const [inline] |
const std::string& gnash::XML_as::getXMLDecl | ( | ) | const [inline] |
bool gnash::XML_as::ignoreWhite | ( | ) | const [inline] |
Return current ignoreWhite property.
Referenced by parseXML().
void gnash::XML_as::ignoreWhite | ( | bool | ignore | ) | [inline] |
Set ignoreWhite property.
LoadStatus gnash::XML_as::loaded | ( | ) | const [inline] |
void gnash::XML_as::parseXML | ( | const std::string & | xml | ) |
Parses an XML document into the specified XML object tree.
This reads in an XML file from disk and parses into into a memory resident tree which can be walked through later.
Calls to this function clear any precedently parsed data.
References _, ignoreWhite(), XML_OK, and XML_MISSING_CLOSE_TAG.
Referenced by XML_as().
void gnash::XML_as::setContentType | ( | const std::string & | contentType | ) | [inline] |
void gnash::XML_as::setDocTypeDecl | ( | const std::string & | docType | ) | [inline] |
void gnash::XML_as::setLoaded | ( | LoadStatus | st | ) | [inline] |
void gnash::XML_as::setStatus | ( | ParseStatus | st | ) | [inline] |
void gnash::XML_as::setXMLDecl | ( | const std::string & | xml | ) | [inline] |
ParseStatus gnash::XML_as::status | ( | ) | const [inline] |
void gnash::XML_as::toString | ( | std::ostream & | o, |
bool | encode | ||
) | const [virtual] |
Convert the XML object to a string.
This calls XMLNode::toString after adding an xmlDecl and docTypeDecl
o | The ostream to write the string to. |
encode | Whether to URL encode the node values. |
Reimplemented from gnash::XMLNode_as.
References gnash::key::i, gnash::XMLNode_as::firstChild(), and gnash::XMLNode_as::nextSibling().
Referenced by gnash::amf::Writer::writeObject().