本文整理汇总了C++中DDFRecord::SetSizeFieldPos方法的典型用法代码示例。如果您正苦于以下问题:C++ DDFRecord::SetSizeFieldPos方法的具体用法?C++ DDFRecord::SetSizeFieldPos怎么用?C++ DDFRecord::SetSizeFieldPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DDFRecord
的用法示例。
在下文中一共展示了DDFRecord::SetSizeFieldPos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
while( psSubIter != NULL )
{
if( psSubIter->eType == CXT_Element &&
strcmp(psSubIter->pszValue, "DDFSubfieldDefn") == 0 )
{
poFDefn->AddSubfield( CPLGetXMLValue(psSubIter, "name", ""),
CPLGetXMLValue(psSubIter, "format", "") );
}
psSubIter = psSubIter->psNext;
}
pszFormatControls = CPLGetXMLValue(psIter, "formatControls", NULL);
if( pszFormatControls )
poFDefn->SetFormatControls(pszFormatControls);
oModule.AddField( poFDefn );
}
else if( psIter->eType == CXT_Element &&
strcmp(psIter->pszValue, "DDFRecord") == 0 )
{
//const bool bFirstRecord = !bCreated;
if( !bCreated )
{
oModule.Create( pszOutFilename );
bCreated = TRUE;
}
DDFRecord *poRec = new DDFRecord( &oModule );
std::map<std::string, int> oMapField;
//if( !bFirstRecord )
// poRec->SetReuseHeader(atoi(CPLGetXMLValue(psIter, "reuseHeader", CPLSPrintf("%d", poRec->GetReuseHeader()))));
poRec->SetSizeFieldLength(atoi(CPLGetXMLValue(psIter, "_sizeFieldLength", CPLSPrintf("%d", poRec->GetSizeFieldLength()))));
poRec->SetSizeFieldPos(atoi(CPLGetXMLValue(psIter, "_sizeFieldPos", CPLSPrintf("%d", poRec->GetSizeFieldPos()))));
poRec->SetSizeFieldTag(atoi(CPLGetXMLValue(psIter, "_sizeFieldTag", CPLSPrintf("%d", poRec->GetSizeFieldTag()))));
CPLXMLNode* psSubIter = psIter->psChild;
while( psSubIter != NULL )
{
if( psSubIter->eType == CXT_Element &&
strcmp(psSubIter->pszValue, "DDFField") == 0 )
{
const char* pszFieldName = CPLGetXMLValue(psSubIter, "name", "");
DDFFieldDefn* poFieldDefn = oModule.FindFieldDefn( pszFieldName );
if( poFieldDefn == NULL )
{
fprintf(stderr, "Can't find field '%s'\n", pszFieldName );
exit(1);
}
int nFieldOcc = oMapField[pszFieldName];
oMapField[pszFieldName] ++ ;
DDFField *poField = poRec->AddField( poFieldDefn );
const char* pszValue = CPLGetXMLValue(psSubIter, "value", NULL);
if( pszValue != NULL && STARTS_WITH(pszValue, "0x") )
{
pszValue += 2;
int nDataLen = (int)strlen(pszValue) / 2;
char* pabyData = (char*) malloc(nDataLen);
for(int i=0;i<nDataLen;i++)
{
char c;
int nHigh, nLow;
c = pszValue[2*i];
if( c >= 'A' && c <= 'F' )