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


C++ ossimFilename::c_str方法代码示例

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


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

示例1: open

ossimErrorCode ossimVpfDatabaseHeader::open(const ossimFilename& databaseHeaderTable)
{
    vpf_table_type tableTypeData;

    if( is_vpf_table( databaseHeaderTable.c_str() ) )
    {
        tableTypeData = vpf_open_table(databaseHeaderTable.c_str(),
                                       (storage_type)DISK,
                                       "rb",
                                       NULL);
        if(isDatabaseHeaderTable(tableTypeData))
        {

        }
        else
        {
            return ossimErrorCodes::OSSIM_ERROR;
        }
    }
    else
    {
        return ossimErrorCodes::OSSIM_ERROR;
    }

    return ossimErrorCodes::OSSIM_OK;
}
开发者ID:whztt07,项目名称:star_ossim,代码行数:26,代码来源:ossimVpfDatabaseHeader.cpp

示例2: openTable

bool ossimVpfTable::openTable(const ossimFilename& tableName)
{
   closeTable();

   if(is_vpf_table(const_cast<char*>(tableName.c_str())))
   {
      if(theTableInformation)
      {
         delete theTableInformation;
         theTableInformation = NULL;
      }
      theTableInformation = new vpf_table_type;
      memset(theTableInformation, 0, sizeof(vpf_table_type));

      theTableName = tableName;
      *theTableInformation = vpf_open_table(const_cast<char*>(tableName.c_str()),
                                            disk,
                                            "rb",
                                            NULL);
   }
   else
   {
      delete theTableInformation;
      theTableInformation = NULL;

      return false;
   }

   return true;
}
开发者ID:LucHermitte,项目名称:ossim,代码行数:30,代码来源:ossimVpfTable.cpp

示例3: open

bool ossimNitfInfo::open(const ossimFilename& file)
{
   bool result = false;
   
   std::string connectionString = file.c_str();
   std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
      createIstream( file.c_str(), std::ios_base::in|std::ios_base::binary);
   
   if ( str )
   {
      result = open(str, connectionString);
   }
   return result;
}
开发者ID:ossimlabs,项目名称:ossim,代码行数:14,代码来源:ossimNitfInfo.cpp

示例4: isErsLeader

bool ossimErsSarModel::isErsLeader(const ossimFilename& file) const
{
  std::ifstream candidate(file.c_str(), ios::in | ios::binary);
  char ersFileName[16];

  candidate.seekg(48);
  if (candidate.bad() || candidate.eof())
  {
    return false;
  }
  candidate.read(ersFileName, 16);
  if (candidate.bad() || candidate.eof())
  {
    return false;
  }
  candidate.close();

  ossimString ersString(ersFileName);

  if ((ersString.find("ERS") == 0)   &&
      (ersString.find(".SAR.") == 4) &&
      (ersString.find("LEAD") == 12))
  {
    return true;
  }
  else
  {
    return false;
  }

}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例5: openFile

bool ossimXmlDocument::openFile(const ossimFilename& filename)
{
   
   theFilename = filename;

   if(theFilename == "")
   {
      return false;
   }

   //
   // Open XML File:
   // Note: Opening text document binary to overcome an apparent windows bug.
   //
   ifstream xml_stream (filename.c_str(), ios::binary);
   if (!xml_stream)
   {
      if (traceDebug())
      {
         ossimNotify(ossimNotifyLevel_DEBUG)
            << "DEBUG: ossimXmlDocument::ossimXmlDocument\n"
            << "encountered opening file <" << filename << "> for "
            << "reading. Aborting..." << endl;
      }
      return false;
   }

   return read(xml_stream);
}
开发者ID:LucHermitte,项目名称:ossim,代码行数:29,代码来源:ossimXmlDocument.cpp

示例6:

