本文整理汇总了C++中DDFModule::GetVersionNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ DDFModule::GetVersionNumber方法的具体用法?C++ DDFModule::GetVersionNumber怎么用?C++ DDFModule::GetVersionNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DDFModule
的用法示例。
在下文中一共展示了DDFModule::GetVersionNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main( int nArgc, char ** papszArgv )
{
DDFModule oModule;
const char *pszFilename = NULL;
int bFSPTHack = FALSE;
int bXML = FALSE;
bool bAllDetails = false;
/* -------------------------------------------------------------------- */
/* Check arguments. */
/* -------------------------------------------------------------------- */
for( int iArg = 1; iArg < nArgc; iArg++ )
{
if( EQUAL(papszArgv[iArg],"-fspt_repeating") )
bFSPTHack = TRUE;
else if( EQUAL(papszArgv[iArg],"-xml") )
bXML = TRUE;
else if( EQUAL(papszArgv[iArg],"-xml_all_details") )
{
bXML = TRUE;
bAllDetails = true;
}
else
pszFilename = papszArgv[iArg];
}
if( pszFilename == NULL )
{
printf( "Usage: 8211dump [-xml|-xml_all_details] [-fspt_repeating] filename\n" );
exit( 1 );
}
/* -------------------------------------------------------------------- */
/* Open file. */
/* -------------------------------------------------------------------- */
if( !oModule.Open( pszFilename ) )
exit( 1 );
/* -------------------------------------------------------------------- */
/* Apply FSPT hack if required. */
/* -------------------------------------------------------------------- */
if( bFSPTHack )
{
DDFFieldDefn *poFSPT = oModule.FindFieldDefn( "FSPT" );
if( poFSPT == NULL )
fprintf( stderr,
"unable to find FSPT field to set repeating flag.\n" );
else
poFSPT->SetRepeatingFlag( TRUE );
}
/* -------------------------------------------------------------------- */
/* Dump header, and all records. */
/* -------------------------------------------------------------------- */
if( bXML )
{
printf("<DDFModule");
if( bAllDetails )
{
printf(" _interchangeLevel=\"%c\"", oModule.GetInterchangeLevel());
printf(" _leaderIden=\"%c\"", oModule.GetLeaderIden());
printf(" _inlineCodeExtensionIndicator=\"%c\"", oModule.GetCodeExtensionIndicator());
printf(" _versionNumber=\"%c\"", oModule.GetVersionNumber());
printf(" _appIndicator=\"%c\"", oModule.GetAppIndicator());
printf(" _extendedCharSet=\"%s\"", oModule.GetExtendedCharSet());
printf(" _fieldControlLength=\"%d\"", oModule.GetFieldControlLength());
printf(" _sizeFieldLength=\"%d\"", oModule.GetSizeFieldLength());
printf(" _sizeFieldPos=\"%d\"", oModule.GetSizeFieldPos());
printf(" _sizeFieldTag=\"%d\"", oModule.GetSizeFieldTag());
}
printf(">\n");
int nFieldDefnCount = oModule.GetFieldCount();
for( int i = 0; i < nFieldDefnCount; i++ )
{
DDFFieldDefn* poFieldDefn = oModule.GetField(i);
const char* pszDataStructCode = NULL;
switch( poFieldDefn->GetDataStructCode() )
{
case dsc_elementary:
pszDataStructCode = "elementary";
break;
case dsc_vector:
pszDataStructCode = "vector";
break;
case dsc_array:
pszDataStructCode = "array";
break;
case dsc_concatenated:
pszDataStructCode = "concatenated";
break;
default:
pszDataStructCode = "(unknown)";
break;
//.........这里部分代码省略.........