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


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

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


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

示例1: 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

示例2: genlas

bool genlas(const ossimFilename& fname)
{
   cout << "Generating file <"<<fname<<">"<<endl;

   FauxReader reader;
   Options roptions;
   BOX3D bbox(-0.001, -0.001, -100.0, 0.001, 0.001, 100.0);
   roptions.add("bounds", bbox);
   roptions.add("num_points", 11);
   roptions.add("mode", "ramp");
   reader.setOptions(roptions);

   LasWriter writer;
   Options woptions;
   woptions.add("filename", fname.string());
   woptions.add("a_srs", "EPSG:4326"); // causes core dump when ossimInit::initialize() called on startup
   woptions.add("scale_x", 0.0000001);
   woptions.add("scale_y", 0.0000001);
   writer.setOptions(woptions);
   writer.setInput(reader);

   PointTable wtable;
   writer.prepare(wtable);
   writer.execute(wtable);

   return true;
}
开发者ID:bradh,项目名称:ossim-plugins,代码行数:27,代码来源:plugin-test.cpp

示例3: move

static void move( const ossimFilename& in, const ossimFilename& out )
{
#if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__)
   std::string moveCommand = "ren";
#else
   std::string moveCommand = "mv";
#endif

   std::string command = moveCommand;
   command += " ";
   command += in.string();
   command += " ";
   command += out.string();
   cout << "Executing " << command << endl;
   system(command.c_str());
}
开发者ID:BJangeofan,项目名称:ossim,代码行数:16,代码来源:ossim-prune.cpp

示例4: catch

bool ossimH5Info::open(const ossimFilename& file)
{
   bool result = false;

   // Check for empty filename.
   if (file.size())
   {
      try
      {
         //--
         // Turn off the auto-printing when failure occurs so that we can
         // handle the errors appropriately
         //---
         H5::Exception::dontPrint();
         
         if ( H5::H5File::isHdf5( file.string() ) )
         {
            m_file = file;
            result = true;
         }
      }
      catch( const H5::FileIException& error )
      {
         error.printError();
      }
      
      // catch failure caused by the DataSet operations
      catch( const H5::DataSetIException& error )
      {
         error.printError();
      }
      
      // catch failure caused by the DataSpace operations
      catch( const H5::DataSpaceIException& error )
      {
         error.printError();
      }
      
      // catch failure caused by the DataSpace operations
      catch( const H5::DataTypeIException& error )
      {
         error.printError();
      }
      catch( ... )
      {
         
      }
   }

   return result;
}
开发者ID:star-labs,项目名称:star_ossim,代码行数:51,代码来源:ossimH5Info.cpp

示例5: cmpFile

void cmpFile(const ossimFilename& wsa,
             const ossimFilename& wsb,
             const ossimFilename& file)
{
   ossimFilename bFile = file.substitute(wsa, wsb);

   if ( !file.exists() )
   {
      cout << "\nnotice: wsb file: " << bFile
           << "\nnotice: wsa file does not exists: " << file
           << "\nb -> a copy command:"
           << "\ncp " << bFile << " " << file << "\n"
           << endl;
   }
   if ( !bFile.exists() )
   {
      cout << "\nnotice: wsa file: " << file
           << "\nnotice: wsb file does not exists: " << bFile
           << "\na -> b copy command:"
           << "\ncp " << file << " " << bFile << "\n"
           << endl;
   }

   if ( file.exists() && bFile.exists() )
   {
      std::string command = "diff -w --ignore-matching-lines=\\$Id ";
      command += file.string();
      command += " ";
      command += bFile.string();
      
      int status = system( command.c_str() );
      
      if ( status != 0 )
      {
         cout << "\nnotice files differ:"
              << "\nwsa file: " << file
              << "\nwsb file: " << bFile
              << "\na -> b copy command:"
              << "\ncp " << file << " " << bFile
              << "\nb -> a copy command:"
              << "\ncp " << bFile << " " << file << "\n"
              << endl;
      }
   }
}
开发者ID:BJangeofan,项目名称:ossim,代码行数:45,代码来源:ossim-ws-cmp.cpp


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