本文整理汇总了C++中ossimFilename::ext方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimFilename::ext方法的具体用法?C++ ossimFilename::ext怎么用?C++ ossimFilename::ext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimFilename
的用法示例。
在下文中一共展示了ossimFilename::ext方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ossimNotify
bool ossimplugins::ossimRadarSat2TiffReader::open(const ossimFilename& file)
{
static const char MODULE[] = "ossimplugins::ossimRadarSat2TiffReader::open";
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " entered...\n"
<< "file: " << file << "\n";
}
bool result = false;
if ( isOpen() )
{
close();
}
// Check extension to see if it's xml.
if ( file.ext().downcase() == "xml" )
{
ossimXmlDocument* xdoc = new ossimXmlDocument();
if ( xdoc->openFile(file) )
{
// See if it's a TerraSAR-X product xml file.
if ( isRadarSat2ProductFile(xdoc) )
{
ossimString s;
ossimRadarSat2ProductDoc helper;
if ( helper.getImageFile(xdoc, s) )
{
ossimFilename imageFile = file.expand().path();
imageFile = imageFile.dirCat(s);
setFilename(imageFile);
result = ossimTiffTileSource::open();
if (result)
{
theProductXmlFile = file;
completeOpen();
}
}
}
}
delete xdoc;
xdoc = 0;
} // matches: if ( file.ext().downcase() == "xml" )
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " exit status = " << (result?"true":"false\n")
<< std::endl;
}
return result;
}
示例2: hasExcludedExtension
bool ossimGeoPdfReaderFactory::hasExcludedExtension(
const ossimFilename& file) const
{
bool result = true;
ossimString ext = file.ext().downcase();
if (ext == "pdf") //only include the file with .pdf extension and exclude any other files
{
result = false;
}
return result;
}
示例3: hasExcludedExtension
bool ossimHdfReaderFactory::hasExcludedExtension(
const ossimFilename& file) const
{
bool result = true;
ossimString ext = file.ext().downcase();
//only include the file with those extension and exclude any other files
if ( ext == "hdf" || ext == "h4" || ext == "hdf4" ||
ext == "he4" || ext == "hdf5" || ext == "he5" || ext == "h5" ||
ext == "l1r")
{
result = false;
}
return result;
}
示例4: hasExcludedExtension
bool ossimOpjReaderFactory::hasExcludedExtension( const ossimFilename& file) const
{
bool result = false;
ossimString ext = file.ext().downcase();
if ( (ext == "tif") ||
(ext == "tiff") ||
(ext == "jpg") ||
(ext == "jpeg") ||
(ext == "png") )
{
result = true;
}
return result;
}
示例5: open
bool ossimTileMapModel::open(const ossimFilename& file)
{
static const char MODULE[] = "ossimTileMapModel::open";
ossimString os = file.beforePos(4);
if (traceDebug())
{
CLOG << " Entered..." << std::endl
<< " trying to open file " << file << std::endl;
}
if(os == "http" || file.ext() == "otb")
{
return true;
}
return false;
}
示例6: if
ossimRefPtr<ossimNitfRsmModel> getModel( const ossimFilename& file )
{
ossimRefPtr<ossimNitfRsmModel> result = 0;
if ( file.size() )
{
// Get downcased extension:
std::string ext = file.ext().downcase().string();
if ( ext == "ext" )
{
result = getModelFromExtFile( file );
}
else if ( ( ext == "ntf" ) || ( ext == "nitf" ) )
{
result = getModelFromImage( file );
}
}
return result;
}
示例7: getImageHandlersBySuffix
ossimRefPtr<ossimImageHandler> ossimImageHandlerRegistry::openBySuffix(const ossimFilename& file,
bool openOverview)const
{
std::vector<ossimRefPtr<ossimImageHandler> > handlers;
getImageHandlersBySuffix(handlers, file.ext());
ossim_uint32 idx = 0;
ossim_uint32 size = (ossim_uint32) handlers.size();
for(idx = 0; idx < size; ++idx)
{
handlers[idx]->setOpenOverviewFlag(openOverview);
if(handlers[idx]->open(file))
{
return handlers[idx];
}
}
return ossimRefPtr<ossimImageHandler>(0);
}
示例8: isAuxFile
bool ossimAuxFileHandler::isAuxFile(const ossimFilename& file)
{
bool result = false;
if ( file.exists() )
{
ossimString ext = file.ext();
ext.downcase();
if (ext == "aux")
{
result = true;
}
else
{
result = false;
}
}
return result;
}
示例9: ossimXmlDocument
bool ossimplugins::ossimRadarSat2TiffReader::isRadarSat2ProductFile(
const ossimFilename& file) const
{
bool result = false;
// Check extension to see if it's xml.
if ( file.ext().downcase() == "xml" )
{
ossimXmlDocument* xdoc = new ossimXmlDocument();
if ( xdoc->openFile(file) )
{
result = isRadarSat2ProductFile(xdoc);
}
delete xdoc;
xdoc = 0;
}
return result;
}
示例10: initializeList
void ossimGeneralRasterElevHandler::initializeList(const ossimFilename& file)
{
close();
theFilename = file;
theBoundingRectInfoList.clear();
if(theFilename.exists())
{
if(theFilename.isDir())
{
ossimDirectory dir(theFilename);
ossimFilename file;
ossim_uint32 maxCount = 10;
ossim_uint32 count = 0;
bool foundOne = false;
if(dir.getFirst(file))
{
do
{
++count;
ossimString ext = file.ext();
ext = ext.downcase();
if(ext == "ras")
{
ossimGeneralRasterElevHandler::BoundingRectInfo info;
if(initializeInfo(info, file))
{
foundOne = true;
addInfo(info);
}
}
} while(dir.getNext(file) &&
(!foundOne &&
(count < maxCount)));
}
#if 0
std::vector<ossimFilename> result;
dir.findAllFilesThatMatch(result,
".*\\.ras");
if(result.size())
{
ossimGeneralRasterElevHandler::BoundingRectInfo info;
ossim_uint32 idx = 0;
for(idx = 0; idx < result.size(); ++idx)
{
if(initializeInfo(info, ossimFilename(result[idx])))
{
addInfo(info);
}
}
}
#endif
if(theBoundingRectInfoList.size()>0)
{
theNullHeightValue = theBoundingRectInfoList[0].theNullHeightValue;
}
}
else
{
ossimGeneralRasterElevHandler::BoundingRectInfo info;
if(initializeInfo(info, theFilename))
{
addInfo(info);
}
}
}
}
示例11: open
bool ossimHdfInfo::open(const ossimFilename& file)
{
static const char MODULE[] = "ossimHdfInfo::open";
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " entered...\n"
<< "file: " << file << "\n";
}
bool result = false;
ossimString ext = file.ext();
ext.downcase();
if ( ext == "hdf" || ext == "h4" || ext == "hdf4" ||
ext == "he4" || ext == "hdf5" || ext == "he5" || ext == "h5" ||
ext == "l1r")
{
m_metaInfos.clear();
m_bandVector.clear();
m_hdf4Reader = new ossimHdf4Reader;
m_hdf4Reader->setFilename(file);
if ( m_hdf4Reader->open() )
{
m_metaInfos = m_hdf4Reader->getGlobalMeta();
ossim_uint32 entryNum = m_hdf4Reader->getNumberOfEntries();
for (ossim_uint32 i = 0; i < entryNum; i++)
{
m_hdf4Reader->setCurrentEntry(i);
m_bandVector.push_back(m_hdf4Reader->getNumberOfOutputBands());
m_subMetaInfos[i] = m_hdf4Reader->getSubDatasetMeta();
}
m_driverName = "hdf4";
theFile = file;
result = true;
}
else
{
m_hdf4Reader = 0;
}
//try hdf5 reader
if (m_hdf4Reader == 0)
{
m_hdf5Reader = new ossimHdf5Reader;
m_hdf5Reader->setFilename(file);
if (m_hdf5Reader->open())
{
m_driverName = "hdf5";
m_metaInfos = m_hdf5Reader->getGlobalMeta();
ossim_uint32 entryNum = m_hdf5Reader->getNumberOfEntries();
for (ossim_uint32 i = 0; i < entryNum; i++)
{
m_hdf5Reader->setCurrentEntry(i);
m_bandVector.push_back(m_hdf5Reader->getNumberOfOutputBands());
m_subMetaInfos[i] = m_hdf5Reader->getSubDatasetMeta();
}
theFile = file;
result = true;
}
}
}
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " exit status = " << (result?"true\n":"false\n");
}
return result;
}
示例12: isIgnoredFile
bool isIgnoredFile(const ossimFilename& file)
{
bool status = false;
if (trace)
{
cout << "file: " << file << endl;
}
if ( file.size() )
{
ossimFilename f = file.file();
ossimFilename e = file.ext();
if ( ( f == ".moc" ) ||
( f == ".svn" ) ||
( f == "CMakeCache.txt" ) ||
( f == "CMakeFiles" ) ||
( f == "cmake_install.cmake" ) ||
( f == "cmake_uninstall.cmake" ) ||
( f == "CVS" ) ||
( f == "doc" ) ||
( f == ".cvsignore" ) ||
( f == "bin" ) ||
( f == "build" ) ||
( f == "builds" ) ||
( f == "configure") ||
( f == "config.log" ) ||
( f == "config.status") ||
( f == "lib" ) ||
( f == "Makefile" ) ||
( f == "Makefile.common" ) ||
( f == "make.out" ) ||
( f == "projects") ||
( f == "wxmac.icns") ||
( f == "xcode" ) ||
( e == "d" ) || // dot d file
( e == "o" ) || // object file
( e == "obj" ) ||
( e == "exe" ) ||
( e == "tmp" )
)
{
status = true;
}
else if ( file.contains("apps") || file.contains("test") )
{
if ( file.isDir() ) // Go into apps and test dir.
{
status = false;
}
else if ( (e != "h") && (e != "cpp") )
{
// Ignore binary files. Only diff headers and source files.
status = true;
}
}
if ( file[file.size()-1] == '~' )
{
status = true; // xemacs
}
} // if ( file.size() )
else
{
status = true; // empty
}
if ( trace && (status == true) )
{
cout << "ignoring file: " << file << endl;
}
return status;
}