Esempio n. 1
0
KVNameValueList* KVAvailableRunsFile::RunHasFileWithDateAndName(Int_t run, const Char_t* filename, TDatime modtime, Int_t& OccNum)
{
   // look in previously read infos (see ReadFile) to see if, for a given run, there is a file with the
   // given name and modification date/time
   // if so, returns the address of the KVNameValueList for the run & sets OccNum to the index number of
   // the corresponding entry (in case of several files for the run)
   // if not, returns NULL
   
   if(!fAvailableRuns) return NULL;
   // is run already in list ?
   KVNameValueList* NVL = (KVNameValueList*)fAvailableRuns->FindObject(Form("%d",run));
   if(!NVL) return NULL;
   Int_t Occurs = NVL->GetIntValue("Occurs");
   for(OccNum=0; OccNum<Occurs; OccNum++){
      if( NVL->IsValue( Form("Filename[%d]",OccNum) , filename ) && NVL->IsValue( Form("Date[%d]",OccNum) , modtime.AsSQLString() ) ) return NVL;
   }
   return NULL;
}
Esempio n. 2
0
Bool_t KVAvailableRunsFile::InfosNeedUpdate(Int_t run, const Char_t * filename)
{
   // return kTRUE if the given file for this run is lacking some information
   // e.g. the KV version and username
   // N.B.: if no file is known for this run, we return kFALSE
   
   ReadFile();
   // is run already in list ?
   KVNameValueList* NVL = (KVNameValueList*)fAvailableRuns->FindObject(Form("%d",run));
   if(!NVL) return kFALSE;
   Int_t Occurs = NVL->GetIntValue("Occurs");
   for(Int_t OccNum=0; OccNum<Occurs; OccNum++){
      if( NVL->IsValue( Form("Filename[%d]",OccNum) , filename ) ){
         // infos need update if no KV version has been set
         return ( !NVL->HasParameter(Form("KVVersion[%d]",OccNum)) );
      }
   }
   return kFALSE;   
}