httprequestprocess.h

来自「一个c++实现的acd的例子。 ----ACDCommandListener.」· C头文件 代码 · 共 97 行

H
97
字号
#if !defined(HttpRequestProcess_H)
#define HttpRequestProcess_H

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

#include <string>
using namespace std;

//##ModelId=424BB6440249
class HttpRequestProcess
{
	//##ModelId=424BB644025A
	HttpRequest		_request;				// stores processed request info
	//##ModelId=424BB644026A
	HttpResponse	_resp;
	//##ModelId=424BB6440278
	long			_processState;			// state of processing 
	//##ModelId=424BB644027A
	string			_buffer;				// buffer to process
	//##ModelId=424BB6440288
	long			_length;				// length of buffer
	//##ModelId=424BB6440299
	string			_line;					// current process line

public:

	//##ModelId=424BB644029D
	HttpRequestProcess ();
	//##ModelId=424BB64402A7
	HttpRequestProcess ( LPTSTR buffer, long length );

	//##ModelId=424BB64402B7
	virtual ~HttpRequestProcess ();

	// create/release methods
	//##ModelId=424BB64402B9
	bool create  ( LPTSTR buffer, long length );
	//##ModelId=424BB64402C7
	void release ();

	// methods
	//##ModelId=424BB64402C8
	bool process		( LPTSTR buffer, long length );
	//##ModelId=424BB64402D7
	bool process		();
	//##ModelId=424BB64402D8
	bool getLine		( int & index );
	//##ModelId=424BB64402E7
	void processLine	();
	//##ModelId=424BB64402E8
	void addToBody		( int nBytes, int index );
	//##ModelId=424BB64402F7
	bool bodySent		();

	// access methods for http buffer
	//##ModelId=424BB64402F8
	HttpResponse & getResponse ()
	{
		return _resp;
	}

	//##ModelId=424BB6440305
	string getBody ()
	{
		return _resp.getBody();
	}

	//##ModelId=424BB6440306
	void getString ( string & set )
	{
		_resp.getString(set);
	}

	//##ModelId=424BB6440315
	LPTSTR data ()
	{
		return (LPTSTR) _resp.c_str();
	}

	//##ModelId=424BB6440316
	LPCTSTR c_str () 
	{
		return _resp.c_str();
	}

	//##ModelId=424BB6440317
	long size ()
	{
		return _resp.size();
	}


};

#endif

⌨️ 快捷键说明

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