本文整理汇总了C++中GMLPropertyDefn::SetNullable方法的典型用法代码示例。如果您正苦于以下问题:C++ GMLPropertyDefn::SetNullable方法的具体用法?C++ GMLPropertyDefn::SetNullable怎么用?C++ GMLPropertyDefn::SetNullable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GMLPropertyDefn
的用法示例。
在下文中一共展示了GMLPropertyDefn::SetNullable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GMLParseFeatureType
//.........这里部分代码省略.........
nAttributeIndex ++;
continue;
}
else
{
gmlType = GMLPT_Untyped;
if ( ! LookForSimpleType(psSchemaNode, pszStrippedNSType,
&gmlType, &nWidth, &nPrecision) )
{
/* Too complex schema for us. Aborts parsing */
delete poClass;
return NULL;
}
}
if (pszElementName == NULL)
pszElementName = "unnamed";
const char* pszPropertyName = pszElementName;
if( gmlType == GMLPT_FeatureProperty )
{
pszPropertyName = CPLSPrintf("%s_href", pszElementName);
}
GMLPropertyDefn *poProp = new GMLPropertyDefn(
pszPropertyName, pszElementName );
if( pszMaxOccurs != NULL && strcmp(pszMaxOccurs, "1") != 0 )
gmlType = GetListTypeFromSingleType(gmlType);
poProp->SetType( gmlType );
poProp->SetWidth( nWidth );
poProp->SetPrecision( nPrecision );
poProp->SetNullable( bNullable );
if (poClass->AddProperty( poProp ) < 0)
delete poProp;
else
nAttributeIndex ++;
continue;
}
// For now we skip geometries .. fixup later.
CPLXMLNode* psSimpleType = CPLGetXMLNode( psAttrDef, "simpleType" );
if( psSimpleType == NULL )
{
const char* pszRef = CPLGetXMLValue( psAttrDef, "ref", NULL );
/* FME .xsd */
if (pszRef != NULL && STARTS_WITH(pszRef, "gml:"))
{
const AssocNameType* psIter = apsRefTypes;
while(psIter->pszName)
{
if (strncmp(pszRef + 4, psIter->pszName, strlen(psIter->pszName)) == 0)
{
if (poClass->GetGeometryPropertyCount() > 0)
{
OGRwkbGeometryType eNewType = psIter->eType;
OGRwkbGeometryType eOldType = (OGRwkbGeometryType)poClass->GetGeometryProperty(0)->GetType();
if ((eNewType == wkbMultiPoint && eOldType == wkbPoint) ||
(eNewType == wkbMultiLineString && eOldType == wkbLineString) ||
(eNewType == wkbMultiPolygon && eOldType == wkbPolygon))
{
poClass->GetGeometryProperty(0)->SetType(eNewType);
示例2: InitializeFromXML
//.........这里部分代码省略.........
SetExtents( CPLAtof(CPLGetXMLValue( psDSI, "ExtentXMin", "0.0" )),
CPLAtof(CPLGetXMLValue( psDSI, "ExtentXMax", "0.0" )),
CPLAtof(CPLGetXMLValue( psDSI, "ExtentYMin", "0.0" )),
CPLAtof(CPLGetXMLValue( psDSI, "ExtentYMax", "0.0" )) );
}
}
/* -------------------------------------------------------------------- */
/* Collect property definitions. */
/* -------------------------------------------------------------------- */
for( psThis = psRoot->psChild; psThis != NULL; psThis = psThis->psNext )
{
if( psThis->eType == CXT_Element &&
EQUAL(psThis->pszValue, "PropertyDefn") )
{
const char *pszName = CPLGetXMLValue( psThis, "Name", NULL );
const char *pszType = CPLGetXMLValue( psThis, "Type", "Untyped" );
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") )