本文整理汇总了C++中CMyString::ToInt方法的典型用法代码示例。如果您正苦于以下问题:C++ CMyString::ToInt方法的具体用法?C++ CMyString::ToInt怎么用?C++ CMyString::ToInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMyString
的用法示例。
在下文中一共展示了CMyString::ToInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
int CMyAsyncHttp::HttpGetStatusCode(HINTERNET request,int &code)
{
CMyString str;
code=0;
if(HttpQueryInfo(request,str,HTTP_QUERY_STATUS_CODE))
{
code=str.ToInt();
};
#ifdef _DEBUG
int d=::GetLastError();
if(d==ERROR_HTTP_HEADER_NOT_FOUND)
{
LOG(TAG,"HttpGetStatusCode,can't find the header!");
}
#endif
return 1;
}
示例2: ParseDate
bool CMailRecord::ParseDate(CMyString& value)
{
CMyString date;
CMyString splitTxt;
CMyString temp;
CMyTimeInterval interval;
int year=0,month=0,day=0,hour=0,minute=0,second=0;
if(value.Match(DATE_REGEX,&date,true)!=-1)
{
int count=date.Split(" ");
date.GetSplitString(1,splitTxt);
day=splitTxt.ToInt();
date.GetSplitString(2,splitTxt);
for(int i=1; i<=12; i++)
{
if(splitTxt.CompareI(CMyCalendar::sMonthS[i]))
{
month=i;
break;
}
}
date.GetSplitString(3,splitTxt);
year=splitTxt.ToInt();
date.GetSplitString(4,splitTxt);
splitTxt.Split(":");
splitTxt.GetSplitString(0,temp);
hour=temp.ToInt();
splitTxt.GetSplitString(1,temp);
minute=temp.ToInt();
splitTxt.GetSplitString(2,temp);
second=temp.ToInt();
m_Time=CMyTime(year,month,day,hour,minute,second);
if(count==6)
{
date.GetSplitString(5,splitTxt);
char tempBuf[3];
tempBuf[2]=0;
tempBuf[0]=splitTxt[1];
tempBuf[1]=splitTxt[2];
hour=atol(tempBuf);
tempBuf[0]=splitTxt[3];
tempBuf[1]=splitTxt[4];
minute=atol(tempBuf);
int totalSecond2=(hour*3600+minute*60)*(splitTxt[0]=='+'?1:-1);
int totalSecond1=8*3600;
int diff =totalSecond1-totalSecond2;
if(diff<0)
{
interval.SetSingal(false);
}
else
{
diff=-diff;
}
interval.SetDays(diff/(3600*24));
diff%=3600*24;
interval.SetHours(diff/3600);
diff%=60;
interval.SetMinutes(diff/60);
m_Time+=interval;
}
return true;
}
return false;
}