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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? page.cpp

?? Linux TSE 源代碼! 保貴十分
?? CPP
?? 第 1 頁 / 共 2 頁
字號(hào):
/*Page handling */#include <iostream>#include <string>#include <map>#include <vector>#include <iterator>#include "Url.h"#include "Page.h"#include "StrFun.h"CPage::CPage(){	m_nStatusCode = 0;	m_nContentLength = 0;	m_sLocation = "";	m_bConnectionState = false;	m_sContentEncoding = "";	m_sContentType = "";	m_sCharset = "";	m_sTransferEncoding = "";	m_sContentLinkInfo = "";        m_sLinkInfo4SE = "";        m_sLinkInfo4History = "";        m_sContentNoTags = "";	m_nRefLink4SENum = 0;	m_nRefLink4HistoryNum = 0;        m_eType = PLAIN_TEXT;	for(int i=0; i< MAX_URL_REFERENCES; i++ ){		m_RefLink4SE[i].link = NULL;		m_RefLink4SE[i].anchor_text = NULL;		m_RefLink4SE[i].strCharset = "";		if(i < MAX_URL_REFERENCES/2){			m_RefLink4History[i].link = NULL;		}	}}CPage::CPage( string strUrl, string strLocation, char* header, char* body, int nLenBody){	//assert( header != NULL );	//assert( body != NULL );	//assert( nLenBody > 0 );	// CPage();	m_nStatusCode = 0;	m_nContentLength = 0;	m_sLocation = "";	m_bConnectionState = false;	m_sContentEncoding = "";	m_sContentType = "";	m_sCharset = "";	m_sTransferEncoding = "";	m_sContentLinkInfo = "";        m_sLinkInfo4SE = "";        m_sLinkInfo4History = "";        m_sContentNoTags = "";	m_nRefLink4SENum = 0;	m_nRefLink4HistoryNum = 0;        m_eType = PLAIN_TEXT;	for(int i=0; i< MAX_URL_REFERENCES; i++ ){		m_RefLink4SE[i].link = NULL;		m_RefLink4SE[i].anchor_text = NULL;		m_RefLink4SE[i].strCharset = "";		if(i < MAX_URL_REFERENCES/2){			m_RefLink4History[i].link = NULL;		}	}	m_sUrl = strUrl;	m_sLocation = strLocation;	m_sHeader = header;	m_nLenHeader = strlen(header);	m_sContent.assign(body, nLenBody);	m_nLenContent = nLenBody;}CPage::~CPage(){}void CPage::ParseHeaderInfo(string strHeader){	GetStatusCode(strHeader);	GetContentLength(strHeader);	GetLocation(strHeader);	GetConnectionState(strHeader);        GetCharset(strHeader);        GetContentEncoding(strHeader);        GetContentType(strHeader);	GetTransferEncoding(strHeader);}void CPage::GetStatusCode(string headerBuf){	CStrFun::Str2Lower( headerBuf, headerBuf.length() );	char *charIndex = strstr(headerBuf.c_str(), "http/");	if (charIndex == NULL)	{		m_nStatusCode = -1;		return;	}	while(*charIndex != ' '){		charIndex++;	}	charIndex++;		int ret = sscanf(charIndex, "%i", &m_nStatusCode);	if (ret != 1)  m_nStatusCode = -1;}void CPage::GetContentLength(string headerBuf){	CStrFun::Str2Lower( headerBuf, headerBuf.length() );	char *charIndex = strstr(headerBuf.c_str(), "content-length");	if (charIndex == NULL) return;	while(*charIndex != ' '){		charIndex++;	}	charIndex++;		int ret = sscanf(charIndex, "%i", &m_nContentLength);	if (ret != 1)  m_nContentLength = -1;}void CPage::GetLocation(string headerBuf){	string::size_type pre_idx,idx;	const string delims("\r\n");	string strBuf =  headerBuf;	CStrFun::Str2Lower( headerBuf, headerBuf.length() );	idx = headerBuf.find("location:");	if (idx != string::npos)	{		pre_idx = idx + sizeof("location: ") -1;		idx = headerBuf.find_first_of(delims, pre_idx );		if (idx != string::npos)		{			//m_sLocation = headerBuf.substr(pre_idx, idx - pre_idx);			m_sLocation = strBuf.substr(pre_idx, idx - pre_idx);		}	}}void CPage::GetCharset(string headerBuf){	string::size_type pre_idx,idx;	const string delims(" \",;>");	CStrFun::Str2Lower(headerBuf, headerBuf.size());	idx = headerBuf.find("charset=");	if( idx != string::npos) {		m_sCharset = headerBuf.substr(idx + sizeof("charset=") -1);	}	headerBuf = m_sContent;	headerBuf = headerBuf.substr(0,2024) ;	CStrFun::Str2Lower( headerBuf, headerBuf.length() );	idx = headerBuf.find("charset=");	if (idx != string::npos)	{		pre_idx = idx + sizeof("charset=") -1;		idx = headerBuf.find_first_of(delims, pre_idx );		if(idx != string::npos){			m_sCharset = headerBuf.substr(pre_idx, idx - pre_idx);		}	}}void CPage::GetContentEncoding(string headerBuf){	string::size_type pre_idx,idx;	const string delims("\r\n");	CStrFun::Str2Lower( headerBuf, headerBuf.length() );	idx = headerBuf.find("content-encoding:");	if (idx != string::npos)	{		pre_idx = idx + sizeof("content-encoding: ") -1;		idx = headerBuf.find_first_of(delims, pre_idx );		if (idx != string::npos)		{			m_sContentEncoding = headerBuf.substr(pre_idx, idx - pre_idx);		}	}}void CPage::GetConnectionState(string headerBuf){	string::size_type pre_idx,idx;	const string delims(";\r\n");	CStrFun::Str2Lower( headerBuf, headerBuf.length() );	idx = headerBuf.find("connection:");	if (idx != string::npos)	{		pre_idx = idx + sizeof("connection: ") -1;		idx = headerBuf.find_first_of(delims, pre_idx );		if (idx != string::npos)		{			string str = headerBuf.substr(pre_idx, idx - pre_idx);			//cout << "Connection state: " << str << endl;			//if (str == "close") m_bConnectionState = false;			if (str == "keep-alive") m_bConnectionState = true;		}	}}void CPage::GetContentType(string headerBuf){	string::size_type pre_idx,idx;	const string delims(";\r\n");	CStrFun::Str2Lower( headerBuf, headerBuf.size() );	idx = headerBuf.find("content-type:");	if (idx != string::npos)	{		pre_idx = idx + sizeof("content-type: ") -1;		idx = headerBuf.find_first_of(delims, pre_idx );		if (idx != string::npos)		{			m_sContentType = headerBuf.substr(pre_idx, idx - pre_idx);		}	}}void CPage::GetTransferEncoding(string headerBuf){	string::size_type pre_idx,idx;	const string delims(";\r\n");	CStrFun::Str2Lower( headerBuf, headerBuf.size() );	idx = headerBuf.find("transfer-encoding:");	if ( idx != string::npos)	{		pre_idx = idx + sizeof("transfer-encoding: ") -1;		idx = headerBuf.find_first_of(delims, pre_idx );		if(idx != string::npos)		{			m_sTransferEncoding = headerBuf.substr(pre_idx, idx - pre_idx);		}	}}/* * Filter spam links * If it is, return ture; otherwise false */bool CPage::IsFilterLink(string plink){	if( plink.empty() ) return true;	if( plink.size() > URL_LEN ) return true;	string link = plink, tmp;	string::size_type idx = 0;		CStrFun::Str2Lower( link, link.length() );	// find two times following symbols, return false	tmp = link;	idx = tmp.find("?");	if( idx != string::npos ){		tmp = tmp.substr(idx+1);		idx = tmp.find("?");		if( idx != string::npos ) return true;	}	tmp = link;	idx = tmp.find("-");	if( idx != string::npos ){		tmp = tmp.substr(idx+1);		idx = tmp.find("+");		if( idx != string::npos ) return true;	}	tmp = link;	idx = tmp.find("&");	if( idx != string::npos ){		tmp = tmp.substr(idx+1);		idx = tmp.find("&");		if( idx != string::npos ) return true;	}	tmp = link;	idx = tmp.find("//");	if( idx != string::npos ){		tmp = tmp.substr(idx+1);		idx = tmp.find("//");		if( idx != string::npos ) return true;	}	tmp = link;	idx = tmp.find("http");	if( idx != string::npos ){		tmp = tmp.substr(idx+1);		idx = tmp.find("http");		if( idx != string::npos ) return true;	}	tmp = link;	idx = tmp.find("misc");	if( idx != string::npos ){		tmp = tmp.substr(idx+1);		idx = tmp.find("misc");		if( idx != string::npos ) return true;	}	tmp = link;	idx = tmp.find("ipb");	if( idx != string::npos ){		tmp = tmp.substr(idx+1);		idx = tmp.find("ipb");		if( idx != string::npos ) return true;	}	const char *filter_str[]={	"cgi-bin",	"htbin",	"linder",	"srs5",		"uin-cgi",  // robots.txt of http://www.expasy.org/	"uhtbin",	"snapshot",	"=+",		"=-",		"script",	"gate",		"search",	"clickfile",	"data/scop",	"names",	"staff/",	"enter",	"user",		"mail",	"pst?",	"find?",	"ccc?",		"fwd?",		"tcon?",	"&amp",	"counter?",	"forum",	"cgisirsi",	"{",		"}",	"proxy",	"login",	"00.pl?",	"sciserv.pl",	"sign.asp",	"<",		">",		"review.asp?",	"result.asp?",	"keyword",	"\"",		"'",		"php?s=",	"error",	"showdate",	"niceprot.pl?",	"volue.asp?id",	".css",		".asp?month",	"prot.pl?",	"msg.asp",	"register.asp", "database",	"reg.asp",	"qry?u",	"p?msg",	"tj_all.asp?page", ".plot.",	"comment.php",	"nicezyme.pl?",	"entr",		"compute-map?", "view-pdb?",	"list.cgi?",	"lists.cgi?",	"details.pl?",	"aligner?",	"raw.pl?",	"interface.pl?","memcp.php?",	"member.php?",	"post.php?",	"thread.php",	"bbs/",		"/bbs"	};	int filter_str_num = 75;		for(int i=0; i<filter_str_num; i++){		if( link.find(filter_str[i]) != string::npos)		return true;	}		return false;}/////////////////////////////// just for ImgSE// e.g: http://www.people.com.cn/GB/tupian/index.html// 	http://news.xinhuanet.com/photo/// 	http://photo.tom.com//////////////////////////////// comment previous one and open this one/*bool CPage::IsFilterLink(string plink){	if( plink.empty() ) return true;	if( plink.size() > URL_LEN ) return true;	return false;	string link = plink, tmp;	string::size_type idx = 0;		CStrFun::Str2Lower( link, link.length() );	const char *filter_str[]={		"tupian", "photo", "ttjstk"		};	int filter_str_num = 3;	CStrFun::Str2Lower( link, link.length() );	for(int i=0; i<filter_str_num; i++){		if( link.find(filter_str[i]) != string::npos)		return false;	}		return true;}*//******************************************************************* Function name: ParseHyperLinks** Input argv:**      --** Output argv:**      --** Return:        true: success        false: fail** Function Description:  Parse hyperlinks from the web page** Version: 1.0** Be careful:*****************************************************************/bool CPage::ParseHyperLinks(){	if( GetContentLinkInfo() == false ) return false;	if( m_sContentLinkInfo.empty() ) return false;	bool bFind4SE = false;	bool bFind4History = false;	if( GetLinkInfo4SE() ){		if( FindRefLink4SE() ) bFind4SE = true;	} 	if( GetLinkInfo4History() ){		if( FindRefLink4History() ) bFind4History = true;	}	if( !bFind4SE && !bFind4History ){		 return false;	}	//return   GetHref(m_sContentLinkInfo.c_str(), "href", m_listLink4SE);	return true;}/******************************************************************* Function name: GetContentLinkInfo** Input argv:**      --** Output argv:**      --** Return:        true: success        false: fail** Function Description:  Parse hyperlinks from the web page** Version: 1.0** Be careful:*****************************************************************/bool CPage::GetContentLinkInfo(){	if( m_sContent.empty() ) return false;		m_sContentLinkInfo = m_sContent;	string& s = m_sContentLinkInfo;	// transform all separation into one space character	//CStrFun::ReplaceStr(s, "\t", " ");	//CStrFun::ReplaceStr(s, "\r", " ");	//CStrFun::ReplaceStr(s, "\n", " ");	const string delims(" \t\r\n");	string::size_type idx=0, pre_idx;	while( (idx = s.find_first_of(delims, idx)) != string::npos ){		pre_idx = idx;		s.replace(idx,1,1,' ');		idx++;		while( (idx = s.find_first_of(delims, idx)) != string::npos ){			if( idx-pre_idx == 1 ){				s.erase(idx, 1);			} else {				break;			}		}		idx--;	}	// transform all "<br>" into one space character	CStrFun::ReplaceStr(s, "<br>", " ");	if( s.size() < 20 ) return false;	// Keep only <img ...>, <area ...>,<script ...> and <a href ...> tags.	string::size_type idxHref=0,idxArea=0,idxImg=0;	string dest;	do{		if( s.empty() ) break;		idxHref = CStrFun::FindCase(s, "href");		idxArea = CStrFun::FindCase(s, "<area");		idxImg = CStrFun::FindCase(s, "<img");		pre_idx = idxHref > idxArea? idxArea: idxHref;		pre_idx = idxImg > pre_idx? pre_idx: idxImg;		if( pre_idx == string::npos) break;		s = s.substr(pre_idx);		idx = s.find_first_of('<',1);		if( idx != string::npos ){			dest = dest + s.substr(0,idx);		}else{			break;		}		s = s.substr(idx);		idxHref=0; idxArea=0; idxImg=0;	}while(1);	s = dest;		/* erase all '\' character	 * too avoid the following situations:	 *      document.write("<A href=\"/~webg/refpaper/index.html\">t2</A>");	*/	CStrFun::EraseStr(s, "\\");	if( s.size() < 20 ) return false;	return true;}/******************************************************************* Function name: GetLinkInfo4SE()** Input argv:**      --  ** Output argv:**      --** Return:       true: success       false: fail** Function Description:  Get links for SE** Version: 1.0** Be careful:*****************************************************************/bool CPage::GetLinkInfo4SE(){	if( m_sContentLinkInfo.empty() ) return false;	m_sLinkInfo4SE = m_sContentLinkInfo;	string& s = m_sLinkInfo4SE; 	// Keep only <area ...>,and <a href ...> tags.	string::size_type idxHref=0,idxArea=0,		idx,pre_idx;	string dest;	do{		if( s.empty() ) break;		//idxHref = CStrFun::FindCase(s, "<a href");		idxHref = CStrFun::FindCase(s, "href");		idxArea = CStrFun::FindCase(s, "<area ");		pre_idx = idxHref > idxArea? idxArea: idxHref;		//pre_idx = idxHref;		if( pre_idx == string::npos) break;		s = s.substr(pre_idx);		idx = s.find_first_of('<',1);		if( !(s.length() < 4) ){			idxHref = CStrFun::FindCaseFrom(s, "href", 4);			idx = idx > idxHref ? idxHref: idx;		}		if( idx != string::npos ){			dest = dest + s.substr(0,idx);		}else if (idx == string::npos && pre_idx != string::npos){			dest = dest + s;			break;		}else{

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一卡二卡在线观看| 午夜久久久久久| 精品对白一区国产伦| 日韩一级免费观看| 日韩一区二区免费高清| 欧美亚洲国产bt| 成人激情午夜影院| av不卡在线播放| eeuss影院一区二区三区 | 91丝袜美女网| 成人精品视频一区二区三区| 懂色av一区二区在线播放| 高清beeg欧美| 99久久久久久| 欧美日韩综合一区| 69p69国产精品| 日韩午夜中文字幕| 久久九九久精品国产免费直播| 久久久综合激的五月天| 国产精品美女久久久久久久| 亚洲自拍偷拍网站| 免费一级欧美片在线观看| 国产精品一区二区x88av| 97se亚洲国产综合自在线| 欧美日韩亚洲国产综合| 精品国产乱码久久久久久闺蜜| 国产精品久久久久久久久图文区| 亚洲精品免费在线播放| 日本不卡免费在线视频| 成人免费看的视频| 欧美日韩亚洲丝袜制服| 久久精品欧美一区二区三区不卡 | 一区二区三区在线观看网站| 免费成人av在线播放| av午夜精品一区二区三区| 91麻豆精品国产自产在线| 国产精品久久久久影院老司| 日本美女一区二区三区视频| 成人激情综合网站| 欧美一区二区三区免费大片| 亚洲日本中文字幕区| 久久精品国产成人一区二区三区| 91热门视频在线观看| 日韩一级高清毛片| 一区二区三区不卡在线观看| 国产美女精品人人做人人爽 | 成人性生交大片免费| 欧美高清精品3d| 国产精品福利一区二区三区| 另类中文字幕网| 欧美日韩一二区| 一区二区三区四区高清精品免费观看 | 石原莉奈在线亚洲二区| 国产成人精品亚洲777人妖| 欧美电影影音先锋| 亚洲国产欧美在线| 91免费视频观看| 欧美激情在线一区二区三区| 国产一区二区三区免费看 | 亚洲精品欧美专区| 成人影视亚洲图片在线| 久久亚洲精品小早川怜子| 蜜桃一区二区三区四区| 欧美视频一区二区三区四区| 自拍偷拍亚洲综合| youjizz国产精品| 欧美激情一二三区| 国产成人午夜精品影院观看视频| 日韩欧美成人一区| 日本欧美在线观看| 欧美一区二区三区免费在线看| 亚洲高清中文字幕| 欧美日韩精品专区| 午夜精品福利一区二区三区蜜桃| 91蜜桃视频在线| 亚洲欧美在线视频观看| av一二三不卡影片| 亚洲卡通欧美制服中文| 日本韩国精品在线| 亚洲午夜av在线| 欧美精品一二三四| 日韩高清欧美激情| 日韩免费性生活视频播放| 久久精品国产澳门| 欧美精彩视频一区二区三区| 国产美女精品在线| 亚洲国产精品黑人久久久| 国产精品66部| 中文字幕亚洲电影| 在线观看av一区| 蜜臀99久久精品久久久久久软件| 精品国产一区二区三区不卡| 国产成人自拍高清视频在线免费播放| 欧美经典一区二区三区| 欧美在线视频日韩| 韩国毛片一区二区三区| 中文字幕二三区不卡| 欧美伊人久久久久久久久影院 | 久久综合久久综合九色| 成人激情电影免费在线观看| 亚洲尤物在线视频观看| 日韩一区二区三区高清免费看看| 国产一区二区三区不卡在线观看| 国产精品夫妻自拍| 欧美视频你懂的| 国产成人午夜片在线观看高清观看| 一区二区三区国产精华| 久久女同性恋中文字幕| 色丁香久综合在线久综合在线观看| 亚洲国产精品综合小说图片区| 久久婷婷国产综合精品青草| 97精品电影院| 国内精品久久久久影院一蜜桃| 亚洲欧美怡红院| 精品区一区二区| 欧美视频一区在线观看| 成人av在线影院| 久久av中文字幕片| 亚洲国产中文字幕在线视频综合 | 91丝袜呻吟高潮美腿白嫩在线观看| 天天综合天天综合色| 国产精品久久久久久久久搜平片 | 欧美专区亚洲专区| 国产精品一区一区三区| 日韩精品一级二级| 一区二区三区四区蜜桃| 国产欧美视频在线观看| 91精品国产综合久久婷婷香蕉| 91麻豆精品在线观看| 国产乱色国产精品免费视频| 亚洲成人精品一区| 一区二区不卡在线视频 午夜欧美不卡在 | 激情成人综合网| 亚洲成a人v欧美综合天堂下载 | 欧美色图免费看| 91在线观看地址| www.av亚洲| 白白色 亚洲乱淫| 成人av在线网| 不卡视频免费播放| 精品久久久久av影院| 亚洲精品国产一区二区三区四区在线| 国产一区中文字幕| 亚洲第一激情av| 一区二区三区在线观看动漫| 国产精品久久久久影院| 国产欧美一区二区精品忘忧草 | 国产一区二区福利视频| 日韩黄色在线观看| 亚洲专区一二三| 怡红院av一区二区三区| 91国产成人在线| 久久蜜桃一区二区| 国产在线精品一区二区不卡了 | 亚洲欧洲日韩在线| 亚洲成精国产精品女| 成人h精品动漫一区二区三区| 色就色 综合激情| 中文字幕国产一区| 久久av资源网| 日韩一区二区三区高清免费看看| 国产精品电影院| 国产.欧美.日韩| 久久九九99视频| 国产一区二区在线看| 日韩欧美激情在线| 久久国产剧场电影| 久久久三级国产网站| 精品一区二区三区在线观看国产| 亚洲国产成人午夜在线一区 | 国产精品美女久久久久久2018| 精品一二线国产| 久久色视频免费观看| 国产成人精品亚洲日本在线桃色| 国产清纯白嫩初高生在线观看91| 成人激情电影免费在线观看| 一区二区在线观看视频| 欧美精品日韩综合在线| 奇米色一区二区三区四区| 日韩欧美资源站| 成人免费视频视频在线观看免费| 国产精品第一页第二页第三页| 成人激情文学综合网| 亚洲欧美一区二区久久| 欧美肥妇毛茸茸| 韩国一区二区三区| 亚洲精品国产品国语在线app| 在线亚洲免费视频| 日本女人一区二区三区| 欧美日本精品一区二区三区| 日韩专区欧美专区| 成人黄页毛片网站| 国产精品国产成人国产三级| www.综合网.com| 亚洲一区在线视频| 91精品久久久久久蜜臀| 国产精品自产自拍| 亚洲综合在线免费观看| 欧美大胆人体bbbb| 在线免费观看视频一区|