亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? myhttpclient.h

?? 自定義HttpClient類
?? H
?? 第 1 頁 / 共 5 頁
字號:
#pragma once

#include <windows.h>			// for generic types, .. etc
#include <wininet.h>			// for the windows internet functions
#include <crtdbg.h>				// for the _ASSERTE macro
#include <objbase.h>			// for ::CoCreateGuid

#include <utility>				// for the STL pair type
#include <map>					// for the STL multimap container
#include <vector>				// for the STL vector container

#include "MyException.h"		// for exception classes
#include "SafeInt.hpp"			// for the SaftInt class

#pragma warning (push)
#pragma warning (disable: 4290)	// avoids 'C++ Exception Specification ignored' message
#pragma warning (disable: 4996)	// avoids 'This function or variable may be unsafe' message

/*!
 * \brief	The namespace of the Ryeol's library
 *
 * This is the namespace for source codes written by Jo Hyeong-ryeol.
 */
namespace Ryeol {

///////////////////////////////////////// Global constant definitions /////////////////////////////////////////
/*!
 * \brief	Default flags used by the CHttpClient class to open a HTTP request
 * 
 * These flags are default flags used by the CHttpClient to open a HTTP request. These flags
 * are actually the dwFlags parameter of the ::HttpOpenRequest function of the WinInet API.
 * For more detailed information about this flags, see microsoft's SDK documentation.
 *
 * \sa CHttpClientT<HttpTool, HttpEncoder>::RequestGetEx
 * \sa CHttpClientT<HttpTool, HttpEncoder>::BeginPostEx
 * \sa CHttpClientT<HttpTool, HttpEncoder>::BeginUploadEx
 * \sa CHttpClientT<HttpTool, HttpEncoder>::RequestPostEx
 * \sa CHttpClientT<HttpTool, HttpEncoder>::RequestUploadEx
 */
enum HttpClientDefFlag
{
	HTTPCLIENT_DEF_REQUEST_FLAGS				= INTERNET_FLAG_HYPERLINK
												| INTERNET_FLAG_KEEP_CONNECTION
												| INTERNET_FLAG_NO_UI
												| INTERNET_FLAG_RESYNCHRONIZE
	//!< The default flag which causes the CHttpClient to use the cache if a cached copy exists.

	, HTTPCLIENT_DEF_REQUEST_FLAGS_NOCACHE		= INTERNET_FLAG_HYPERLINK
												| INTERNET_FLAG_KEEP_CONNECTION
												| INTERNET_FLAG_NO_UI
												| INTERNET_FLAG_RESYNCHRONIZE
												| INTERNET_FLAG_NO_CACHE_WRITE
												| INTERNET_FLAG_PRAGMA_NOCACHE
												| INTERNET_FLAG_RELOAD
	//!< The default flag which causes the CHttpClient not to use the cache.
} ;


/*!
 * \brief	These error codes represent the error occurred while processing an operation.
 * 
 * These error codes are custom error codes only for classes in this file.
 */
enum HttpClientErrorCode
{
	HTTPCLIENT_ERR_NOT_SPECIFIED						= 0		//!< Error was not occurred or not specified.

	// Normal error
	, HTTPCLIENT_ERR_UNEXPECTED_ERROR					= 100	//!< Unknown error occurred.
	, HTTPCLIENT_ERR_OUT_OF_RANGE						= 101	//!< The index is out of range.
	, HTTPCLIENT_ERR_OUT_OF_MEMORY						= 102	//!< The memory has been exhausted.
	, HTTPCLIENT_ERR_INVALID_URL						= 103	//!< The requested URL is not a valid URL.
	, HTTPCLIENT_ERR_POST_NOT_STARTED					= 104	//!< The post context is not started yet.
	, HTTPCLIENT_ERR_READ_UNEXPECTED_SIZE				= 105	//!< Couldn't read expected bytes from a file.
	, HTTPCLIENT_ERR_POST_NOT_FINISHED					= 106	//!< The post context has not been finished yet.
	, HTTPCLIENT_ERR_INTERNET_PORT_NOT_VALID			= 107	//!< The port number is not valid.
	, HTTPCLIENT_ERR_STD_EXCEPTION						= 108	//!< std::exception occurred.
	, HTTPCLIENT_ERR_ENCODED_URL_NOT_VALID				= 109	//!< The encoded URL is not valid.
	, HTTPCLIENT_ERR_INVALID_UTF8_CHARACTER				= 110	//!< The UTF8 string contains an invalid character.
	, HTTPCLIENT_ERR_UNEXPECTED_ARITHMETIC_ERROR		= 111	//!< An unexpected arithmetic error has been occurred.
	, HTTPCLIENT_ERR_ARITHMETIC_OVERFLOW				= 112	//!< An arithmetic overflow error has been occurred.
	, HTTPCLIENT_ERR_INT_DIVIDE_BY_ZERO					= 113	//!< An interger divide by zero exception has been occurred.
	, HTTPCLIENT_ERR_FILE_ALEADY_EXISTS					= 114	//!< A file aleady exists. So it doesn't overwrite it.


