diff options
Diffstat (limited to 'media/libdrm/mobile2/include/util/xml')
4 files changed, 0 insertions, 342 deletions
diff --git a/media/libdrm/mobile2/include/util/xml/DomExpatAgent.h b/media/libdrm/mobile2/include/util/xml/DomExpatAgent.h deleted file mode 100644 index 9972d5b..0000000 --- a/media/libdrm/mobile2/include/util/xml/DomExpatAgent.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */
-#ifndef _DOMEXPATAGENT_ -#define _DOMEXPATAGENT_ - -#include <Drm2CommonTypes.h> -#include <ofstream.h> -#include <sostream.h> -#include <ustring.h> -#include <sistream.h> -#include <util/domcore/NodeImpl.h> -#include <util/domcore/DOMString.h> -#include "ExpatWrapper.h" -#include "XMLElementImpl.h" -#include "XMLDocumentImpl.h" -using namespace ustl; - -class DomExpatAgent : public ExpatWrapper { -public: - /** - * Constructor for DomExpatAgent. - * @param xmlDocPtr XMLDocument pointer. - */ - DomExpatAgent(XMLDocumentImpl* xmlDocPtr); - - /** Destructor for DomExpatAgent. */ - ~DomExpatAgent(); - - /** - * Generate XML DOM Document from XML source. - * @param <code>xmlStream</code> the XML source stream. - * @return ture or false to indicate whether generate successfully. - */ - bool generateDocumentFromXML(istringstream *xmlStream); - - /** - * Generate XML stream from XML DOM document. - * @return xml stream. - */ - ostringstream* generateXMLFromDocument(); - - /** - * deal with start element in Expat. - */ - virtual void startElement(const XML_Char *name, - const XML_Char **atts); - - /** - * deal with end element for Expat. - */ - virtual void endElement(const XML_Char *name); - - /** - * deal with data handler for Expat. - */ - virtual void dataHandler(const XML_Char *s, int len); - -PRIVATE: - /** - * Push a xml element with the specific tag name into stack. - * @param name The name of tag. - * @param atts The attributes of related tag. - */ - void pushTag(const DOMString *name, const XML_Char **atts); - - /** - * Append text into top element of stack. - * @param text The data related to the present tag. - */ - void appendText(const DOMString *text); - - /** - * Pop the xml element with the specific tag name. - * @param name The name of tag. - */ - void popTag(const DOMString *name); - - /** - * Traverse the XML DOM document starting from specific element. - * @param root The specific element start to traverse. - */ - void traverse(ElementImpl *root); - -PRIVATE: - vector<NodeImpl*> mStack; /**< the stack to manage the tag. */ - XMLElementImpl* mTopElementPtr; /**< the top element of the stack. */ - XMLDocumentImpl* mXMLDocumentPtr; /**< XML DOM document pointer. */ - ostringstream mXMLostream; /**< xml output stream. */ -}; - -#endif diff --git a/media/libdrm/mobile2/include/util/xml/ExpatWrapper.h b/media/libdrm/mobile2/include/util/xml/ExpatWrapper.h deleted file mode 100644 index 5a2d7fe..0000000 --- a/media/libdrm/mobile2/include/util/xml/ExpatWrapper.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */
-#ifndef _XML_H_ -#define _XML_H_ - -#include <expat.h> -#include <ustring.h> -#include <Drm2CommonTypes.h> - -using namespace ustl; - -class ExpatWrapper { -public: - /** - * Constructor for ExpatWrapper. - */ - ExpatWrapper(); - - /** - * Destructor for ExpatWrapper. - */ - virtual ~ExpatWrapper(); - - /** - * decode call expat to parse the xml. - * @param buf The buffer to be parsed. - * @param len The length of the buffer. - * @param isFinal The flag to indicate whether the buffer - * is a fragment or whole xml. - */ - int decode(const char* buf, int len, int isFinal); - - /** - * virtual funtion to deal with the start element in expat, need implement by child class. - */ - virtual void startElement(const XML_Char *name, const XML_Char **atts); - - /** - * virtual funtion to deal with the end element in expat, need implement by child class. - */ - virtual void endElement(const XML_Char *name); - - /** - * virtual funtion to deal with the data handler in expat, need implement by child class. - */ - virtual void dataHandler(const XML_Char *s, int len); - -PRIVATE: - /** - * Callback for Expat startElement. - */ - static void startElementCallback(void *userData, const XML_Char *name, const XML_Char **atts); - - /** - * Callback for Expat endElement. - */ - static void endElementCallback(void *userData, const XML_Char *name); - - /** - * Callback for Expat dataHandler. - */ - static void dataHandlerCallback(void *userData, const XML_Char *s, int len); - -PRIVATE: - XML_Parser mParser; /**< The expat parser object. */ -}; - -#endif diff --git a/media/libdrm/mobile2/include/util/xml/XMLDocumentImpl.h b/media/libdrm/mobile2/include/util/xml/XMLDocumentImpl.h deleted file mode 100644 index c29b87d..0000000 --- a/media/libdrm/mobile2/include/util/xml/XMLDocumentImpl.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */
-#ifndef _XMLDOCUMENTIMPL_H_ -#define _XMLDOCUMENTIMPL_H_ - -#include <Drm2CommonTypes.h> -#include <util/domcore/DocumentImpl.h> - -class XMLDocumentImpl : public DocumentImpl { -public: - /** Constructor for XMLDocumentImpl. */ - XMLDocumentImpl(); - - /** Destructor for XMLDocumentImpl. */ - ~XMLDocumentImpl(); - - /** - * Get the first child element of the document. - * @return the first child <code>Element</code> of document. - */ - virtual ElementImpl* getDocumentElement() const; - - /** - * Create a XML element with the specific name. - * @param tagName The specific tag name. - * @return a new xml <code>Element</code> - * @exception DOMException - */ - virtual ElementImpl* createElement(const DOMString* tagName) const throw (DOMException); - - /** - * Create a text node with the specific data. - * @param data The specific data. - * @return a new <code>Text</code> node. - */ - virtual TextImpl* createTextNode(const DOMString* data) const; -}; - -#endif diff --git a/media/libdrm/mobile2/include/util/xml/XMLElementImpl.h b/media/libdrm/mobile2/include/util/xml/XMLElementImpl.h deleted file mode 100644 index a0c95ec..0000000 --- a/media/libdrm/mobile2/include/util/xml/XMLElementImpl.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */
-#ifndef _XMLELEMENTIMPL_H_ -#define _XMLELEMENTIMPL_H_ - -#include <Drm2CommonTypes.h> -#include <util/domcore/ElementImpl.h> -#include <util/domcore/DOMString.h> -#include <umap.h> -#include <ustring.h> -using namespace ustl; - -typedef map<DOMString, DOMString> DOMStringMap; - -class XMLElementImpl : public ElementImpl { -public: - /** - * Constructor for XMLElementImpl. - * @param tag The name of the tag. - */ - XMLElementImpl(const DOMString *tag); - - /** Destructor for XMLElementImpl. */ - ~XMLElementImpl(); - - /** - * Get the attribute map of the XML element. - * @return <code>DOMStringMap</code> - */ - const DOMStringMap* getAttributeMap() const; - - /** - * Get the tag name of the element. - * return tag name. - */ - virtual const DOMString* getTagName() const; - - /** - * Set the attribute of the element. - * @param name The key of the attribute. - * @param value The value of the attribute. - */ - virtual void setAttribute(const DOMString* name, const DOMString* value) throw (DOMException); - - /** - * Remove the specific attribute. - * @param name The key of the attribute. - * @exception DOMException. - */ - virtual void removeAttribute(const DOMString* name) throw (DOMException); - - /** - * Get the specific attribute. - * @param name The key of the attribute. - * @return the value of the attribute. - */ - virtual const DOMString* getAttribute(const DOMString* name) const; - - /** - * Detect whether element has attributes or not. - * @return true or false to indicate the result. - */ - virtual bool hasAttributes() const; - - /** - * Find the first child node in element by its tag name. - * @param element the specific element to be found. - * @param tag the specific tag name to be searched. - * @return NULL if not found otherwise the child node. - */ - const NodeImpl* findSoloChildNode(const char* tag) const; - - /** - * Get the first text containted in first child of the element. - * @param tag the specific tag name to be searched. - * @return NULL if not found otherwise the text. - */ - const string* getSoloText(const char* tag) const; - - /** - * Get the first child xml element containted in the element. - * @param tag the specific tag name to be searched. - * @return NULL if not found otherwise the element. - */ - const XMLElementImpl* getSoloElement(const char* tag) const; - -PRIVATE: - DOMString mTagName; /**< The tag name. */ - DOMStringMap mAttributeMap; /** The map of attributes. */ -}; - -#endif |