当前位置: 首页>>代码示例>>C++>>正文


C++ DDFSubfieldDefn::SetName方法代码示例

本文整理汇总了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 );
}
开发者ID:bbradbury,项目名称:lib_gdal,代码行数:10,代码来源:ddffielddefn.cpp

示例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;
}
开发者ID:bbradbury,项目名称:lib_gdal,代码行数:54,代码来源:ddffielddefn.cpp


注:本文中的DDFSubfieldDefn::SetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。