	// Normal error (which has a win32 error code) - Reserved


	// WinInet error (which has a win32 error code)
	, HTTPCLIENT_ERR_QUERYINFO_FAILED					= 400	//!< ::HttpQueryInfo failed.
	, HTTPCLIENT_ERR_INTERNETREADFILE_FAILED			= 401	//!< ::InternetReadFile failed.
	, HTTPCLIENT_ERR_INTERNETOPEN_FAILED				= 402	//!< ::InternetOpen failed.
	, HTTPCLIENT_ERR_INTERNETCONNECT_FAILED				= 403	//!< ::InternetConnect failed.
	, HTTPCLIENT_ERR_HTTPOPENREQUEST_FAILED				= 404	//!< ::HttpOpenRequest failed.
	, HTTPCLIENT_ERR_HTTPADDREQUESTHEADERS_FAILED		= 405	//!< ::HttpAddRequestHeaders failed.
	, HTTPCLIENT_ERR_HTTPSENDREQUEST_FAILED				= 406	//!< ::HttpSendRequest failed.
	, HTTPCLIENT_ERR_HTTPSENDREQUESTEX_FAILED			= 407	//!< ::HttpSendRequestEx failed.
	, HTTPCLIENT_ERR_INTERNETWRITEFILE_FAILED			= 408	//!< ::InternetWriteFile failed.
	, HTTPCLIENT_ERR_HTTPENDREQUEST_FAILED				= 409	//!< ::HttpEndRequest failed.
	, HTTPCLIENT_ERR_INTERNETSETOPTION_FAILED			= 410	//!< ::InternetSetOption failed.

	// Win32 API error (which has a win32 error code)
	, HTTPCLIENT_ERR_WIDECHARTOMULTIBYTE_FAILED			= 600	//!< ::WideCharToMultiByte failed.
	, HTTPCLIENT_ERR_MULTIBYTETOWIDECHAR_FAILED			= 601	//!< ::MultiByteToWideChar failed.
	, HTTPCLIENT_ERR_READFILE_FAILED					= 602	//!< ::ReadFile failed.
	, HTTPCLIENT_ERR_OPENFILE_FAILED					= 603	//!< OpenFile (::CreateFile) failed.
	, HTTPCLIENT_ERR_SETFILEPOINTER_FAILED				= 604	//!< ::SetFilePointer failed.
	, HTTPCLIENT_ERR_GETFILESIZE_FAILED					= 605	//!< ::GetFileSize failed.
	, HTTPCLIENT_ERR_WRITEFILE_FAILED					= 606	//!< ::WriteFile failed.

	// user-defined error
	, HTTPCLIENT_ERR_USER								= 1000	//!< Beginning of the user-defined error code.
																//! \nThe maximum value is HTTPCLIENT_ERR_USER + 99.
} ;

template <typename HttpTool, typename HttpEncoder> class CHttpClientT ;

///////////////////////////////////////// Global constant definitions /////////////////////////////////////////

///////////////////////////////////////// httpclientexception /////////////////////////////////////////
/*!
 * \brief	The standard exception class used by classes in this file. (Ansi Ver.)
 *
 * This class represents an exception occurred in HTTP client classes. All classes in this file
 * will throw this class when an error has been occurred.
 */
class httpclientexceptionA : public errmsg_exceptionA {
public:
	/*! \brief	Default constructor */
	httpclientexceptionA (void) throw () ;
	/*! \brief	Constructor with initial arguments */
	httpclientexceptionA (LPCSTR szErrMsg, DWORD dwLastError = HTTPCLIENT_ERR_NOT_SPECIFIED, DWORD dwWin32LastError = NO_ERROR) throw () ;

