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

# /Users/fpy/titan-1-5-MBARI/Mers/Utils/Io/Xml/Stream/Libxml2/Libxml2StreamReader.h

    00001
    00002 //
    00003 // Copyright (c) 2004           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00009 // Organization:        Model-based Embedded and Robotic Systems Group
    00010 //                                      Massachusetts Institute of Technology
    00011 //
    00013
    00014 #ifndef LIBXML2_STREAM_READER_H
    00015 #define LIBXML2_STREAM_READER_H
    00016
    00017 #include "../XmlStreamReader.h"
    00018 #include <libxml/xmlreader.h>
    00019
    00020 #ifdef LIBXML_READER_ENABLED
    00021
    00022 namespace Mers {
    00023         namespace Utils {
    00024                 namespace Io {
    00025                         namespace Xml {
    00026                                 namespace Stream {
    00027                                         namespace Libxml2 {
    00028
    00036                                                 class Libxml2StreamReader : public XmlStreamReader {
    00037                                                 public:
    00038                                                         Libxml2StreamReader(const string& filename);
    00039
    00040                                                         ~Libxml2StreamReader();
    00041
    00042                                                         //-----------------------------------------
    00043                                                         // Get functions
    00044                                                         //-----------------------------------------
    00045                                                         virtual int getAttributeCount() const;
    00046
    00047                                                         virtual const string& getAttributeValue(const string& name) const;
    00048
    00049                                                         virtual const string& getAttributeValue(const string& namespaceURI,
    00050                                                                                                                                                                                                                         const string& localName) const;
    00051
    00052                                                         virtual const string& getLocalName() const;
    00053
    00054                                                         virtual const XmlStreamLocation& getLocation() const;
    00055
    00056                                                         virtual const string& getText() const;
    00057
    00058                                                         //-----------------------------------------
    00059                                                         // Event type functions
    00060                                                         //-----------------------------------------
    00061                                                         virtual EventType getEventType() const;
    00062
    00063
    00064                                                         //-----------------------------------------
    00065                                                         // Stream navigation functions
    00066                                                         //-----------------------------------------
    00067                                                         virtual bool hasNext() const;
    00068
    00069                                                         virtual EventType next();
    00070
    00071                                                         virtual EventType nextSibling();
    00072
    00073                                                 private:
    00075                                                         xmlTextReader* reader;
    00076
    00080                                                         int readerResult;
    00081
    00085                                                         bool emptyElementEnd;
    00086
    00088                                                         XmlStreamLocation* location;
    00089
    00090
    00091                                                         // Cached values for getXXX functions.
    00092                                                         mutable string attributeValue;
    00093                                                         mutable string localName;
    00094                                                         mutable string namespaceUri;
    00095                                                         mutable string text;
    00096                                                 };
    00097                                         }
    00098                                 }
    00099                         }
    00100                 }
    00101         }
    00102 }
    00103
    00104 #else
    00105   #error "XInclude support not compiled in\n"
    00106 #endif
    00107
    00108 #endif