本文整理汇总了C++中ArgParser::get方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgParser::get方法的具体用法?C++ ArgParser::get怎么用?C++ ArgParser::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgParser
的用法示例。
在下文中一共展示了ArgParser::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fun
void fun(ClientInfo *clientinfo,const char *b)
{
printf("Server:ENTER PROCESS______________________________\n");
string localfilename="../webpage";
Request req(b);
ResponseHeader httpheader;
ArgParser parser;
string affix;
string arg;
string filename;
char param[500];
if(req.method=="GET"||req.content!="")
{
if(req.method=="GET")
cout<<"(IP: "<<clientinfo->ip<<")"<<"Browser:GET "<<req.uri_full<<endl;
else if(req.content!="")
cout<<"(IP: "<<clientinfo->ip<<")"<<"Browser:POST "<<req.content<<endl;
//全请求
string fullfilename=req.uri_full;
//请求文件
filename=req.uri_name;
localfilename+="/";
localfilename+=filename;
//请求文件后缀
affix=req.uri_affix;
//请求参数
arg=req.uri_arg;
strcpy(param,arg.c_str());
//获得接口
if(req.content!="")
{
clientinfo->PostSpace=(char *)malloc(req.content.length()+3);
if(clientinfo->PostSpace==0)
cout<<endl<<"Server:PostSpace Allocate Error"<<endl;
memset(clientinfo->PostSpace,0,req.content.length()+3);
strcpy(clientinfo->PostSpace,req.content.c_str());
}
else
clientinfo->PostSpace=0;
parser.parse(arg.c_str());
string src=parser.get("srcpool");
string stobesent;
BYTE* btobesent;
Resource *presorce;
int ret;
WebInterface inter;
if(src!="")
{
cout<<"Server:Load Src"<<endl;
presorce=SerSourcePool[fullfilename];
if(presorce==0)
{
cout<<"Server:Load SRC ERR"<<endl;
return;
}
cout<<"Server:Load Over"<<endl;
//getchar();
if(presorce->obsolete==1||clientinfo->PostSpace)
{
inter.getEntry(localfilename);
cout<<"Server:Src Obosolete"<<endl;
// Webmain Webmain Webmain Webmain Webmain Webmain Webmain Webmain Webmain Webmain Webmain Webmain
ret=inter.webmain(clientinfo,param,filename);
if(ret==-1)
{
cout<<"Server:Load DLL Err"<<endl;
return ;
}
}
if(presorce->Type=="TEXT")
{
stobesent=SerSourcePool[fullfilename]->Text;
httpheader.settype(presorce->MimeType.c_str());
httpheader.setsize(stobesent.length());
httpheader.prepareheader();
//send send send send send send send send send send send send send send send send
send(clientinfo->clientsocket,httpheader.content.c_str(),httpheader.content.size(),0);
send(clientinfo->clientsocket,stobesent.c_str(),stobesent.length(),0);
clearClientInfo(clientinfo);
presorce->obsolete=1;
return ;
}
if(presorce->Type=="BIN")
{
// printf("SERIMAGEsize:%d,Ptr:%d\n",SerSourcePool[fullfilename]->BinL,SerSourcePool[fullfilename]->Bin);
btobesent= SerSourcePool[fullfilename]->Bin;
//.........这里部分代码省略.........