	/*! \brief	Returns last error code
	 *
	 * This error code represents the error occurred in classes of this file.
	 */
	inline DWORD LastError (void) const throw ()
	{
		return m_dwLastError ;
	}

	/*! \brief	Sets the last error code
	 *
	 * This error code represents the error occurred in classes of this file.
	 */
	inline void SetLastError (DWORD dwErrCode) throw ()
	{
		m_dwLastError = dwErrCode ;
	}

	/*! \brief	Returns last win32 error code
	 *
	 * Returns the last win32 error code retrieved by using ::GetLastError when an error occurred.
	 */
	inline DWORD Win32LastError (void) const throw ()
	{
		return m_dwWin32LastError ;
	}

	/*! \brief	Sets the last win32 error code
	 *
	 * This method sets the last win32 error code retrieved by using ::GetLastError.
	 */
	inline void SetWin32LastError (DWORD dwErrCode) throw ()
	{
		m_dwWin32LastError = dwErrCode ;
	}

private:
	DWORD			m_dwLastError ;			//!< The last error code.
	DWORD			m_dwWin32LastError ;	//!< The last win32 error code.
} ;

/*!
 * \brief	The standard exception class used by classes in this file. (Unicode Ver.)
 *
 * This class represents an exception occurred in HTTP client classes. All classes in this file
 * will throw this class when an error has been occurred.
 */
class httpclientexceptionW : public errmsg_exceptionW {
public:
	/*! \brief	Default constructor */
	httpclientexceptionW (void) throw () ;
	/*! \brief	Constructor with initial arguments */
	httpclientexceptionW (LPCWSTR szErrMsg, DWORD dwLastError = HTTPCLIENT_ERR_NOT_SPECIFIED, DWORD dwWin32LastError = NO_ERROR) throw () ;

	/*!
	 * \brief	Returns "httpclientexceptionW"
	 *
	 * This is not supported in Unicode version.
	 * It always returns "httpclientexceptionW".
	 *
	 * \return				"httpclientexceptionW"
	 */
	inline LPCSTR what (void) const throw ()
	{
		return "httpclientexceptionW" ;
	}

	/*! \brief	Returns last error code
	 *
	 * This error code represents the error occurred in classes of this file.
	 */
	inline DWORD LastError (void) const throw ()
	{
		return m_dwLastError ;
	}

	/*! \brief	Sets the last error code
	 *
	 * This error code represents the error occurred in classes of this file.
	 */
	inline void SetLastError (DWORD dwErrCode) throw ()
	{
		m_dwLastError = dwErrCode ;
	}

	/*! \brief	Returns last win32 error code
	 *
	 * Returns the last win32 error code retrieved by using ::GetLastError when an error occurred.
	 */
	inline DWORD Win32LastError (void) const throw ()
	{
		return m_dwWin32LastError ;
	}

	/*! \brief	Sets the last win32 error code
	 *
	 * This method sets the last win32 error code retrieved by using ::GetLastError.
	 */
	inline void SetWin32LastError (DWORD dwErrCode) throw ()
	{
		m_dwWin32LastError = dwErrCode ;
	}

private:
	DWORD			m_dwLastError ;			//!< The last error code.
	DWORD			m_dwWin32LastError ;	//!< The last win32 error code.
} ;

#ifdef UNICODE
	typedef httpclientexceptionW		httpclientexception ;
#else
	typedef httpclientexceptionA		httpclientexception ;
#endif

///////////////////////////////////////// httpclientexception /////////////////////////////////////////


///////////////////////////////////////// CHttpToolA /////////////////////////////////////////
/*!
 * \internal
 * \brief	This class contains utility methods. (Ansi Ver.)
 *
 * This class provides some utility methods and gives character type independence.
 * (Internal use only)
 */
class CHttpToolA
{
public:
	// Returns constant messages
	static inline LPCSTR GetConstMessage (DWORD nIdx) throw () ;

