qaengine/src/ClientInterface.cxx
//--------------------------------------------------------------------------------
// Client wants to open specified build
//--------------------------------------------------------------------------------
Client wants to open specified build
Client wants to open specified build
int ClientInterface::command_OpenBuild(string& reply,int socket,string build,ScopeSet scope) {
string policyFileName  = m_ModelRoot+"/"+build+"/policy.xml";
string projectFileName = m_ModelRoot+"/"+build+"/project.xml";
string hitsFileName    = m_ModelRoot+"/"+build+"/hits.dat";
   TaskDriver* currentBuild = m_Clients[socket]->getActiveProject();
   m_Clients[socket]->setMode(NO_DELTA);
   reply = "";
   if(currentBuild->openPolicy(policyFileName)!=0) return -1;
   if(currentBuild->openHits(hitsFileName)!=0)     return -2;
   if(currentBuild->openProject(projectFileName)!=0) {
	   currentBuild->createProject(projectFileName);
   }
   int id = currentBuild->getRoot();
   char buf[100];
   sprintf(buf,"%d",id);
   reply = buf;
   reply+="\t";
   PropertiesMap map = currentBuild->getNodeProperties(id,scope);
   PropertiesMap::iterator i;
   for(i=map.begin();i!=map.end();i++) {
		reply+=i->first;
		reply+="\t";
		reply+=i->second;
		reply+="\t";
   }
   reply+="Hits";
   reply+="\t";
   sprintf(buf,"%d",currentBuild->getNodeHitsCount(id,scope));
   reply+=buf;
   return 0;
}
int ClientInterface :: command_OpenBuild ( string & reply , int socket , string build , ScopeSet scope ) { string policyFileName = m_ModelRoot + " " + build + " " ; string projectFileName = m_ModelRoot + " " + build + " " ; string hitsFileName = m_ModelRoot + " " + build + " " ; TaskDriver * currentBuild = m_Clients [ socket ] -> getActiveProject ( ) ; m_Clients [ socket ] -> setMode ( NO_DELTA ) ; reply = " " ; if ( currentBuild -> openPolicy ( policyFileName ) != 0 ) return -1 ; if ( currentBuild -> openHits ( hitsFileName ) != 0 ) return -2 ; if ( currentBuild -> openProject ( projectFileName ) != 0 ) { currentBuild -> createProject ( projectFileName ) ; } int id = currentBuild -> getRoot ( ) ; char buf [ 100 ] ; sprintf ( buf , " " , id ) ; reply = buf ; reply += " \t " ; PropertiesMap map = currentBuild -> getNodeProperties ( id , scope ) ; PropertiesMap :: iterator i ; for ( i = map . begin ( ) ; i != map . end ( ) ; i ++ ) { reply += i -> first ; reply += " \t " ; reply += i -> second ; reply += " \t " ; } reply += " " ; reply += " \t " ; sprintf ( buf , " " , currentBuild -> getNodeHitsCount ( id , scope ) ) ; reply += buf ; return 0 ; }
Client wants to open specified build
Client wants to open specified build