// XMLDocument.h: interface for the WMXMLDocument class.
//
//////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2002 Robert Cunnings. All rights reserved.
//
// You may copy, modify, distribute or publish this code free of charge.
//
// NO WARRANTY: This software is provided AS IS, without warranty of any kind.
//
//////////////////////////////////////////////////////////////////////
//
// WMXMLDocument class - implementation of simple XML document reader/writer
//  
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_WMXMLDOCUMENT_H__2DB636D1_6E31_4B12_9309_EDF61FEB4419__INCLUDED_)
#define AFX_WMXMLDOCUMENT_H__2DB636D1_6E31_4B12_9309_EDF61FEB4419__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "XMLDocFragment.h"

class WMXMLDocument : public WMXMLDocFragment  
{
public:
	WMXMLDocument();
	virtual ~WMXMLDocument();

    bool Read(const string& strURL);
    bool Write(const string& strURL);
    void SetUserAgent(const string& strUA) { m_strUserAgent = strUA; }

protected:

	bool LoadAndParseXMLDoc(const string& strFilePath);

	bool GetAndParseXMLDoc( const string& strHost,
							const string& strURI,
							int nPort,
							DWORD dwTimeout = 30000);

    // request timeout
    int         m_nHTTPTimeout;
    string      m_strUserAgent;
};

#endif // !defined(AFX_WMXMLDOCUMENT_H__2DB636D1_6E31_4B12_9309_EDF61FEB4419__INCLUDED_)
