int HFAEntry::GetFieldCount( const char * pszFieldPath, CPLErr *peErr ) { HFAEntry *poEntry = this; /* -------------------------------------------------------------------- */ /* Is there a node path in this string? */ /* -------------------------------------------------------------------- */ if( strchr(pszFieldPath,':') != NULL ) { poEntry = GetNamedChild( pszFieldPath ); if( poEntry == NULL ) return -1; pszFieldPath = strchr(pszFieldPath,':') + 1; } /* -------------------------------------------------------------------- */ /* Do we have the data and type for this node? */ /* -------------------------------------------------------------------- */ LoadData(); if( pabyData == NULL ) return -1; if( poType == NULL ) return -1; /* -------------------------------------------------------------------- */ /* Extract the instance information. */ /* -------------------------------------------------------------------- */ return( poType->GetInstCount( pszFieldPath, pabyData, nDataPos, nDataSize ) ); }
JBoolean JNamedTreeNode::FindNamedChild ( const JCharacter* name, const JNamedTreeNode** node ) const { const JSize count = GetChildCount(); for (JIndex i=1; i<=count; i++) { *node = GetNamedChild(i); if ((**node).GetName() == name) { return kJTrue; } } *node = NULL; return kJFalse; }
CPLErr HFAEntry::SetFieldValue( const char * pszFieldPath, char chReqType, void *pValue ) { HFAEntry *poEntry = this; /* -------------------------------------------------------------------- */ /* Is there a node path in this string? */ /* -------------------------------------------------------------------- */ if( strchr(pszFieldPath,':') != NULL ) { poEntry = GetNamedChild( pszFieldPath ); if( poEntry == NULL ) return CE_Failure; pszFieldPath = strchr(pszFieldPath,':') + 1; } /* -------------------------------------------------------------------- */ /* Do we have the data and type for this node? Try loading */ /* from a file, or instantiating a new node. */ /* -------------------------------------------------------------------- */ LoadData(); if( MakeData() == NULL || pabyData == NULL || poType == NULL ) { CPLAssert( FALSE ); return CE_Failure; } /* -------------------------------------------------------------------- */ /* Extract the instance information. */ /* -------------------------------------------------------------------- */ MarkDirty(); return( poType->SetInstValue( pszFieldPath, pabyData, nDataPos, nDataSize, chReqType, pValue ) ); }
int HFAEntry::GetFieldValue( const char * pszFieldPath, char chReqType, void *pReqReturn, int *pnRemainingDataSize) { HFAEntry *poEntry = this; /* -------------------------------------------------------------------- */ /* Is there a node path in this string? */ /* -------------------------------------------------------------------- */ if( strchr(pszFieldPath,':') != NULL ) { poEntry = GetNamedChild( pszFieldPath ); if( poEntry == NULL ) return FALSE; pszFieldPath = strchr(pszFieldPath,':') + 1; } /* -------------------------------------------------------------------- */ /* Do we have the data and type for this node? */ /* -------------------------------------------------------------------- */ LoadData(); if( pabyData == NULL ) return FALSE; if( poType == NULL ) return FALSE; /* -------------------------------------------------------------------- */ /* Extract the instance information. */ /* -------------------------------------------------------------------- */ return( poType->ExtractInstValue( pszFieldPath, pabyData, nDataPos, nDataSize, chReqType, pReqReturn, pnRemainingDataSize ) ); }