本文整理汇总了C++中GMLPropertyDefn::SetCondition方法的典型用法代码示例。如果您正苦于以下问题:C++ GMLPropertyDefn::SetCondition方法的具体用法?C++ GMLPropertyDefn::SetCondition怎么用?C++ GMLPropertyDefn::SetCondition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GMLPropertyDefn
的用法示例。
在下文中一共展示了GMLPropertyDefn::SetCondition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitializeFromXML
//.........这里部分代码省略.........
const char *pszSubType = CPLGetXMLValue( psThis, "Subtype", "" );
const char *pszCondition = CPLGetXMLValue( psThis, "Condition", NULL );
int bNullable = CSLTestBoolean(CPLGetXMLValue( psThis, "Nullable", "true") );
GMLPropertyDefn *poPDefn;
if( pszName == NULL )
{
CPLError( CE_Failure, CPLE_AppDefined,
"GMLFeatureClass %s has a PropertyDefn without a <Name>..",
m_pszName );
return FALSE;
}
poPDefn = new GMLPropertyDefn(
pszName, CPLGetXMLValue( psThis, "ElementPath", NULL ) );
poPDefn->SetNullable(bNullable);
if( EQUAL(pszType,"Untyped") )
poPDefn->SetType( GMLPT_Untyped );
else if( EQUAL(pszType,"String") )
{
if( EQUAL(pszSubType, "Boolean") )
{
poPDefn->SetType( GMLPT_Boolean );
poPDefn->SetWidth( 1 );
}
else
{
poPDefn->SetType( GMLPT_String );
poPDefn->SetWidth( atoi( CPLGetXMLValue( psThis, "Width", "0" ) ) );
}
}
else if( EQUAL(pszType,"Integer") )
{
if( EQUAL(pszSubType, "Short") )
{
poPDefn->SetType( GMLPT_Short );
}
else if( EQUAL(pszSubType, "Integer64") )
{
poPDefn->SetType( GMLPT_Integer64 );
}
else
{
poPDefn->SetType( GMLPT_Integer );
}
poPDefn->SetWidth( atoi( CPLGetXMLValue( psThis, "Width", "0" ) ) );
}
else if( EQUAL(pszType,"Real") )
{
if( EQUAL(pszSubType, "Float") )
{
poPDefn->SetType( GMLPT_Float );
}
else
{
poPDefn->SetType( GMLPT_Real );
}
poPDefn->SetWidth( atoi( CPLGetXMLValue( psThis, "Width", "0" ) ) );
poPDefn->SetPrecision( atoi( CPLGetXMLValue( psThis, "Precision", "0" ) ) );
}
else if( EQUAL(pszType,"StringList") )
{
if( EQUAL(pszSubType, "Boolean") )
poPDefn->SetType( GMLPT_BooleanList );
else
poPDefn->SetType( GMLPT_StringList );
}
else if( EQUAL(pszType,"IntegerList") )
{
if( EQUAL(pszSubType, "Integer64") )
poPDefn->SetType( GMLPT_Integer64List );
else
poPDefn->SetType( GMLPT_IntegerList );
}
else if( EQUAL(pszType,"RealList") )
poPDefn->SetType( GMLPT_RealList );
else if( EQUAL(pszType,"Complex") )
poPDefn->SetType( GMLPT_Complex );
else if( EQUAL(pszType,"FeatureProperty") )
poPDefn->SetType( GMLPT_FeatureProperty );
else if( EQUAL(pszType,"FeaturePropertyList") )
poPDefn->SetType( GMLPT_FeaturePropertyList );
else
{
CPLError( CE_Failure, CPLE_AppDefined,
"Unrecognised property type %s.",
pszType );
delete poPDefn;
return FALSE;
}
if( pszCondition != NULL )
poPDefn->SetCondition(pszCondition);
AddProperty( poPDefn );
}
}
return TRUE;
}