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

📄 httpserverinfo.h

📁 一个c++实现的acd的例子。 ----ACDCommandListener.cpp ---ACDCommandListenerThread.cpp ---ACDConfig.cpp ---a
💻 H
字号:
// revise by leon [3/29/2005] for acdx logic

#if !defined(HttpServerInfo_H)
#define HttpServerInfo_H

#include "HttpRequest.h"
#include "HttpServerStats.h"
#include "HttpUtil.h"
#include "../acdx.h"

#include <string>
using namespace std;

///////////////////////////////////////////////////////////////////////////////////////
// HttpServerInfo
//
// Purpose:		http server information


//##ModelId=424BB6430382
class HttpServerInfo :
	public HttpServerStats
{
protected:

	//##ModelId=424BB6430385
	string					_strTitleBase;
	//##ModelId=424BB6430396
	string					_strRoot;
	//##ModelId=424BB64303A2
	string					_strServer;
	//##ModelId=424BB64303B2
	TimeStamp				_timeStarted;
	//##ModelId=424BB64303B6
	long					_port;
	//##ModelId=424BB64303C0
	int						_server;
	//##ModelId=424BB64303D0
	bool					_bListIcon;
	//##ModelId=424BB64303E0
	bool					_bAllowListing;

public:


	// set acdx point in HTTP server
	//##ModelId=424BB6440007
	ACDX* acdx;
	//##ModelId=424BB644000B
	setACDX(ACDX* _acdx)
	{
		acdx = _acdx;
	}

	//##ModelId=424BB6440017
	HttpServerInfo ( long port = PORT_HTTP );
	//##ModelId=424BB6440019
	virtual ~HttpServerInfo ();

	// create/release resources
	//##ModelId=424BB6440027
	bool create		( string & server, string & directory );
	//##ModelId=424BB6440036
	void release	();

	// access methods
	//##ModelId=424BB6440037
	string & getTitleBase ()
	{
		return _strTitleBase;
	}

	//##ModelId=424BB6440038
	string	getRoot ()
	{
		return _strRoot;
	}

	//##ModelId=424BB6440039
	string getServer ()
	{
		return _strServer;
	}


	//##ModelId=424BB6440046
	TimeStamp & getTimeStarted ()
	{
		return _timeStarted;
	}

	//##ModelId=424BB6440047
	long getPort ()
	{
		return _port;
	}

	//##ModelId=424BB6440048
	int	getServerIndex ()
	{
		return _server;
	}

	//##ModelId=424BB6440049
	bool getListIcon ()
	{
		return _bListIcon;
	}

	//##ModelId=424BB6440055
	bool getAllowListing ()
	{
		return _bAllowListing;
	}

	// utility methods
	//##ModelId=424BB6440056
	bool	urlToPath		( string & strFile );
	//##ModelId=424BB6440065
	bool	pathToUrl		( string & strFile );
	//##ModelId=424BB6440067
	string	stripLast		( string & strPath );
	//##ModelId=424BB6440076
	bool	find			( HttpRequest & request, string & strFile );
	//##ModelId=424BB6440085
	bool	checkDefault	( HttpRequest & request, LPTSTR uList, bool bExecute );
	//##ModelId=424BB6440095
	bool	isSeverApp		( HttpRequest & request );
	//##ModelId=424BB64400A4
	bool	checkExt		( HttpRequest & request, 
		                      const string & strExt, string & strAvail, 
							  DWORD dwType );



	// operators
	//##ModelId=424BB64400B5
	void operator = ( const HttpServerInfo & info )
	{
		_strTitleBase = info._strTitleBase;
		_strRoot = info._strRoot;
		_strServer = info._strServer;
		_timeStarted = info._timeStarted;
		_port = info._port;
		_server = info._server;
		_bListIcon = info._bListIcon;
		_bAllowListing = info._bAllowListing;
	}

};


#endif

⌨️ 快捷键说明

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