![]() |
00001 /* -*- C++ -*- */ 00002 00003 /**************************************************************************** 00004 ** Copyright (c) quickfixengine.org All rights reserved. 00005 ** 00006 ** This file is part of the QuickFIX FIX Engine 00007 ** 00008 ** This file may be distributed under the terms of the quickfixengine.org 00009 ** license as defined by quickfixengine.org and appearing in the file 00010 ** LICENSE included in the packaging of this file. 00011 ** 00012 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00013 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00014 ** 00015 ** See http://www.quickfixengine.org/LICENSE for licensing information. 00016 ** 00017 ** Contact ask@quickfixengine.org if any conditions of this licensing are 00018 ** not clear to you. 00019 ** 00020 ****************************************************************************/ 00021 00022 #ifndef FIX_MSXMLDOMDOCUMENT_H 00023 #define FIX_MSXMLDOMDOCUMENT_H 00024 00025 #ifdef _MSC_VER 00026 #pragma warning( disable : 4503 4355 4786 4290 ) 00027 #endif 00028 00029 #include "DOMDocument.h" 00030 #include "Exceptions.h" 00031 00032 namespace FIX 00033 { 00035 class MSXML_DOMAttributes : public DOMAttributes 00036 { 00037 public: 00038 MSXML_DOMAttributes( MSXML2::IXMLDOMNode* pNode ) 00039 { 00040 pNode->get_attributes(&m_pNodeMap); 00041 } 00042 00043 ~MSXML_DOMAttributes(); 00044 00045 bool get( const std::string&, std::string& ); 00046 DOMAttributes::map toMap(); 00047 00048 private: 00049 MSXML2::IXMLDOMNamedNodeMap* m_pNodeMap; 00050 }; 00051 00053 class MSXML_DOMNode : public DOMNode 00054 { 00055 public: 00056 MSXML_DOMNode( MSXML2::IXMLDOMNode* pNode ) 00057 : m_pNode( pNode ) {} 00058 00059 ~MSXML_DOMNode(); 00060 00061 DOMNodePtr getFirstChildNode(); 00062 DOMNodePtr getNextSiblingNode(); 00063 DOMAttributesPtr getAttributes(); 00064 std::string getName(); 00065 std::string getText(); 00066 00067 private: 00068 MSXML2::IXMLDOMNode* m_pNode; 00069 }; 00070 00072 class MSXML_DOMDocument : public DOMDocument 00073 { 00074 public: 00075 MSXML_DOMDocument() throw( ConfigError ); 00076 ~MSXML_DOMDocument(); 00077 00078 bool load( std::istream& ); 00079 bool load( const std::string& ); 00080 bool xml( std::ostream& ); 00081 00082 DOMNodePtr getNode( const std::string& ); 00083 00084 private: 00085 MSXML2::IXMLDOMDocument2* m_pDoc; 00086 }; 00087 } 00088 00089 #endif