std::shared_ptr<ossim::ifstream> ossimStreamFactoryRegistry::createIFStream(
   const ossimFilename& file, std::ios_base::openmode openMode) const
{
   std::shared_ptr<ossim::ifstream>result(0);
   
   for(ossim_uint32 idx = 0; ((idx < theFactoryList.size())&&(!result)); ++idx)
   {
      result = theFactoryList[idx]->createIFStream(file, openMode);
   }

   if(!result)
   {
      if(file.exists())
      {
         // there is a bug in gcc < 5.0 and we can't use constructors in the 
         // C++11 build.  Will refactor to do a new ifstream then use open
         //

         result = std::make_shared<ossim::ifstream>();
         result->open(file.c_str(), openMode);
         if(!result->is_open())
         {
            result.reset();
         }
      }
   }
   
   return result; 
   
}
开发者ID:ossimlabs,项目名称:ossim,代码行数:30,代码来源:ossimStreamFactoryRegistry.cpp

示例7: outputTemplateKeywordlist

void outputTemplateKeywordlist(const ossimFilename &templateFilename)
{
   ofstream out(templateFilename.c_str());

   out << "file1.filename: <full path and file name>" << endl
       << "file2.filename: <full path and file name>" << endl
       << "// :\n"
       << "// :\n"
       << "// fileN: <full path and file name to the Nth file in the list>" << endl
       << "\n// currently this option has been tested\n"
       << "// with ossimTiffWriter and ossimJpegWriter\n"
       << "// writer.type: ossimTiffWriter"            << endl
       << "// writer.filename: <full path to output file>"  << endl
       << "\n// Currently, the mosaic application supports\n"
       << "// SIMPLE mosaics (ie. no blending algorithms)\n"
       << "// BLEND  for maps or layers that you want to blend together\n"
       << "// FEATHER for applying a spatial feaher along overlapped regions\n"
       << "// mosaic.type: SIMPLE"                     << endl
       << "\n// product type and projection information" << endl
       << "// is optional.  It will use the first images"<<endl
       << "// geometry information instead." << endl
       << "// product.type: "        << endl
       << "// product.meters_per_pixel_y: "       << endl
       << "// product.meters_per_pixel_x: "       << endl
       << "// product.central_meridian:   " << endl
       << "// product.origin_latitude:"    << endl;

   ossimNotify(ossimNotifyLevel_NOTICE)
      << "Wrote file: " << templateFilename << std::endl;
}
开发者ID:loongfee,项目名称:ossim-svn,代码行数:30,代码来源:ossim-mosaic.cpp

示例8: ossimElevCellHandler

ossimDtedHandler::ossimDtedHandler(const ossimFilename& dted_file, bool memoryMapFlag)
   :
      ossimElevCellHandler(dted_file),
      m_fileStr(),
      m_numLonLines(0),
      m_numLatPoints(0),
      m_dtedRecordSizeInBytes(0),
      m_edition(),
      m_productLevel(),
      m_compilationDate(),
      m_offsetToFirstDataRecord(0),
      m_latSpacing(0.0),
      m_lonSpacing(0.0),
      m_swCornerPost(),
      m_swapBytesFlag(false)
{

   static const char MODULE[] = "ossimDtedHandler (Filename) Constructor";
   if (traceExec())
   {
      ossimNotify(ossimNotifyLevel_DEBUG)
         << "DEBUG " << MODULE <<": entering..." << std::endl;
   }
   
   m_swapBytesFlag = ossim::byteOrder() == OSSIM_LITTLE_ENDIAN ? true : false;
   //---
   //  Open the dted file for reading.
   //---
   if (!open(dted_file, memoryMapFlag))
   {
      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
      
      if (traceDebug())
      {
         ossimNotify(ossimNotifyLevel_FATAL)
            << "FATAL " << MODULE << ": "
            << "\nCould not open file:  " << dted_file.c_str()
            << "\nReturning..." << std::endl;
         ossimNotify(ossimNotifyLevel_DEBUG)
            << "DEBUG " << MODULE << ": returning with error..." << std::endl;
      }
      return;
   }
   else
   {
      if (traceDebug())
      {
         ossimNotify(ossimNotifyLevel_DEBUG)
            << "DEBUG " << MODULE <<": Loading dted file: " << dted_file
            << std::endl;
      }
   }

   // DTED is stored in big endian.
   if (traceExec())
   {
      ossimNotify(ossimNotifyLevel_DEBUG)
         << "DEBUG " << MODULE << ": returning..." << std::endl;
   }
}
开发者ID:star-labs,项目名称:star_ossim,代码行数:60,代码来源:ossimDtedHandler.cpp