	// Methods related to the exception
	typedef	httpclientexceptionA			Exception ;
	static void ThrowException (DWORD nErrMsgIdx) throw (Exception &) ;
	static void ThrowException (LPCSTR szErrMsg, DWORD nErrMsgIdx = HTTPCLIENT_ERR_NOT_SPECIFIED) throw (Exception &) ;
	static void ThrowException (DWORD nErrMsgIdx, DWORD dwErrCode, LPCSTR szStrArg = NULL) throw (Exception &) ;
	static void ThrowException (LPCWSTR szErrMsg, DWORD nErrMsgIdx = HTTPCLIENT_ERR_NOT_SPECIFIED, DWORD dwErrCode = NO_ERROR) throw (Exception &) ;
	static void ThrowException (httpclientexceptionW & e) throw (Exception &) ;
	static void ThrowException (::SafeIntException & e) throw (Exception &) ;

	// String type definitions =======================================================
	typedef CHAR				CharType ;
	typedef LPSTR				PSZ ;
	typedef LPCSTR				PCSZ ;

	static inline BOOL IsAnsi (void) throw ()
	{
		return TRUE ;
	}

	// Wrapper methods for CRT string functions
	static inline size_t StringLen (LPCSTR szStr) throw ()
	{
		return ::strlen (szStr) ;
	}

	static inline LPSTR StringCopy (LPSTR szDest, LPCSTR szSrc) throw ()
	{
		return ::strcpy (szDest, szSrc) ;
	}

