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

📄 httprequestprocess.h

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

#include "HttpRequest.h"
#include "HttpResponse.h"

#include <string>
using namespace std;

class HttpRequestProcess
{
	HttpRequest		_request;				// stores processed request info
	HttpResponse	_resp;
	long			_processState;			// state of processing 
	string			_buffer;				// buffer to process
	long			_length;				// length of buffer
	string			_line;					// current process line

public:

	HttpRequestProcess ();
	HttpRequestProcess ( LPTSTR buffer, long length );

	virtual ~HttpRequestProcess ();

	// create/release methods
	bool create  ( LPTSTR buffer, long length );
	void release ();

	// methods
	bool process		( LPTSTR buffer, long length );
	bool process		();
	bool getLine		( int & index );
	void processLine	();
	void addToBody		( int nBytes, int index );
	bool bodySent		();

	// access methods for http buffer
	HttpResponse & getResponse ()
	{
		return _resp;
	}

	string getBody ()
	{
		return _resp.getBody();
	}

	void getString ( string & set )
	{
		_resp.getString(set);
	}

	LPTSTR data ()
	{
		return (LPTSTR) _resp.c_str();
	}

	LPCTSTR c_str () 
	{
		return _resp.c_str();
	}

	long size ()
	{
		return _resp.size();
	}


};

#endif

⌨️ 快捷键说明

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