本文整理汇总了C++中CMyString::GetBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ CMyString::GetBuffer方法的具体用法?C++ CMyString::GetBuffer怎么用?C++ CMyString::GetBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMyString
的用法示例。
在下文中一共展示了CMyString::GetBuffer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HttpQueryInfo
int CMyAsyncHttp::HttpQueryInfo(HINTERNET request,CMyString &info,int code)
{
unsigned long rl=0;
::HttpQueryInfo(request,code,NULL,&rl,0);
if(rl>0)
{
info.Resize(rl+1);
return ::HttpQueryInfo(request,code,info.GetBuffer(),&rl,0);
}
return false;
}
示例2: FileProcess
virtual void FileProcess(const char *parentUrl,const char* url,const char* fileData,int dataLen)
{
CMyString lUrl=(char*)url;
CMyString path=CUrl::GetUrlPath(lUrl);
CMyString name=CUrl::GetFileName(lUrl);
if(path!=""&&name!="")
{
GetDirName(path);
m_TempStr=m_FilePath+m_TempStr;
CMyFile::CreateDir(m_TempStr.GetBuffer());
m_TempStr+="\\"+name;
}
}
示例3: HttpGetCharset
int CMyAsyncHttp::HttpGetCharset(HINTERNET request,CMyString &charset)
{
CMyString str;
if(HttpQueryInfo(request,str,HTTP_QUERY_CONTENT_TYPE))
{
char *p=str.GetBuffer();
p=strstr(p,"charset=");
if(p)charset=p+8;
return 1;
}
#ifdef _DEBUG
int d=::GetLastError();
if(d==ERROR_HTTP_HEADER_NOT_FOUND)
{
LOG(TAG,"HttpGetCharset,can't find the header!");
}
#endif
return 1;
}
示例4: AnalysisData
void SpiderThread::AnalysisData(SpiderHttp* spiderHttp)
{
CMyString url;
CMyString host;
bool haveUrl=true;
if(spiderHttp->IsTxtPage())
{
if(!InitalFetchEngine(spiderHttp->GetReceiveData(),spiderHttp->GetReceiveDataLen()))
haveUrl=false;
while(haveUrl)
{
int urlCount=m_InterfaceConfig.m_FetchUrl->FetchUrl(m_CurrentP,m_Regex.GetMatchStrLen(),m_SameRegex);
for(int i=0;i<urlCount;i++)
{
url =*(m_InterfaceConfig.m_FetchUrl->GetUrl(i));
if(url=="./")continue;
ReBuildUrlIfNeed(spiderHttp->m_Url,url,host);
if(HaveAcess(host,url))continue;
for(int i=0;i<m_InterfaceConfig.m_UrlFilterList.size();i++)
{
if(!m_InterfaceConfig.m_UrlFilterList[i]->FilterCheck(spiderHttp->m_Url.GetBuffer(),url.GetBuffer()))break;
}
if(i<m_InterfaceConfig.m_UrlFilterList.size())continue;
if(m_InterfaceConfig.m_UrlModify)
{
m_InterfaceConfig.m_UrlModify->ModifyUrl(spiderHttp->m_Url.GetBuffer(),url);
}
AddHashMap(host,url);
AddTempUrlList(url);
}
if(!FetchUrl(url))break;
}
if(m_InterfaceConfig.m_PageProcess)
{
m_InterfaceConfig.m_PageProcess->PageProcess(spiderHttp->m_ParentUrl.GetBuffer(),spiderHttp->m_Url.GetBuffer(),spiderHttp->GetReceiveData(),spiderHttp->GetReceiveDataLen());
}
if(m_UrlCmp)
{
SortTempUrlList();
}
//根据深度优先还是广度优先进行抓取
AddAllUrlToUrlList(spiderHttp->m_Url);
}
else if(m_InterfaceConfig.m_FileProcess)
{
m_InterfaceConfig.m_FileProcess->FileProcess(spiderHttp->m_ParentUrl.GetBuffer(),spiderHttp->m_Url.GetBuffer(),spiderHttp->GetReceiveData(),spiderHttp->GetReceiveDataLen());
}
}