	static inline LPSTR StringCat (LPSTR szDest, LPCSTR szSrc) throw ()
	{
		return ::strcat (szDest, szSrc) ;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品成人一区二区三区四区| 久久色中文字幕| 国产精品一区二区三区乱码 | 欧美成人精品高清在线播放| www.亚洲人| 久久精品国产亚洲5555| 国产精品国产a| 精品久久人人做人人爽| 欧美军同video69gay| 91麻豆免费看| 成人午夜视频福利| 国产九色精品成人porny| 日韩国产精品久久| 亚洲无人区一区| 亚洲免费观看高清完整版在线观看| 精品国产乱码久久| 欧美一区二区在线播放| 欧美日韩中文国产| 在线观看视频一区二区欧美日韩| 岛国精品在线观看| 国产剧情一区在线| 狠狠色丁香婷婷综合| 免费观看30秒视频久久| 日韩在线a电影| 亚洲国产va精品久久久不卡综合| 亚洲免费观看高清完整版在线| 欧美国产精品中文字幕| 久久综合色播五月| 中文一区一区三区高中清不卡| 制服丝袜日韩国产| 在线精品视频免费播放| 日本乱码高清不卡字幕| 色综合久久久久综合体桃花网| 成人激情文学综合网| 国产成人在线观看| 岛国一区二区在线观看| 国产99精品国产| 国产精品亚洲专一区二区三区| 狠狠狠色丁香婷婷综合激情| 久久精品免费观看| 麻豆成人久久精品二区三区小说| 免费观看在线综合色| 久久99久久99| 九九九精品视频| 激情都市一区二区| 国产成人免费高清| 波多野洁衣一区| 97久久超碰国产精品| 97久久超碰国产精品| 在线国产电影不卡| 欧美日本在线看| 日韩午夜激情电影| 久久夜色精品国产噜噜av| 久久久久高清精品| 亚洲欧洲国产日韩| 亚洲一二三四久久| 男女视频一区二区| 国产成人精品影视| 99久久免费精品| 欧美三级电影网站| 精品少妇一区二区三区视频免付费 | 国产日韩欧美亚洲| 国产精品欧美一区二区三区| 亚洲免费观看高清完整版在线观看| 亚洲在线视频免费观看| 秋霞av亚洲一区二区三| 国产大片一区二区| 欧洲在线/亚洲| 欧美一区二区三区成人| 国产精品午夜在线| 日韩精品一级二级| 国产成人鲁色资源国产91色综| 99精品国产一区二区三区不卡| 欧美日韩国产精品成人| 久久青草欧美一区二区三区| 亚洲精品videosex极品| 美女视频黄 久久| 99久久国产综合色|国产精品| 欧美在线视频你懂得| 亚洲精品一区二区三区在线观看 | 国产 欧美在线| 在线观看视频欧美| 2024国产精品| 一级日本不卡的影视| 捆绑调教一区二区三区| 99精品视频在线播放观看| 欧美一区三区四区| 最新国产成人在线观看| 久久精品国产99国产精品| 色婷婷激情一区二区三区| 精品电影一区二区| 亚洲一区二区高清| 成人黄色软件下载| 精品国产99国产精品| 亚洲综合自拍偷拍| 粉嫩高潮美女一区二区三区 | 中文字幕在线不卡| 久久精品国产一区二区三区免费看| 色综合天天综合色综合av | 日韩一区二区三区视频| 亚洲色图视频网| 国产精华液一区二区三区| 在线播放亚洲一区| 亚洲猫色日本管| 国产成人亚洲综合a∨婷婷| 欧美高清hd18日本| 亚洲国产欧美另类丝袜| 成人精品电影在线观看| 久久这里都是精品| 日韩av成人高清| 欧美日韩视频专区在线播放| 国产精品动漫网站| 国产成人午夜电影网| 日韩欧美一二三四区| 亚洲va欧美va国产va天堂影院| 91猫先生在线| 中文字幕一区二区三区不卡在线 | 欧美日韩免费电影| 亚洲精品国产成人久久av盗摄 | 青草av.久久免费一区| 欧美亚洲一区二区在线观看| 亚洲欧美日韩人成在线播放| 成人国产亚洲欧美成人综合网 | 色哟哟在线观看一区二区三区| 国产人成亚洲第一网站在线播放| 极品销魂美女一区二区三区| 日韩一区二区在线观看视频 | 日韩一区二区三区av| 亚洲成人手机在线| 欧美午夜在线观看| 亚洲欧美成人一区二区三区| 99久久er热在这里只有精品66| 国产精品久久久久久久第一福利| 国产成人啪免费观看软件| 久久亚区不卡日本| 国产福利一区在线观看| 国产亚洲女人久久久久毛片| 狠狠色狠狠色合久久伊人| 久久综合色之久久综合| 国产91精品免费| 亚洲欧美在线视频| 日本久久电影网| 亚洲国产另类精品专区| 欧美伊人久久大香线蕉综合69| 亚洲国产精品久久一线不卡| 欧美精品三级日韩久久| 麻豆一区二区三| 久久久99免费| 成人三级伦理片| 亚洲欧美日韩久久| 欧美日韩一区成人| 免费视频最近日韩| 国产视频一区在线观看 | 99免费精品在线观看| 综合欧美一区二区三区| 欧美人与z0zoxxxx视频| 精品亚洲免费视频| 国产精品初高中害羞小美女文| 日本韩国精品一区二区在线观看| 亚洲成人7777| 久久久久久久久久久久久久久99 | 欧美精品在线观看播放| 另类专区欧美蜜桃臀第一页| 国产欧美一区视频| 在线观看免费成人| 久久99九九99精品| 亚洲欧美色一区| 欧美高清视频不卡网| 国产成人欧美日韩在线电影| 亚洲一区二区四区蜜桃| 2024国产精品| 日本久久电影网| 国产一区欧美二区| 亚洲综合激情小说| www亚洲一区| 在线观看亚洲成人| 国产美女精品一区二区三区| 亚洲三级在线看| 精品国免费一区二区三区| av在线不卡观看免费观看| 青椒成人免费视频| 亚洲精品国产无天堂网2021| 精品美女一区二区三区| 91成人免费在线视频| 激情五月婷婷综合| 亚洲妇女屁股眼交7| 国产日韩精品一区| 91精品国产全国免费观看| av在线一区二区| 国内精品国产成人国产三级粉色 | 亚洲一区二区三区四区五区中文 | 蜜桃视频第一区免费观看| 18成人在线视频| 精品国产乱码久久久久久夜甘婷婷| 在线观看视频一区| va亚洲va日韩不卡在线观看| 国内精品伊人久久久久av一坑| 亚洲午夜电影网| 最新国产の精品合集bt伙计| 久久免费偷拍视频|