本文整理汇总了C++中ossimFilename::setExtension方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimFilename::setExtension方法的具体用法?C++ ossimFilename::setExtension怎么用?C++ ossimFilename::setExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimFilename
的用法示例。
在下文中一共展示了ossimFilename::setExtension方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findCoarseGrid
void ossimSensorModelFactory::findCoarseGrid(ossimFilename& result,
const ossimFilename& geomFile)const
{
result = geomFile;
result.setFile(result.fileNoExtension()+"_ocg");
result.setExtension("dat");
if(!result.exists())
{
result = geomFile;
result.setExtension("dat");
}
// let's find a .dat file in the current directory
//
if(!result.exists())
{
result = "";
ossimDirectory directoryList(geomFile.path());
ossimFilename file;
if(directoryList.getFirst(file,
ossimDirectory::OSSIM_DIR_FILES))
{
ossimString testString = "OSSIM_DBL_GRID";
char tempBuf[14];
do
{
if(file.ext().downcase() == "dat")
{
std::ifstream in(file.c_str());
if(in)
{
in.read((char*)tempBuf, 14);
in.close();
if(ossimString(tempBuf, tempBuf+14) == testString)
{
result = file;
}
}
}
}while((directoryList.getNext(file))&&(result == ""));
}
// try to find it
}
}
示例2: createRelativePath
void ossimSrtmElevationDatabase::createRelativePath(ossimFilename& file, const ossimGpt& gpt)const
{
int ilat = static_cast<int>(floor(gpt.latd()));
if (ilat < 0)
{
file = "S";
}
else
{
file = "N";
}
ilat = abs(ilat);
std::ostringstream os1;
os1 << std::setfill('0') << std::setw(2) <<ilat;
file += os1.str().c_str();
int ilon = static_cast<int>(floor(gpt.lond()));
if (ilon < 0)
{
file += "W";
}
else
{
file += "E";
}
ilon = abs(ilon);
std::ostringstream os2;
os2 << std::setfill('0') << std::setw(3) << ilon;
file += os2.str().c_str();
file.setExtension("hgt");
}