⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 httpresponse.h

📁 该代码是将MSDN中的httpsvr MFC代码移植到STL。含有VC完整应用程序代码。
💻 H
字号:
#if !defined(HttpResponse_H)
#define HttpResponse_H


#include "HttpUtil.h"
#include "HttpRequest.h"
#include "HttpServerInfo.h"
#include "TextFile.h"


#include <string>
#include <iostream>
#include <sstream>
using namespace std;


#pragma warning( disable:4172 )


/////////////////////////////////////////////////////////////////////////////////////
// HttpResponse
//
// Purpose:	represent an http response

class HttpResponse :
	public HttpRequest
{
protected:

	//////////////////////////////////////////////////////////
	// http response format 
	//
	// Response Line Required
	// General Header Optional
	// Response Header Optional
	// Entity Header Optional
	// Entity Body Optional

	// static ref to server
	static HttpServerInfo * _server;

	// handle to file
	HANDLE			_hFile;				// handle to file associated with response
	TextFile		_file;				// file associated with response

public:

	HttpResponse ();
	HttpResponse ( HttpRequest & request );
	virtual ~HttpResponse ();

	// create/release
	bool create  ();
	void release ();

	// set static server ptr
	static setServer ( HttpServerInfo & server )
	{
		_server = &server;
	}


	// content add methods
	bool	startResponse	();
	bool	startServerApp	();
	bool	addHeading		();
	void	addTagetInfo	();
	void	addListing		();
	int		addListingFile	( WIN32_FIND_DATA * pfd, const string& strDir, bool bIcons );
	void	addContentType	();

};



#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -