当前位置: 首页>>代码示例>>C++>>正文


C++ TStrKdV::SearchForw方法代码示例

本文整理汇总了C++中TStrKdV::SearchForw方法的典型用法代码示例。如果您正苦于以下问题:C++ TStrKdV::SearchForw方法的具体用法?C++ TStrKdV::SearchForw怎么用?C++ TStrKdV::SearchForw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TStrKdV的用法示例。


在下文中一共展示了TStrKdV::SearchForw方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetFldValSet

void TSAppSrvFun::GetFldValSet(const TStrKdV& FldNmValPrV, const TStr& FldNm, TStrSet& FldValSet) {
	FldValSet.Clr();
	int ValN = FldNmValPrV.SearchForw(TStrKd(FldNm, ""));
	while (ValN != -1) {
		FldValSet.AddKey(FldNmValPrV[ValN].Dat);
		ValN = FldNmValPrV.SearchForw(TStrKd(FldNm, ""), ValN + 1);
	}
}
开发者ID:Austindeadhead,项目名称:qminer,代码行数:8,代码来源:sappsrv.cpp

示例2: IsFldNmVal

bool TSAppSrvFun::IsFldNmVal(const TStrKdV& FldNmValPrV, 
		const TStr& FldNm, const TStr& FldVal) {

	int ValN = FldNmValPrV.SearchForw(TStrKd(FldNm, ""));
	while (ValN != -1) {
		if (FldNmValPrV[ValN].Dat == FldVal) { return true; }
		ValN = FldNmValPrV.SearchForw(TStrKd(FldNm, ""), ValN + 1);
	}
	return false;
}
开发者ID:Austindeadhead,项目名称:qminer,代码行数:10,代码来源:sappsrv.cpp

示例3: IsFldNm

//////////////////////////////////////
// Simple-App-Server-Function
bool TSAppSrvFun::IsFldNm(const TStrKdV& FldNmValPrV, const TStr& FldNm) {
	const int ValN = FldNmValPrV.SearchForw(TStrKd(FldNm, ""));
	return (ValN != -1);
}
开发者ID:Austindeadhead,项目名称:qminer,代码行数:6,代码来源:sappsrv.cpp

示例4: GetFldVal

TStr TSAppSrvFun::GetFldVal(const TStrKdV& FldNmValPrV, 
		const TStr& FldNm, const TStr& DefFldVal) {

	const int ValN = FldNmValPrV.SearchForw(TStrKd(FldNm, ""));
	return (ValN == -1) ? DefFldVal : FldNmValPrV[ValN].Dat;	
}
开发者ID:Austindeadhead,项目名称:qminer,代码行数:6,代码来源:sappsrv.cpp

示例5: OnFetch

/////////////////////////////////////////////////
// EuProjects-Web-Fetch
void TCordisEuProjWebFetch::OnFetch(const int&, const PWebPg& WebPg){
  // print url of downloaded page
  printf("%s\n", WebPg->GetUrlStr().CStr());
  printf("-----------------------\n");
  //printf("%s", WebPg->GetHttpHdStr().CStr());
  //printf("%s", WebPg->GetHttpBodyAsStr().CStr());
  // get current page url & set of outgoing urls with descriptions
  TStr WebPgUrlStr=WebPg->GetUrlStr();
  TStrKdV DescUrlStrKdV; WebPg->GetOutDescUrlStrKdV(DescUrlStrKdV);
  // check current page type and react accordingly
  if (WebPgUrlStr.IsPrefix("http://dbs.cordis.lu/fep-cgi/srchidadb?ACTION=D&")){
    // if the page represents project description (ACTION=D)
    // save the document
    TStr HtmlStr=WebPg->GetHttpBodyAsStr();
    WebPgUrlStr.Save(*EuProjSOut);
    HtmlStr.Save(*EuProjSOut);
    EuProjSOut->Flush();
    int DescUrlStrKdN=DescUrlStrKdV.SearchForw(TStrKd("NEXT RECORD"));
    if (DescUrlStrKdN!=-1){
      // fetch next document
      FetchDocN++;
      FetchUrlStr=
       TStr("http://dbs.cordis.lu/fep-cgi/srchidadb?ACTION=D&SESSION=")+
       FetchSesIdStr+"&DOC="+TInt::GetStr(FetchDocN);
      FetchRetries=0;
      FetchUrl(FetchUrlStr);
    } else {
      printf("*** No forward pointer.\n");
      TSysMsg::Quit();
    }
    // search for forward pointer (to the next project description)
    /*int DescUrlStrKdN=DescUrlStrKdV.SearchForw(TStrKd("NEXT RECORD"));
    if (DescUrlStrKdN!=-1){
      // fetch next project description (usual, most frequent case)
      FetchUrlStr=DescUrlStrKdV[DescUrlStrKdN].Dat; FetchRetries=0;
      FetchUrl(FetchUrlStr);
    } else {
      // last project description doesn't include forward pointer
      printf("*** No forward pointer.\n");
      TSysMsg::Quit();
    }*/
  } else
  if (WebPgUrlStr.IsPrefix("http://dbs.cordis.lu/fep-cgi/srchidadb?ACTION=R&")){
    // if the page represents project record-set (ACTION=R)
    // take session id
    FetchSesIdStr=WebPgUrlStr.GetWcMatch("*SESSION=*&*", 1);
    FetchDocN=1;
    FetchUrlStr=
     TStr("http://dbs.cordis.lu/fep-cgi/srchidadb?ACTION=D&SESSION=")+
     FetchSesIdStr+"&DOC="+TInt::GetStr(FetchDocN);
    FetchRetries=0;
    FetchUrl(FetchUrlStr);
    // move to the first project-description-url (first record-set only)
    /*int DescUrlStrKdN=0;
    while (DescUrlStrKdN<DescUrlStrKdV.Len()){
      TStr UrlStr=DescUrlStrKdV[DescUrlStrKdN].Dat; DescUrlStrKdN++;
      if (UrlStr.IsPrefix("http://dbs.cordis.lu/fep-cgi/srchidadb?ACTION=D&")){
        // fetch first project-description only
        FetchUrl(UrlStr);
      }
    }
    if (DescUrlStrKdN>=DescUrlStrKdV.Len()){
      // quit downloading if no project descriptions
      printf("*** No project descriptions.\n");
      TSysMsg::Quit();
    }*/
    // fetch next index page
    /*int DescUrlStrKdN=DescUrlStrKdV.SearchForw(TStrKd("NEXT 20 RECORDS"));
    if (DescUrlStrKdN!=-1){
      FetchUrlStr=DescUrlStrKdV[DescUrlStrKdN].Dat;
      FetchRetries=0;
      FetchUrl(FetchUrlStr);
    } else {
      printf("*** No next 20 records.\n");
    }*/
  } else {
    // get forward pointer to the first project record-set (start only)
    int DescUrlStrKdN=DescUrlStrKdV.SearchForw(TStrKd("NEXT 20 RECORDS"));
    if (DescUrlStrKdN!=-1){
      FetchUrl(DescUrlStrKdV[DescUrlStrKdN].Dat);}
  }
}
开发者ID:AlertProject,项目名称:Text-processing-bundle,代码行数:84,代码来源:cordis.cpp


注:本文中的TStrKdV::SearchForw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。