#pragma once
#include "normalresponse.h"
#include "alias.h"
#import <msxml3.dll>

class CDAVPropfindResponse :
	public CNormalResponse
{
public:
	CDAVPropfindResponse(CServer *server,CWorkspaceAccess context,CRequest request,CAlias alias);
	virtual ~CDAVPropfindResponse(void);

	virtual void PreCreateResponse() {};			//	1:レスポンス生成準備		
	virtual void SetNextData(CBuffer &data);		//	2:受信データの設定(繰り返し)
	virtual void CreateResponse();					//	3:レスポンスの生成
	virtual __int64 GetResponseSize();				//	4:レスポンスサイズの取得
//	virtual CWorkspaceAccess GetResponseInfo();		//	5:レスポンス情報を取得
	virtual int GetNextData(CBuffer &data);			//	6:レスポンスの取得

	void FindAll(MSXML2::IXMLDOMDocumentPtr doc,MSXML2::IXMLDOMElementPtr res);
	void FindFiles(MSXML2::IXMLDOMDocumentPtr doc,MSXML2::IXMLDOMElementPtr res,CString url,CString path);
	void AddInfo(MSXML2::IXMLDOMDocumentPtr doc,MSXML2::IXMLDOMElementPtr res,CFileFind &find,CString url);
	void AddVolumeInfo(MSXML2::IXMLDOMDocumentPtr doc,MSXML2::IXMLDOMElementPtr res,CString volume,CString url);
	void AddAttr(MSXML2::IXMLDOMDocumentPtr doc,MSXML2::IXMLDOMElementPtr res,CString attr,CString text);

	CString EncodeUrl(CString url);

	CString	m_body;
};
