//******************************************************************* // // License: See top level LICENSE.txt file. // // Author: Oscar Kramer (ossim port by D. Burken) // // Description: // // Contains declaration of class ossimXmlDocument. This class provides read-only // parsing and accessing of an XML document file. // //***************************************************************************** // $Id: ossimXmlDocument.h 21579 2012-08-31 14:24:11Z dburken $ #ifndef ossimXmlDocument_HEADER #define ossimXmlDocument_HEADER 1 #include #include #include #include #include #include class OSSIMDLLEXPORT ossimXmlDocument : public ossimObject, public ossimErrorStatusInterface { public: ossimXmlDocument(const ossimFilename& xmlFileName=""); ossimXmlDocument(const ossimXmlDocument& src); virtual ossimObject* dup()const { return new ossimXmlDocument(*this); } virtual ~ossimXmlDocument(); bool write(const ossimFilename& file); bool openFile(const ossimFilename& filename); bool read(std::istream& in); /** * Appends any matching nodes to the list supplied (should be empty): */ void findNodes(const ossimString& xpath, std::vector >& nodelist) const; OSSIMDLLEXPORT friend std::ostream& operator << (std::ostream& os, const ossimXmlDocument& xml_doc); void initRoot(ossimRefPtr node); ossimRefPtr getRoot(); const ossimRefPtr getRoot()const; ossimRefPtr removeRoot(); void fromKwl(const ossimKeywordlist& kwl); void toKwl(ossimKeywordlist& kwl, const ossimString& prefix = "")const; private: ossimRefPtr theRootNode; ossimString theXmlHeader; ossimFilename theFilename; bool theStrictCheckFlag; bool readHeader(std::istream& in); TYPE_DATA }; #endif /* #ifndef ossimXmlDocument_HEADER */