Exemplo n.º 1
0
bool ossimVpfDatabase::openDatabase(const ossimFilename& filename)
{
   bool result = true;

   ossimFilename tempFilename = filename;

   tempFilename.convertBackToForwardSlashes();

   // we should have two table to look at for the database.
   // 1) database header (dht) 2) and the Library attribute (lat)
   theDatabaseHeaderTable   = ossimFilename(tempFilename.path()).dirCat("/dht");
   theLibraryAttributeTable = ossimFilename(tempFilename.path()).dirCat("/lat");

   if(theDatabaseHeaderTable.exists() &&
      theLibraryAttributeTable.exists())
   {
      ossimVpfTable table;
      // now lets see if they are valid tables
      result = table.openTable(theDatabaseHeaderTable);
      
      if(result&&
         !ossimVpfDatabaseHeaderTableValidator().isValid(table))
      {
         result =  false;
      }
      
      result = table.openTable(theLibraryAttributeTable);
      if((result) &&!ossimVpfLibraryAttributeTableValidator().isValid(table))
      {
         result = false;
      }
   }
   else
   {
      result = false;
   }

   if(result)
   {
      theOpenedFlag = true;
      initializeLibraryList();
   }
   
   return result;
}
Exemplo n.º 2
0
bool rspfVpfDatabase::openDatabase(const rspfFilename& filename)
{
   bool result = true;
   rspfFilename tempFilename = filename;
   tempFilename.convertBackToForwardSlashes();
   theDatabaseHeaderTable   = rspfFilename(tempFilename.path()).dirCat("dht");
   theLibraryAttributeTable = rspfFilename(tempFilename.path()).dirCat("lat");
   if(theDatabaseHeaderTable.exists() &&
      theLibraryAttributeTable.exists())
   {
      rspfVpfTable table;
      result = table.openTable(theDatabaseHeaderTable);
      if(result&&
         !rspfVpfDatabaseHeaderTableValidator().isValid(table))
      {
         result =  false;
      }
      
      result = table.openTable(theLibraryAttributeTable);
      if((result) &&!rspfVpfLibraryAttributeTableValidator().isValid(table))
      {
         result = false;
      }
   }
   else
   {
      result = false;
   }
   if(result)
   {
      theOpenedFlag = true;
      initializeLibraryList();
   }
   
   return result;
}