本文整理汇总了C++中ossimKeywordlist::getErrorStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimKeywordlist::getErrorStatus方法的具体用法?C++ ossimKeywordlist::getErrorStatus怎么用?C++ ossimKeywordlist::getErrorStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimKeywordlist
的用法示例。
在下文中一共展示了ossimKeywordlist::getErrorStatus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadState
bool ossimRangeDomeTileSource::loadState(const ossimKeywordlist& kwl, const char* prefix)
{
static const char MODULE[] = "ossimRangeDomeTileSource::loadState()";
theDecimationFactors.clear();
ossimImageHandler::loadState(kwl, prefix);
if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
{
ossimNotify(ossimNotifyLevel_WARN)<< MODULE
<< "WARNING: error detected in keyword list! State not load." << std::endl;
return false;
}
ossimDpt gsd;
ossimString value = kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_KW);
if (!value.empty())
gsd.x = value.toDouble();
value = kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_Y_KW);
if (!value.empty())
setGSD(value.toDouble());
// The rest of the state is established by opening the file:
bool good_open = open();
return good_open;
}
示例2: saveState
bool ossimRangeDomeTileSource::saveState(ossimKeywordlist& kwl, const char* prefix) const
{
static const char MODULE[] = "ossimRangeDomeTileSource::saveState()";
ossimImageHandler::saveState(kwl, prefix);
if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
{
ossimNotify(ossimNotifyLevel_WARN) << MODULE
<< " ERROR detected in keyword list! State not saved." << std::endl;
return false;
}
kwl.add(prefix, ossimKeywordNames::METERS_PER_PIXEL_KW, m_gsd.x, true);
return true;
}
示例3: loadState
bool ossimGeneralRasterInfo::loadState(const ossimKeywordlist& kwl, const char* prefix)
{
static const char MODULE[] = "ossimGeneralRasterInfo::loadState";
if ( traceDebug() )
{
CLOG << "DEBUG: entered..."
<< "\nprefix: " << (prefix ? prefix : "")
<< "\nInput keyword list:\n"
<< kwl
<< std::endl;
}
bool result = false;
//---
// Look for required and option keyword. Break from loop if required
// keyword is not found.
//---
while( 1 )
{
// Check for errors in the ossimKeywordlist.
if(kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
{
ossimNotify(ossimNotifyLevel_WARN)
<< MODULE << " ERROR:\n"
<< "Detected an error in the keywordlist: " << kwl
<< std::endl;
break;
}
std::string key;
ossimString value; // Use for keyword list lookups.
ossim_int32 lines = 0;
ossim_int32 samples = 0;
// Lines (required):
key = NUMBER_LINES;
value.string() = kwl.findKey( key ); // Required to have this.
if ( value.size() )
{
lines = value.toInt32();
if ( !lines )
{
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_WARN)
<< " ERROR:\n"
<< "Required number of lines is 0!" << std::endl;
}
break;
}
}
else
{
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_WARN)
<< " ERROR:\n"
<< "Required keyword not found: " << key << std::endl;
}
break;
}
// Samples (required):
key = NUMBER_SAMPLES;
value.string() = kwl.findKey( key ); // Required to have this.
if ( value.size() )
{
samples = value.toInt32();
if ( !samples )
{
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_WARN)
<< " ERROR:\n"
<< "Required number of samples is 0!" << std::endl;
}
break;
}
}
else
{
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_WARN)
<< " ERROR:\n"
<< "Required keyword not found: " << key << std::endl;
}
break;
}
// Bands ossimImageMetaData::loadState checks for required bands:
if(!theMetaData.loadState(kwl, prefix))
{
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_WARN)
<< " Error loading meta data!\n" << std::endl;
}
break;
//.........这里部分代码省略.........