本文整理汇总了C++中DDFSubfieldDefn::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ DDFSubfieldDefn::SetName方法的具体用法?C++ DDFSubfieldDefn::SetName怎么用?C++ DDFSubfieldDefn::SetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DDFSubfieldDefn
的用法示例。
在下文中一共展示了DDFSubfieldDefn::SetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddSubfield
void DDFFieldDefn::AddSubfield( const char *pszName,
const char *pszFormat )
{
DDFSubfieldDefn *poSFDefn = new DDFSubfieldDefn;
poSFDefn->SetName( pszName );
poSFDefn->SetFormat( pszFormat );
AddSubfield( poSFDefn );
}
示例2: BuildSubfields
int DDFFieldDefn::BuildSubfields()
{
char **papszSubfieldNames;
const char *pszSublist = _arrayDescr;
/* -------------------------------------------------------------------- */
/* It is valid to define a field with _arrayDesc */
/* '*STPT!CTPT!ENPT*YCOO!XCOO' and formatControls '(2b24)'. */
/* This basically indicates that there are 3 (YCOO,XCOO) */
/* structures named STPT, CTPT and ENPT. But we can't handle */
/* such a case gracefully here, so we just ignore the */
/* "structure names" and treat such a thing as a repeating */
/* YCOO/XCOO array. This occurs with the AR2D field of some */
/* AML S-57 files for instance. */
/* */
/* We accomplish this by ignoring everything before the last */
/* '*' in the subfield list. */
/* -------------------------------------------------------------------- */
if( strrchr(pszSublist, '*') != NULL )
pszSublist = strrchr(pszSublist,'*');
/* -------------------------------------------------------------------- */
/* Strip off the repeating marker, when it occurs, but mark our */
/* field as repeating. */
/* -------------------------------------------------------------------- */
if( pszSublist[0] == '*' )
{
bRepeatingSubfields = TRUE;
pszSublist++;
}
/* -------------------------------------------------------------------- */
/* split list of fields . */
/* -------------------------------------------------------------------- */
papszSubfieldNames = CSLTokenizeStringComplex( pszSublist, "!",
FALSE, FALSE );
/* -------------------------------------------------------------------- */
/* minimally initialize the subfields. More will be done later. */
/* -------------------------------------------------------------------- */
int nSFCount = CSLCount( papszSubfieldNames );
for( int iSF = 0; iSF < nSFCount; iSF++ )
{
DDFSubfieldDefn *poSFDefn = new DDFSubfieldDefn;
poSFDefn->SetName( papszSubfieldNames[iSF] );
AddSubfield( poSFDefn, TRUE );
}
CSLDestroy( papszSubfieldNames );
return TRUE;
}