示例9: writeDotRpfFiles

// Note: throws ossimException on error.
void ossimRpfUtil::writeDotRpfFiles( const ossimFilename& aDotTocFile,
                                     const ossimFilename& outputDir )
{
   static const char MODULE[] = "ossimRpfUtil::writeDotRpfFiles";

   if ( traceDebug() )
   {
      ossimNotify(ossimNotifyLevel_DEBUG)
         << MODULE << " entered..."
         << "\na.toc file:        " << aDotTocFile
         << "\noutput directory:  " << outputDir
         << "\n";
   }
   
   // Parse the a.toc file:
   ossimRefPtr<ossimRpfToc> toc = new ossimRpfToc();
   
   if ( toc->parseFile(aDotTocFile) != ossimErrorCodes::OSSIM_OK )
   {
      std::string e = MODULE;
      e += " ERROR:\nCould not open: ";
      e+= aDotTocFile.string();
      throw ossimException(e);
   }

   if ( outputDir.expand().exists() == false )
   {
      if ( !outputDir.createDirectory(true, 0775) )
      {
         std::string e = MODULE;
         e += " ERROR:\nCould not create directory: ";
         e+= outputDir.c_str();
         throw ossimException(e);
      }
   }

   //---
   // Go through the entries...
   //---
   ossim_uint32 entries = toc->getNumberOfEntries();
   for (ossim_uint32 entry = 0; entry < entries; ++entry)
   {
      const ossimRpfTocEntry* tocEntry = toc->getTocEntry(entry);
      if (tocEntry)
      {
         if ( tocEntry->isEmpty() == false )
         {
            writeDotRpfFile(toc.get(), tocEntry, outputDir, entry);
         }
      }
      else
      {
         std::string e = MODULE;
         e += " ERROR:  Null entry: ";
         e += ossimString::toString(entry).string();
         throw ossimException(e);
      }
   }
   
} // End: ossimRpfUtil::writeDotRpfFiles
开发者ID:LucHermitte,项目名称:ossim,代码行数:61,代码来源:ossimRpfUtil.cpp

示例10: parseFile

//*******************************************************************
// Private Method:
//*******************************************************************
bool ossimKeywordlist::parseFile(const ossimFilename& file,
                                 bool ignoreBinaryChars)
{
   std::ifstream is;
   is.open(file.c_str(), std::ios::in | std::ios::binary);

   if ( !is.is_open() )
   {
      // ESH 07/2008, Trac #234: OSSIM is case sensitive 
      // when using worldfile templates during ingest
      // -- If first you don't succeed with the user-specified
      // filename, try again with the results of a case insensitive search.
      ossimDirectory directory(file.path());
      ossimFilename filename(file.file());

      std::vector<ossimFilename> result;
      bool bSuccess = directory.findCaseInsensitiveEquivalents( filename, result );
      if ( bSuccess == true )
      {
         int numResults = (int)result.size();
         int i;
         for ( i=0; i<numResults && !is.is_open(); ++i )
         {
            is.open( result[i].c_str(), std::ios::in | std::ios::binary );
         }
      }

      if ( !is.is_open() )
      {
         if ( traceDebug() ) 
         {
            // report all errors that aren't existence problems.
            // we want to know about things like permissions, too many open files, etc.
            ossimNotify(ossimNotifyLevel_DEBUG)
            << "Error opening file: " << file.c_str() << std::endl;
         }
         return false;
      }
   }

   bool result = parseStream(is, ignoreBinaryChars);

   is.close();

   return result;
}
开发者ID:,项目名称:,代码行数:49,代码来源:

示例11: setLut

void ossimIndexToRgbLutFilter::setLut(const ossimFilename& file)
{
   theLutFile = file;
   if(file.exists())
   {
      ossimKeywordlist kwl(file.c_str());
      loadState(kwl);
   }
}
开发者ID:hunterfu,项目名称:ossim,代码行数:9,代码来源:ossimIndexToRgbLutFilter.cpp

示例12: setErrorStatus

ossimGeneralRasterElevHandler::ossimGeneralRasterElevHandler(const ossimFilename& file)
   :ossimElevCellHandler(file.c_str()),
    m_streamOpen(false)
{
   if(!open(file))
   {
      setErrorStatus();
   }
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例13: importHistogram

bool ossimMultiResLevelHistogram::importHistogram(const ossimFilename& file)
{
   if( file.fileSize() > 0 )
   {
      theHistogramFile = file;
      
      ifstream input(file.c_str());
      return importHistogram(input);
   }
   return false;
}
开发者ID:LucHermitte,项目名称:ossim,代码行数:11,代码来源:ossimMultiResLevelHistogram.cpp

示例14: displayImage

void ossimQtSingleImageWindow::displayImage(const ossimFilename& file)
{
    ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(file);
    if (!ih)
    {
        QString caption = "Sorry:";
        QString text = "Could not find the image handler for file:\n";
        text += file.c_str();
        QMessageBox::information( this,
                                  caption,
                                  text,
                                  QMessageBox::Ok );
        return;
    }

    if (ih->getNumberOfDecimationLevels() == 1)
    {
        QString caption("Question:");
        QString text = "Would you like to build reduced resolution data sets?\n";
        text += "Note:\n";
        text += "This can take some time depending on the size of your image.";
        text += "\nAlternatively use the command line application:  \"img2rr\"";

        int answer = QMessageBox::question( this,
                                            caption,
                                            text,
                                            QMessageBox::Yes,
                                            QMessageBox::No);
        if (answer == QMessageBox::Yes)
        {
            //---
            // We need to listen for the open overview signal to rebuild the
            // theResolutionLevelMenu.
            //---
            ih->addListener(this);
            buildOverViews( ih.get() );
        }
    }

    createImageChain( ih.get() );

    // Build the resolution level menu.
    buildResolutionLevelMenu();

    // Give it to the widget.
    theImageWidget->connectMyInputTo(theImageChain.get());
    theImageWidget->refresh();

    connectMyInputTo(theImageChain.get());
    QString caption = "iview : ";
    caption += file.file().c_str();
    setCaption(caption);
}
开发者ID:renyu310,项目名称:ossim-svn,代码行数:53,代码来源:ossimQtSingleImageWindow.cpp

示例15: get_elevation

void get_elevation(ossimFilename infile, ossimFilename outfile, ossimFilename elevationPath="D:\\workspace\\ossimdem")
{
	FILE *pfIn = fopen(infile.c_str(), "r+" );
	FILE *pfOut = fopen(outfile.c_str(), "w+");

	ossimElevManager* theElevManager = ossimElevManager::instance();
	theElevManager->loadElevationPath(elevationPath);
	int id;
	double L2Line, L2Sample;
	double Lon, Lat;
	double Hgt;
	int index = 1;
	while (EOF != fscanf(pfIn, "%d%lf%lf%lf%lf%lf", &id, &L2Line, &L2Sample, &Lon, &Lat, &Hgt))
	{
		//ossimGpt gpt(Lon, Lat, Hgt);
		ossimGpt gpt(Lat, Lon, Hgt);
		Hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(gpt);
		fprintf(pfOut, "%6d%20.9lf%20.9lf%20.9lf%20.9lf%20.9lf\n", index++, L2Line, L2Sample, Lon, Lat, Hgt);
	}
	fclose(pfIn);
	fclose(pfOut);
}
开发者ID:loongfee,项目名称:mylib,代码行数:22,代码来源:main.cpp


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