@@ -693,12 +693,12 @@ int DDFRecord::ReadHeader()
693
693
* the next record read.
694
694
*/
695
695
696
- DDFField *DDFRecord::FindField (const char *pszName, int iFieldIndex)
696
+ const DDFField *DDFRecord::FindField (const char *pszName, int iFieldIndex) const
697
697
698
698
{
699
699
for (int i = 0 ; i < nFieldCount; i++)
700
700
{
701
- DDFFieldDefn *poFieldDefn = paoFields[i].GetFieldDefn ();
701
+ const DDFFieldDefn *poFieldDefn = paoFields[i].GetFieldDefn ();
702
702
if (poFieldDefn && EQUAL (poFieldDefn->GetName (), pszName))
703
703
{
704
704
if (iFieldIndex == 0 )
@@ -723,7 +723,7 @@ DDFField *DDFRecord::FindField(const char *pszName, int iFieldIndex)
723
723
* @return A DDFField pointer, or NULL if the index is out of range.
724
724
*/
725
725
726
- DDFField *DDFRecord::GetField (int i)
726
+ const DDFField *DDFRecord::GetField (int i) const
727
727
728
728
{
729
729
if (i < 0 || i >= nFieldCount)
@@ -754,7 +754,7 @@ DDFField *DDFRecord::GetField(int i)
754
754
755
755
int DDFRecord::GetIntSubfield (const char *pszField, int iFieldIndex,
756
756
const char *pszSubfield, int iSubfieldIndex,
757
- int *pnSuccess)
757
+ int *pnSuccess) const
758
758
759
759
{
760
760
int nDummyErr = FALSE ;
@@ -767,14 +767,14 @@ int DDFRecord::GetIntSubfield(const char *pszField, int iFieldIndex,
767
767
/* -------------------------------------------------------------------- */
768
768
/* Fetch the field. If this fails, return zero. */
769
769
/* -------------------------------------------------------------------- */
770
- DDFField *poField = FindField (pszField, iFieldIndex);
770
+ const DDFField *poField = FindField (pszField, iFieldIndex);
771
771
if (poField == nullptr )
772
772
return 0 ;
773
773
774
774
/* -------------------------------------------------------------------- */
775
775
/* Get the subfield definition */
776
776
/* -------------------------------------------------------------------- */
777
- DDFSubfieldDefn *poSFDefn =
777
+ const DDFSubfieldDefn *poSFDefn =
778
778
poField->GetFieldDefn ()->FindSubfieldDefn (pszSubfield);
779
779
if (poSFDefn == nullptr )
780
780
return 0 ;
@@ -839,14 +839,14 @@ double DDFRecord::GetFloatSubfield(const char *pszField, int iFieldIndex,
839
839
/* -------------------------------------------------------------------- */
840
840
/* Fetch the field. If this fails, return zero. */
841
841
/* -------------------------------------------------------------------- */
842
- DDFField *poField = FindField (pszField, iFieldIndex);
842
+ const DDFField *poField = FindField (pszField, iFieldIndex);
843
843
if (poField == nullptr )
844
844
return 0 ;
845
845
846
846
/* -------------------------------------------------------------------- */
847
847
/* Get the subfield definition */
848
848
/* -------------------------------------------------------------------- */
849
- DDFSubfieldDefn *poSFDefn =
849
+ const DDFSubfieldDefn *poSFDefn =
850
850
poField->GetFieldDefn ()->FindSubfieldDefn (pszSubfield);
851
851
if (poSFDefn == nullptr )
852
852
return 0 ;
@@ -911,14 +911,14 @@ const char *DDFRecord::GetStringSubfield(const char *pszField, int iFieldIndex,
911
911
/* -------------------------------------------------------------------- */
912
912
/* Fetch the field. If this fails, return zero. */
913
913
/* -------------------------------------------------------------------- */
914
- DDFField *poField = FindField (pszField, iFieldIndex);
914
+ const DDFField *poField = FindField (pszField, iFieldIndex);
915
915
if (poField == nullptr )
916
916
return nullptr ;
917
917
918
918
/* -------------------------------------------------------------------- */
919
919
/* Get the subfield definition */
920
920
/* -------------------------------------------------------------------- */
921
- DDFSubfieldDefn *poSFDefn =
921
+ const DDFSubfieldDefn *poSFDefn =
922
922
poField->GetFieldDefn ()->FindSubfieldDefn (pszSubfield);
923
923
if (poSFDefn == nullptr )
924
924
return nullptr ;
@@ -1635,7 +1635,7 @@ int DDFRecord::SetStringSubfield(const char *pszField, int iFieldIndex,
1635
1635
/* -------------------------------------------------------------------- */
1636
1636
/* Get the subfield definition */
1637
1637
/* -------------------------------------------------------------------- */
1638
- DDFSubfieldDefn *poSFDefn =
1638
+ const DDFSubfieldDefn *poSFDefn =
1639
1639
poField->GetFieldDefn ()->FindSubfieldDefn (pszSubfield);
1640
1640
if (poSFDefn == nullptr )
1641
1641
return FALSE ;
@@ -1745,7 +1745,7 @@ int DDFRecord::SetIntSubfield(const char *pszField, int iFieldIndex,
1745
1745
/* -------------------------------------------------------------------- */
1746
1746
/* Get the subfield definition */
1747
1747
/* -------------------------------------------------------------------- */
1748
- DDFSubfieldDefn *poSFDefn =
1748
+ const DDFSubfieldDefn *poSFDefn =
1749
1749
poField->GetFieldDefn ()->FindSubfieldDefn (pszSubfield);
1750
1750
if (poSFDefn == nullptr )
1751
1751
return FALSE ;
@@ -1853,7 +1853,7 @@ int DDFRecord::SetFloatSubfield(const char *pszField, int iFieldIndex,
1853
1853
/* -------------------------------------------------------------------- */
1854
1854
/* Get the subfield definition */
1855
1855
/* -------------------------------------------------------------------- */
1856
- DDFSubfieldDefn *poSFDefn =
1856
+ const DDFSubfieldDefn *poSFDefn =
1857
1857
poField->GetFieldDefn ()->FindSubfieldDefn (pszSubfield);
1858
1858
if (poSFDefn == nullptr )
1859
1859
return FALSE ;
0 commit comments