| 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Project: PDS Translator |
| 4 | * Purpose: Implements OGRPDSLayer class. |
| 5 | * Author: Even Rouault, <even dot rouault at spatialys.com> |
| 6 | * |
| 7 | ****************************************************************************** |
| 8 | * Copyright (c) 2010-2013, Even Rouault <even dot rouault at spatialys.com> |
| 9 | * |
| 10 | * SPDX-License-Identifier: MIT |
| 11 | ****************************************************************************/ |
| 12 | |
| 13 | #include "ogr_pds.h"cxx . . $ `<file>/ogr/ogrsf_frmts/pds/ogr_pds.h`/ |
| 14 | #include "cpl_conv.h"cxx . . $ `<file>/port/cpl_conv.h`/ |
| 15 | #include "cpl_string.h"cxx . . $ `<file>/port/cpl_string.h`/ |
| 16 | #include "ogr_p.h"cxx . . $ `<file>/ogr/ogr_p.h`/ |
| 17 | #include "cpl_safemaths.hpp"cxx . . $ `<file>/port/cpl_safemaths.hpp`/ |
| 18 | |
| 19 | #include <algorithm> |
| 20 | |
| 21 | namespace OGRPDScxx . . $ OGRPDS/ |
| 22 | { |
| 23 | |
| 24 | /************************************************************************/ |
| 25 | /* OGRPDSLayer() */ |
| 26 | /************************************************************************/ |
| 27 | |
| 28 | OGRPDSLayercxx . . $ OGRPDS/OGRPDSLayer#::OGRPDSLayercxx . . $ OGRPDS/OGRPDSLayer#OGRPDSLayer(21d09b699fb3f90f).(const stdcxx . . $ std/::string &osTableIDIn, |
| 29 | const char *pszLayerName, VSILFILE *fp, |
| 30 | const stdcxx . . $ std/::string &osLabelFilename, |
| 31 | const stdcxx . . $ std/::string &osStructureFilename, int nRecordsIn, |
| 32 | vsi_l_offset nStartBytesIn, int nRecordSizeIn, |
| 33 | GBytecxx . . $ GByte# *pabyRecordIn, bool bIsASCII) |
| 34 | : poFeatureDefncxx . . $ OGRPDS/OGRPDSLayer#poFeatureDefn.(new OGRFeatureDefncxx . . $ OGRFeatureDefn#(pszLayerName)), osTableIDcxx . . $ OGRPDS/OGRPDSLayer#osTableID.(osTableIDIn), |
| 35 | fpPDScxx . . $ OGRPDS/OGRPDSLayer#fpPDS.(fp), nRecordscxx . . $ OGRPDS/OGRPDSLayer#nRecords.(nRecordsIn), nStartBytescxx . . $ OGRPDS/OGRPDSLayer#nStartBytes.(nStartBytesIn), |
| 36 | nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize.(nRecordSizeIn), pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord.(pabyRecordIn), nNextFIDcxx . . $ OGRPDS/OGRPDSLayer#nNextFID.(0), |
| 37 | nLongitudeIndexcxx . . $ OGRPDS/OGRPDSLayer#nLongitudeIndex.(-1), nLatitudeIndexcxx . . $ OGRPDS/OGRPDSLayer#nLatitudeIndex.(-1), pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.(nullptr) |
| 38 | { |
| 39 | SetDescriptioncxx . . $ GDALMajorObject#SetDescription(85c52e162fed56f9).(poFeatureDefncxx . . $ OGRPDS/OGRPDSLayer#poFeatureDefn.->GetNamecxx . . $ OGRFeatureDefn#GetName(a9f41ea0e82d88cf).()); |
| 40 | poFeatureDefncxx . . $ OGRPDS/OGRPDSLayer#poFeatureDefn.->Referencecxx . . $ OGRFeatureDefn#Reference(b126dc7c1de90089).(); |
| 41 | poFeatureDefncxx . . $ OGRPDS/OGRPDSLayer#poFeatureDefn.->SetGeomTypecxx . . $ OGRFeatureDefn#SetGeomType(f47ce3f1fe923726).(wkbNone); |
| 42 | |
| 43 | if (!osStructureFilename.empty()) |
| 44 | { |
| 45 | ReadStructurecxx . . $ OGRPDS/OGRPDSLayer#ReadStructure(9c546c94e5fcce4e).(osStructureFilename); |
| 46 | } |
| 47 | else |
| 48 | { |
| 49 | ReadStructurecxx . . $ OGRPDS/OGRPDSLayer#ReadStructure(9c546c94e5fcce4e).(osLabelFilename); |
| 50 | } |
| 51 | |
| 52 | if (bIsASCII && poFeatureDefncxx . . $ OGRPDS/OGRPDSLayer#poFeatureDefn.->GetFieldCountcxx . . $ OGRFeatureDefn#GetFieldCount(455f465bc33b4cdf).() == 0) |
| 53 | { |
| 54 | VSIFSeekL(fpPDScxx . . $ OGRPDS/OGRPDSLayer#fpPDS., nStartBytescxx . . $ OGRPDS/OGRPDSLayer#nStartBytes., SEEK_SETcxx . . $ `<external>/232824719582829767/stdio.h:114:9`!); |
| 55 | VSIFReadL(pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord., nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize., 1, fpPDScxx . . $ OGRPDS/OGRPDSLayer#fpPDS.); |
| 56 | |
| 57 | char **papszTokens = CSLTokenizeString2((const char *)pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord., " ", |
| 58 | CSLT_HONOURSTRINGScxx . . $ `port/cpl_string.h:70:9`!); |
| 59 | const int nTokens = CSLCount(papszTokens); |
| 60 | for (int i = 0; i < nTokens; i++) |
| 61 | { |
| 62 | const char *pszStr = papszTokens[i]; |
| 63 | char ch = '\0'; |
| 64 | OGRFieldType eFieldType = OFTInteger; |
| 65 | while ((ch = *pszStr) != 0) |
| 66 | { |
| 67 | if ((ch >= '0' && ch <= '9') || ch == '+' || ch == '-') |
| 68 | { |
| 69 | } |
| 70 | else if (ch == '.') |
| 71 | { |
| 72 | eFieldType = OFTReal; |
| 73 | } |
| 74 | else |
| 75 | { |
| 76 | eFieldType = OFTString; |
| 77 | break; |
| 78 | } |
| 79 | pszStr++; |
| 80 | } |
| 81 | char szFieldName[32]; |
| 82 | snprintf(szFieldName, sizeof(szFieldName), "field_%d", |
| 83 | poFeatureDefncxx . . $ OGRPDS/OGRPDSLayer#poFeatureDefn.->GetFieldCountcxx . . $ OGRFeatureDefn#GetFieldCount(455f465bc33b4cdf).() + 1); |
| 84 | OGRFieldDefncxx . . $ OGRFieldDefn# oFieldDefncxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).(szFieldName, eFieldType); |
| 85 | poFeatureDefncxx . . $ OGRPDS/OGRPDSLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oFieldDefn); |
| 86 | } |
| 87 | CSLDestroy(papszTokens); |
| 88 | } |
| 89 | |
| 90 | if (nLongitudeIndexcxx . . $ OGRPDS/OGRPDSLayer#nLongitudeIndex. >= 0 && nLatitudeIndexcxx . . $ OGRPDS/OGRPDSLayer#nLatitudeIndex. >= 0) |
| 91 | { |
| 92 | poFeatureDefncxx . . $ OGRPDS/OGRPDSLayer#poFeatureDefn.->SetGeomTypecxx . . $ OGRFeatureDefn#SetGeomType(f47ce3f1fe923726).(wkbPoint); |
| 93 | } |
| 94 | |
| 95 | OGRPDSLayercxx . . $ OGRPDS/OGRPDSLayer#::ResetReadingcxx . . $ OGRPDS/OGRPDSLayer#ResetReading(49f6e7a06ebc5aa8).(); |
| 96 | } |
| 97 | |
| 98 | /************************************************************************/ |
| 99 | /* ~OGRPDSLayer() */ |
| 100 | /************************************************************************/ |
| 101 | |
| 102 | OGRPDSLayercxx . . $ OGRPDS/OGRPDSLayer#::~cxx . . $ OGRPDS/OGRPDSLayer#`~OGRPDSLayer`(ced63f7c635d850d).OGRPDSLayercxx . . $ OGRPDS/OGRPDSLayer#() |
| 103 | |
| 104 | { |
| 105 | CPLFreecxx . . $ `port/cpl_conv.h:97:9`!(pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.); |
| 106 | poFeatureDefncxx . . $ OGRPDS/OGRPDSLayer#poFeatureDefn.->Releasecxx . . $ OGRFeatureDefn#Release(49f6e7a06ebc5aa8).(); |
| 107 | VSIFree(pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord.); |
| 108 | |
| 109 | VSIFCloseL(fpPDScxx . . $ OGRPDS/OGRPDSLayer#fpPDS.); |
| 110 | } |
| 111 | |
| 112 | /************************************************************************/ |
| 113 | /* ReadStructure() */ |
| 114 | /************************************************************************/ |
| 115 | |
| 116 | void OGRPDSLayercxx . . $ OGRPDS/OGRPDSLayer#::ReadStructurecxx . . $ OGRPDS/OGRPDSLayer#ReadStructure(9c546c94e5fcce4e).(const stdcxx . . $ std/::string &osStructureFilename) |
| 117 | |
| 118 | { |
| 119 | VSILFILE *fpStructure = VSIFOpenL(osStructureFilename.c_str(), "rb"); |
| 120 | if (fpStructure == nullptr) |
| 121 | return; |
| 122 | |
| 123 | int nFields = 0; |
| 124 | bool bInObjectColumn = false; |
| 125 | int nExpectedColumnNumber = 0; |
| 126 | CPLString osColumnName; |
| 127 | CPLString osColumnDataType; |
| 128 | CPLString osColumnStartByte; |
| 129 | CPLString osColumnBytes; |
| 130 | CPLString osColumnFormat; |
| 131 | CPLString osColumnUnit; |
| 132 | CPLString osColumnItems; |
| 133 | CPLString osColumnItemBytes; |
| 134 | int nRowBytes = nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize.; |
| 135 | while (true) |
| 136 | { |
| 137 | CPLPushErrorHandler(CPLQuietErrorHandler); |
| 138 | const char *pszLine = CPLReadLine2L(fpStructure, 256, nullptr); |
| 139 | CPLPopErrorHandler(); |
| 140 | CPLErrorReset(); |
| 141 | if (pszLine == nullptr) |
| 142 | break; |
| 143 | |
| 144 | char **papszTokens = |
| 145 | CSLTokenizeString2(pszLine, " =", CSLT_HONOURSTRINGScxx . . $ `port/cpl_string.h:70:9`!); |
| 146 | const int nTokens = CSLCount(papszTokens); |
| 147 | |
| 148 | if (bInObjectColumn && nTokens >= 1 && |
| 149 | EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "END_OBJECT")) |
| 150 | { |
| 151 | if (!osColumnName.empty() && !osColumnDataType.empty() && |
| 152 | !osColumnStartByte.empty() && !osColumnBytes.empty()) |
| 153 | { |
| 154 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc. = static_cast<FieldDesccxx . . $ OGRPDS/FieldDesc# *>(CPLRealloc( |
| 155 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc., (nFields + 1) * sizeof(FieldDesccxx . . $ OGRPDS/FieldDesc#))); |
| 156 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. = atoicxx . . $ atoi(f5ecf3191ed0cd93).(osColumnStartByte) - 1; |
| 157 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nByteCountcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nByteCount. = atoicxx . . $ atoi(f5ecf3191ed0cd93).(osColumnBytes); |
| 158 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. >= 0 && |
| 159 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nByteCountcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nByteCount. > 0 && |
| 160 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. < |
| 161 | INT_MAXcxx . . $ `<external>/2419331716647297546/limits.h:120:9`! - pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nByteCountcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nByteCount. && |
| 162 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + |
| 163 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nByteCountcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nByteCount. <= |
| 164 | nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize.) |
| 165 | { |
| 166 | OGRFieldType eFieldType = OFTString; |
| 167 | OGRFieldSubType eSubType = OFSTNone; |
| 168 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. = CHARACTERcxx . . $ OGRPDS/CHARACTER.; |
| 169 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. = atoicxx . . $ atoi(f5ecf3191ed0cd93).(osColumnItemBytes); |
| 170 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. = atoicxx . . $ atoi(f5ecf3191ed0cd93).(osColumnItems); |
| 171 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. == 0) |
| 172 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. = 1; |
| 173 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. == 0 && |
| 174 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. == 1) |
| 175 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. = |
| 176 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nByteCountcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nByteCount.; |
| 177 | |
| 178 | if (osColumnDataType.compare("ASCII_REAL") == 0) |
| 179 | { |
| 180 | eFieldType = OFTReal; |
| 181 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. = ASCII_REALcxx . . $ OGRPDS/ASCII_REAL.; |
| 182 | } |
| 183 | else if (osColumnDataType.compare("ASCII_INTEGER") == 0) |
| 184 | { |
| 185 | eFieldType = OFTInteger; |
| 186 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. = ASCII_INTEGERcxx . . $ OGRPDS/ASCII_INTEGER.; |
| 187 | } |
| 188 | else if (osColumnDataType.compare("MSB_UNSIGNED_INTEGER") == |
| 189 | 0) |
| 190 | { |
| 191 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. == 1 || |
| 192 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. == 2) |
| 193 | { |
| 194 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. > 1) |
| 195 | eFieldType = OFTIntegerList; |
| 196 | else |
| 197 | eFieldType = OFTInteger; |
| 198 | } |
| 199 | else |
| 200 | { |
| 201 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. = 4; |
| 202 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. > 1) |
| 203 | eFieldType = OFTRealList; |
| 204 | else |
| 205 | eFieldType = OFTReal; |
| 206 | } |
| 207 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. = MSB_UNSIGNED_INTEGERcxx . . $ OGRPDS/MSB_UNSIGNED_INTEGER.; |
| 208 | } |
| 209 | else if (osColumnDataType.compare("MSB_INTEGER") == 0) |
| 210 | { |
| 211 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. != 1 && |
| 212 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. != 2) |
| 213 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. = 4; |
| 214 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. > 1) |
| 215 | eFieldType = OFTIntegerList; |
| 216 | else |
| 217 | eFieldType = OFTInteger; |
| 218 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. = MSB_INTEGERcxx . . $ OGRPDS/MSB_INTEGER.; |
| 219 | } |
| 220 | else if (osColumnDataType.compare("IEEE_REAL") == 0) |
| 221 | { |
| 222 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. == 4) |
| 223 | { |
| 224 | eSubType = OFSTFloat32; |
| 225 | } |
| 226 | else if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. != 8) |
| 227 | { |
| 228 | // Not sure if this is correct, but default to |
| 229 | // Float32 |
| 230 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. = 4; |
| 231 | } |
| 232 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. > 1) |
| 233 | eFieldType = OFTRealList; |
| 234 | else |
| 235 | eFieldType = OFTReal; |
| 236 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. = IEEE_REALcxx . . $ OGRPDS/IEEE_REAL.; |
| 237 | } |
| 238 | |
| 239 | OGRFieldDefncxx . . $ OGRFieldDefn# oFieldDefncxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).(osColumnName, eFieldType); |
| 240 | if ((pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. == ASCII_REALcxx . . $ OGRPDS/ASCII_REAL. && |
| 241 | !osColumnFormat.empty() && osColumnFormat[0] == 'F') || |
| 242 | (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[nFields].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. == ASCII_INTEGERcxx . . $ OGRPDS/ASCII_INTEGER. && |
| 243 | !osColumnFormat.empty() && osColumnFormat[0] == 'I')) |
| 244 | { |
| 245 | const char *pszFormat = osColumnFormat.c_str(); |
| 246 | int nWidth = atoicxx . . $ atoi(f5ecf3191ed0cd93).(pszFormat + 1); |
| 247 | oFieldDefn.SetWidthcxx . . $ OGRFieldDefn#SetWidth(d4f767463ce0a6b3).(nWidth); |
| 248 | const char *pszPoint = strchr(pszFormat, '.'); |
| 249 | if (pszPoint) |
| 250 | { |
| 251 | int nPrecision = atoicxx . . $ atoi(f5ecf3191ed0cd93).(pszPoint + 1); |
| 252 | oFieldDefn.SetPrecisioncxx . . $ OGRFieldDefn#SetPrecision(d4f767463ce0a6b3).(nPrecision); |
| 253 | } |
| 254 | } |
| 255 | else if (oFieldDefn.GetTypecxx . . $ OGRFieldDefn#GetType(b365ab774e05458e).() == OFTString && |
| 256 | !osColumnFormat.empty() && |
| 257 | osColumnFormat[0] == 'A') |
| 258 | { |
| 259 | const char *pszFormat = osColumnFormat.c_str(); |
| 260 | int nWidth = atoicxx . . $ atoi(f5ecf3191ed0cd93).(pszFormat + 1); |
| 261 | oFieldDefn.SetWidthcxx . . $ OGRFieldDefn#SetWidth(d4f767463ce0a6b3).(nWidth); |
| 262 | } |
| 263 | oFieldDefn.SetSubTypecxx . . $ OGRFieldDefn#SetSubType(89cba9d8fed1b3f9).(eSubType); |
| 264 | poFeatureDefncxx . . $ OGRPDS/OGRPDSLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oFieldDefn); |
| 265 | |
| 266 | if (oFieldDefn.GetTypecxx . . $ OGRFieldDefn#GetType(b365ab774e05458e).() == OFTReal && |
| 267 | osColumnUnit.compare("DEGREE") == 0) |
| 268 | { |
| 269 | if (osColumnName.compare("LONGITUDE") == 0) |
| 270 | nLongitudeIndexcxx . . $ OGRPDS/OGRPDSLayer#nLongitudeIndex. = nFields; |
| 271 | else if (osColumnName.compare("LATITUDE") == 0) |
| 272 | nLatitudeIndexcxx . . $ OGRPDS/OGRPDSLayer#nLatitudeIndex. = nFields; |
| 273 | } |
| 274 | |
| 275 | nFields++; |
| 276 | } |
| 277 | else |
| 278 | { |
| 279 | CPLError(CE_Failure, CPLE_AppDefinedcxx . . $ `port/cpl_error.h:108:9`!, |
| 280 | "Field %d out of record extents", nFields); |
| 281 | CSLDestroy(papszTokens); |
| 282 | if (nFields == 0) |
| 283 | { |
| 284 | CPLFreecxx . . $ `port/cpl_conv.h:97:9`!(pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.); |
| 285 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc. = nullptr; |
| 286 | } |
| 287 | break; |
| 288 | } |
| 289 | } |
| 290 | else |
| 291 | { |
| 292 | CPLError(CE_Failure, CPLE_AppDefinedcxx . . $ `port/cpl_error.h:108:9`!, |
| 293 | "Did not get expected records for field %d", nFields); |
| 294 | CSLDestroy(papszTokens); |
| 295 | break; |
| 296 | } |
| 297 | bInObjectColumn = false; |
| 298 | } |
| 299 | else if (nTokens == 2) |
| 300 | { |
| 301 | if (EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "PDS_VERSION_ID")) |
| 302 | { |
| 303 | CSLDestroy(papszTokens); |
| 304 | papszTokens = nullptr; |
| 305 | while (true) |
| 306 | { |
| 307 | CPLPushErrorHandler(CPLQuietErrorHandler); |
| 308 | pszLine = CPLReadLine2L(fpStructure, 256, nullptr); |
| 309 | CPLPopErrorHandler(); |
| 310 | CPLErrorReset(); |
| 311 | if (pszLine == nullptr) |
| 312 | break; |
| 313 | papszTokens = |
| 314 | CSLTokenizeString2(pszLine, " =", CSLT_HONOURSTRINGScxx . . $ `port/cpl_string.h:70:9`!); |
| 315 | int nTokens2 = CSLCount(papszTokens); |
| 316 | if (nTokens2 == 2 && EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "OBJECT") && |
| 317 | EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[1], osTableID.c_str())) |
| 318 | { |
| 319 | break; |
| 320 | } |
| 321 | CSLDestroy(papszTokens); |
| 322 | papszTokens = nullptr; |
| 323 | } |
| 324 | CSLDestroy(papszTokens); |
| 325 | papszTokens = nullptr; |
| 326 | if (pszLine == nullptr) |
| 327 | break; |
| 328 | } |
| 329 | else if (EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "ROW_BYTES")) |
| 330 | { |
| 331 | nRowBytes = atoicxx . . $ atoi(f5ecf3191ed0cd93).(papszTokens[1]); |
| 332 | if (nRowBytes < 0 || nRowBytes > 10 * 1024 * 1024) |
| 333 | { |
| 334 | CPLError(CE_Failure, CPLE_NotSupportedcxx . . $ `port/cpl_error.h:118:9`!, |
| 335 | "Invalid value of ROW_BYTES"); |
| 336 | CSLDestroy(papszTokens); |
| 337 | break; |
| 338 | } |
| 339 | } |
| 340 | else if (EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "ROW_SUFFIX_BYTES")) |
| 341 | { |
| 342 | try |
| 343 | { |
| 344 | nRowBytes = |
| 345 | (CPLSMcxx . . $ CPLSM(18ad9358d42ddcdc).(nRowBytes) +cxx . . $ operator+(69e70f6dbb4c09bd). CPLSMcxx . . $ CPLSM(18ad9358d42ddcdc).(atoicxx . . $ atoi(f5ecf3191ed0cd93).(papszTokens[1]))).vcxx . . $ CPLSafeInt#v(8f5363d873dd4781).(); |
| 346 | } |
| 347 | catch (const CPLSafeIntOverflowcxx . . $ CPLSafeIntOverflow# &) |
| 348 | { |
| 349 | CPLError(CE_Failure, CPLE_NotSupportedcxx . . $ `port/cpl_error.h:118:9`!, |
| 350 | "Invalid value of ROW_SUFFIX_BYTES"); |
| 351 | CSLDestroy(papszTokens); |
| 352 | break; |
| 353 | } |
| 354 | if (nRowBytes < 0 || nRowBytes > 10 * 1024 * 1024) |
| 355 | { |
| 356 | CPLError(CE_Failure, CPLE_NotSupportedcxx . . $ `port/cpl_error.h:118:9`!, |
| 357 | "Invalid value of ROW_SUFFIX_BYTES"); |
| 358 | CSLDestroy(papszTokens); |
| 359 | break; |
| 360 | } |
| 361 | } |
| 362 | else if (EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "OBJECT") && |
| 363 | EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[1], "COLUMN")) |
| 364 | { |
| 365 | if (nRowBytes > nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize.) |
| 366 | { |
| 367 | nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize. = nRowBytes; |
| 368 | VSIFree(pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord.); |
| 369 | pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. = (GBytecxx . . $ GByte# *)CPLMalloc(nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize. + 1); |
| 370 | pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord.[nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize.] = 0; |
| 371 | } |
| 372 | else |
| 373 | nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize. = nRowBytes; |
| 374 | |
| 375 | nExpectedColumnNumber++; |
| 376 | bInObjectColumn = true; |
| 377 | osColumnName = ""; |
| 378 | osColumnDataType = ""; |
| 379 | osColumnStartByte = ""; |
| 380 | osColumnBytes = ""; |
| 381 | osColumnItems = ""; |
| 382 | osColumnItemBytes = ""; |
| 383 | osColumnFormat = ""; |
| 384 | osColumnUnit = ""; |
| 385 | } |
| 386 | else if (bInObjectColumn && EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "COLUMN_NUMBER")) |
| 387 | { |
| 388 | int nColumnNumber = atoicxx . . $ atoi(f5ecf3191ed0cd93).(papszTokens[1]); |
| 389 | if (nColumnNumber != nExpectedColumnNumber) |
| 390 | { |
| 391 | CPLError(CE_Failure, CPLE_AppDefinedcxx . . $ `port/cpl_error.h:108:9`!, |
| 392 | "Did not get expected column number"); |
| 393 | CSLDestroy(papszTokens); |
| 394 | break; |
| 395 | } |
| 396 | } |
| 397 | else if (bInObjectColumn && EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "NAME")) |
| 398 | { |
| 399 | osColumnName = "\""; |
| 400 | osColumnName += papszTokens[1]; |
| 401 | osColumnName += "\""; |
| 402 | OGRPDSDataSourcecxx . . $ OGRPDSDataSource#::CleanStringcxx . . $ OGRPDSDataSource#CleanString(8c3032d70770509b).(osColumnName); |
| 403 | } |
| 404 | else if (bInObjectColumn && EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "DATA_TYPE")) |
| 405 | { |
| 406 | osColumnDataType = papszTokens[1]; |
| 407 | OGRPDSDataSourcecxx . . $ OGRPDSDataSource#::CleanStringcxx . . $ OGRPDSDataSource#CleanString(8c3032d70770509b).(osColumnDataType); |
| 408 | } |
| 409 | else if (bInObjectColumn && EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "START_BYTE")) |
| 410 | { |
| 411 | osColumnStartByte = papszTokens[1]; |
| 412 | } |
| 413 | else if (bInObjectColumn && EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "BYTES")) |
| 414 | { |
| 415 | osColumnBytes = papszTokens[1]; |
| 416 | } |
| 417 | else if (bInObjectColumn && EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "ITEMS")) |
| 418 | { |
| 419 | osColumnItems = papszTokens[1]; |
| 420 | } |
| 421 | else if (bInObjectColumn && EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "ITEM_BYTES")) |
| 422 | { |
| 423 | osColumnItemBytes = papszTokens[1]; |
| 424 | } |
| 425 | else if (bInObjectColumn && EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "FORMAT")) |
| 426 | { |
| 427 | osColumnFormat = papszTokens[1]; |
| 428 | } |
| 429 | else if (bInObjectColumn && EQUALcxx . . $ `port/cpl_port.h:532:9`!(papszTokens[0], "UNIT")) |
| 430 | { |
| 431 | osColumnUnit = papszTokens[1]; |
| 432 | } |
| 433 | } |
| 434 | CSLDestroy(papszTokens); |
| 435 | } |
| 436 | VSIFCloseL(fpStructure); |
| 437 | } |
| 438 | |
| 439 | /************************************************************************/ |
| 440 | /* ResetReading() */ |
| 441 | /************************************************************************/ |
| 442 | |
| 443 | void OGRPDSLayercxx . . $ OGRPDS/OGRPDSLayer#::ResetReadingcxx . . $ OGRPDS/OGRPDSLayer#ResetReading(49f6e7a06ebc5aa8).() |
| 444 | |
| 445 | { |
| 446 | nNextFIDcxx . . $ OGRPDS/OGRPDSLayer#nNextFID. = 0; |
| 447 | VSIFSeekL(fpPDScxx . . $ OGRPDS/OGRPDSLayer#fpPDS., nStartBytescxx . . $ OGRPDS/OGRPDSLayer#nStartBytes., SEEK_SETcxx . . $ `<external>/232824719582829767/stdio.h:114:9`!); |
| 448 | } |
| 449 | |
| 450 | /************************************************************************/ |
| 451 | /* GetNextRawFeature() */ |
| 452 | /************************************************************************/ |
| 453 | |
| 454 | OGRFeaturecxx . . $ OGRFeature# *OGRPDSLayercxx . . $ OGRPDS/OGRPDSLayer#::GetNextRawFeaturecxx . . $ OGRPDS/OGRPDSLayer#GetNextRawFeature(ec9eceddec1d9563).() |
| 455 | { |
| 456 | if (nNextFIDcxx . . $ OGRPDS/OGRPDSLayer#nNextFID. == nRecordscxx . . $ OGRPDS/OGRPDSLayer#nRecords.) |
| 457 | return nullptr; |
| 458 | int nRead = (int)VSIFReadL(pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord., 1, nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize., fpPDScxx . . $ OGRPDS/OGRPDSLayer#fpPDS.); |
| 459 | if (nRead != nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize.) |
| 460 | return nullptr; |
| 461 | |
| 462 | OGRFeaturecxx . . $ OGRFeature# *poFeature = new OGRFeaturecxx . . $ OGRFeature#OGRFeature(dc2636911e7adfe).(poFeatureDefncxx . . $ OGRPDS/OGRPDSLayer#poFeatureDefn.); |
| 463 | int nFieldCount = poFeatureDefncxx . . $ OGRPDS/OGRPDSLayer#poFeatureDefn.->GetFieldCountcxx . . $ OGRFeatureDefn#GetFieldCount(455f465bc33b4cdf).(); |
| 464 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc. != nullptr) |
| 465 | { |
| 466 | for (int i = 0; i < nFieldCount; i++) |
| 467 | { |
| 468 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. == ASCII_REALcxx . . $ OGRPDS/ASCII_REAL. || |
| 469 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. == ASCII_INTEGERcxx . . $ OGRPDS/ASCII_INTEGER. || |
| 470 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. == CHARACTERcxx . . $ OGRPDS/CHARACTER.) |
| 471 | { |
| 472 | char *pchEnd = reinterpret_cast<char *>( |
| 473 | &pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord.[pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + |
| 474 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nByteCountcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nByteCount.]); |
| 475 | char chSaved = *pchEnd; |
| 476 | *pchEnd = 0; |
| 477 | const char *pszValue = |
| 478 | (const char *)(pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte.); |
| 479 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. == CHARACTERcxx . . $ OGRPDS/CHARACTER.) |
| 480 | { |
| 481 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(66835f578de1bcb3).(i, pszValue); |
| 482 | } |
| 483 | else |
| 484 | { |
| 485 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(66835f578de1bcb3).(i, CPLString(pszValue).Trim().c_str()); |
| 486 | } |
| 487 | *pchEnd = chSaved; |
| 488 | } |
| 489 | else if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. == MSB_UNSIGNED_INTEGERcxx . . $ OGRPDS/MSB_UNSIGNED_INTEGER. && |
| 490 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. * |
| 491 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. <= |
| 492 | nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize.) |
| 493 | { |
| 494 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. == 1) |
| 495 | { |
| 496 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. > 1) |
| 497 | { |
| 498 | int *panValues = static_cast<int *>( |
| 499 | CPLMalloc(sizeof(int) * pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.)); |
| 500 | for (int j = 0; j < pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.; j++) |
| 501 | { |
| 502 | panValues[j] = |
| 503 | pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord.[pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + j]; |
| 504 | } |
| 505 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(4ba7fc99d2e6f458).(i, pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems., |
| 506 | panValues); |
| 507 | CPLFreecxx . . $ `port/cpl_conv.h:97:9`!(panValues); |
| 508 | } |
| 509 | else |
| 510 | { |
| 511 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(3e454b8ccf442868).( |
| 512 | i, pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord.[pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte.]); |
| 513 | } |
| 514 | } |
| 515 | else if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. == 2) |
| 516 | { |
| 517 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. > 1) |
| 518 | { |
| 519 | int *panValues = (int *)CPLMalloc( |
| 520 | sizeof(int) * pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.); |
| 521 | for (int j = 0; j < pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.; j++) |
| 522 | { |
| 523 | unsigned short sVal = 0; |
| 524 | memcpy(&sVal, |
| 525 | pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + |
| 526 | 2 * j, |
| 527 | 2); |
| 528 | CPL_MSBPTR16cxx . . $ `port/cpl_port.h:758:9`!(&sVal); |
| 529 | panValues[j] = sVal; |
| 530 | } |
| 531 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(4ba7fc99d2e6f458).(i, pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems., |
| 532 | panValues); |
| 533 | CPLFreecxx . . $ `port/cpl_conv.h:97:9`!(panValues); |
| 534 | } |
| 535 | else |
| 536 | { |
| 537 | unsigned short sVal = 0; |
| 538 | memcpy(&sVal, pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte., |
| 539 | 2); |
| 540 | CPL_MSBPTR16cxx . . $ `port/cpl_port.h:758:9`!(&sVal); |
| 541 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(3e454b8ccf442868).(i, (int)sVal); |
| 542 | } |
| 543 | } |
| 544 | else if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. == 4) |
| 545 | { |
| 546 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. > 1) |
| 547 | { |
| 548 | double *padfValues = (double *)CPLMalloc( |
| 549 | sizeof(double) * pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.); |
| 550 | for (int j = 0; j < pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.; j++) |
| 551 | { |
| 552 | unsigned int nVal = 0; |
| 553 | memcpy(&nVal, |
| 554 | pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + |
| 555 | 4 * j, |
| 556 | 4); |
| 557 | CPL_MSBPTR32cxx . . $ `port/cpl_port.h:765:9`!(&nVal); |
| 558 | padfValues[j] = (double)nVal; |
| 559 | } |
| 560 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(b8daf4edcaf98a52).(i, pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems., |
| 561 | padfValues); |
| 562 | CPLFreecxx . . $ `port/cpl_conv.h:97:9`!(padfValues); |
| 563 | } |
| 564 | else |
| 565 | { |
| 566 | unsigned int nVal = 0; |
| 567 | memcpy(&nVal, pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte., |
| 568 | 4); |
| 569 | CPL_MSBPTR32cxx . . $ `port/cpl_port.h:765:9`!(&nVal); |
| 570 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(9d6abc0cf25e86e9).(i, (double)nVal); |
| 571 | } |
| 572 | } |
| 573 | } |
| 574 | else if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. == MSB_INTEGERcxx . . $ OGRPDS/MSB_INTEGER. && |
| 575 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. * |
| 576 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. <= |
| 577 | nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize.) |
| 578 | { |
| 579 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. == 1) |
| 580 | { |
| 581 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. > 1) |
| 582 | { |
| 583 | int *panValues = (int *)CPLMalloc( |
| 584 | sizeof(int) * pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.); |
| 585 | for (int j = 0; j < pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.; j++) |
| 586 | { |
| 587 | panValues[j] = (( |
| 588 | char *)pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord.)[pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + |
| 589 | j]; |
| 590 | } |
| 591 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(4ba7fc99d2e6f458).(i, pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems., |
| 592 | panValues); |
| 593 | CPLFreecxx . . $ `port/cpl_conv.h:97:9`!(panValues); |
| 594 | } |
| 595 | else |
| 596 | { |
| 597 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(3e454b8ccf442868).( |
| 598 | i, |
| 599 | ((char *)pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord.)[pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte.]); |
| 600 | } |
| 601 | } |
| 602 | else if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. == 2) |
| 603 | { |
| 604 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. > 1) |
| 605 | { |
| 606 | int *panValues = (int *)CPLMalloc( |
| 607 | sizeof(int) * pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.); |
| 608 | for (int j = 0; j < pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.; j++) |
| 609 | { |
| 610 | short sVal = 0; |
| 611 | memcpy(&sVal, |
| 612 | pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + |
| 613 | 2 * j, |
| 614 | 2); |
| 615 | CPL_MSBPTR16cxx . . $ `port/cpl_port.h:758:9`!(&sVal); |
| 616 | panValues[j] = sVal; |
| 617 | } |
| 618 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(4ba7fc99d2e6f458).(i, pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems., |
| 619 | panValues); |
| 620 | CPLFreecxx . . $ `port/cpl_conv.h:97:9`!(panValues); |
| 621 | } |
| 622 | else |
| 623 | { |
| 624 | short sVal = 0; |
| 625 | memcpy(&sVal, pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte., |
| 626 | 2); |
| 627 | CPL_MSBPTR16cxx . . $ `port/cpl_port.h:758:9`!(&sVal); |
| 628 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(3e454b8ccf442868).(i, (int)sVal); |
| 629 | } |
| 630 | } |
| 631 | else if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. == 4) |
| 632 | { |
| 633 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. > 1) |
| 634 | { |
| 635 | int *panValues = (int *)CPLMalloc( |
| 636 | sizeof(int) * pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.); |
| 637 | for (int j = 0; j < pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.; j++) |
| 638 | { |
| 639 | int nVal = 0; |
| 640 | memcpy(&nVal, |
| 641 | pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + |
| 642 | 4 * j, |
| 643 | 4); |
| 644 | CPL_MSBPTR32cxx . . $ `port/cpl_port.h:765:9`!(&nVal); |
| 645 | panValues[j] = nVal; |
| 646 | } |
| 647 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(4ba7fc99d2e6f458).(i, pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems., |
| 648 | panValues); |
| 649 | CPLFreecxx . . $ `port/cpl_conv.h:97:9`!(panValues); |
| 650 | } |
| 651 | else |
| 652 | { |
| 653 | int nVal = 0; |
| 654 | memcpy(&nVal, pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte., |
| 655 | 4); |
| 656 | CPL_MSBPTR32cxx . . $ `port/cpl_port.h:765:9`!(&nVal); |
| 657 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(3e454b8ccf442868).(i, nVal); |
| 658 | } |
| 659 | } |
| 660 | } |
| 661 | else if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. == IEEE_REALcxx . . $ OGRPDS/IEEE_REAL. && |
| 662 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. * |
| 663 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. <= |
| 664 | nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize. && |
| 665 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. == 4) |
| 666 | { |
| 667 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. > 1) |
| 668 | { |
| 669 | double *padfValues = (double *)CPLMalloc( |
| 670 | sizeof(double) * pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.); |
| 671 | for (int j = 0; j < pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.; j++) |
| 672 | { |
| 673 | float fVal = 0.0f; |
| 674 | memcpy(&fVal, |
| 675 | pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + 4 * j, |
| 676 | 4); |
| 677 | CPL_MSBPTR32cxx . . $ `port/cpl_port.h:765:9`!(&fVal); |
| 678 | padfValues[j] = (double)fVal; |
| 679 | } |
| 680 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(b8daf4edcaf98a52).(i, pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems., padfValues); |
| 681 | CPLFreecxx . . $ `port/cpl_conv.h:97:9`!(padfValues); |
| 682 | } |
| 683 | else |
| 684 | { |
| 685 | float fVal = 0.0f; |
| 686 | memcpy(&fVal, pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte., 4); |
| 687 | CPL_MSBPTR32cxx . . $ `port/cpl_port.h:765:9`!(&fVal); |
| 688 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(9d6abc0cf25e86e9).(i, (double)fVal); |
| 689 | } |
| 690 | } |
| 691 | else if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].eFormatcxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#eFormat. == IEEE_REALcxx . . $ OGRPDS/IEEE_REAL. && |
| 692 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. * |
| 693 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. <= |
| 694 | nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize. && |
| 695 | pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemBytescxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItemBytes. == 8) |
| 696 | { |
| 697 | if (pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems. > 1) |
| 698 | { |
| 699 | double *padfValues = (double *)CPLMalloc( |
| 700 | sizeof(double) * pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.); |
| 701 | for (int j = 0; j < pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems.; j++) |
| 702 | { |
| 703 | double dfVal = 0.0; |
| 704 | memcpy(&dfVal, |
| 705 | pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte. + 8 * j, |
| 706 | 8); |
| 707 | CPL_MSBPTR64cxx . . $ `port/cpl_port.h:772:9`!(&dfVal); |
| 708 | padfValues[j] = dfVal; |
| 709 | } |
| 710 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(b8daf4edcaf98a52).(i, pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nItemscxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nItems., padfValues); |
| 711 | CPLFreecxx . . $ `port/cpl_conv.h:97:9`!(padfValues); |
| 712 | } |
| 713 | else |
| 714 | { |
| 715 | double dfVal = 0.0; |
| 716 | memcpy(&dfVal, pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord. + pasFieldDesccxx . . $ OGRPDS/OGRPDSLayer#pasFieldDesc.[i].nStartBytecxx . . $ OGRPDS/$anonymous_type_c341b8be21a34dac_1#nStartByte., 8); |
| 717 | CPL_MSBPTR64cxx . . $ `port/cpl_port.h:772:9`!(&dfVal); |
| 718 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(9d6abc0cf25e86e9).(i, dfVal); |
| 719 | } |
| 720 | } |
| 721 | } |
| 722 | } |
| 723 | else |
| 724 | { |
| 725 | char **papszTokens = CSLTokenizeString2((const char *)pabyRecordcxx . . $ OGRPDS/OGRPDSLayer#pabyRecord., " ", |
| 726 | CSLT_HONOURSTRINGScxx . . $ `port/cpl_string.h:70:9`!); |
| 727 | const int nTokens = stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(CSLCount(papszTokens), nFieldCount); |
| 728 | for (int i = 0; i < nTokens; i++) |
| 729 | { |
| 730 | poFeature->SetFieldcxx . . $ OGRFeature#SetField(66835f578de1bcb3).(i, papszTokens[i]); |
| 731 | } |
| 732 | CSLDestroy(papszTokens); |
| 733 | } |
| 734 | |
| 735 | if (nLongitudeIndexcxx . . $ OGRPDS/OGRPDSLayer#nLongitudeIndex. >= 0 && nLatitudeIndexcxx . . $ OGRPDS/OGRPDSLayer#nLatitudeIndex. >= 0) |
| 736 | poFeature->SetGeometryDirectlycxx . . $ OGRFeature#SetGeometryDirectly(cec3429dca426eb8).( |
| 737 | new OGRPointcxx . . $ OGRPoint#OGRPoint(bc12c9ec15586e6a).(poFeature->GetFieldAsDoublecxx . . $ OGRFeature#GetFieldAsDouble(8bbae5fb2e9ef7ac).(nLongitudeIndexcxx . . $ OGRPDS/OGRPDSLayer#nLongitudeIndex.), |
| 738 | poFeature->GetFieldAsDoublecxx . . $ OGRFeature#GetFieldAsDouble(8bbae5fb2e9ef7ac).(nLatitudeIndexcxx . . $ OGRPDS/OGRPDSLayer#nLatitudeIndex.))); |
| 739 | |
| 740 | poFeature->SetFIDcxx . . $ OGRFeature#SetFID(a070d6d14e988596).(nNextFIDcxx . . $ OGRPDS/OGRPDSLayer#nNextFID.++); |
| 741 | |
| 742 | return poFeature; |
| 743 | } |
| 744 | |
| 745 | /************************************************************************/ |
| 746 | /* TestCapability() */ |
| 747 | /************************************************************************/ |
| 748 | |
| 749 | int OGRPDSLayercxx . . $ OGRPDS/OGRPDSLayer#::TestCapabilitycxx . . $ OGRPDS/OGRPDSLayer#TestCapability(78f035161ffa9fe2).(const char *pszCap) const |
| 750 | |
| 751 | { |
| 752 | if (EQUALcxx . . $ `port/cpl_port.h:532:9`!(pszCap, OLCFastFeatureCountcxx . . $ `ogr/ogr_core.h:983:9`!) && m_poFilterGeomcxx . . $ OGRLayer#m_poFilterGeom. == nullptr && |
| 753 | m_poAttrQuerycxx . . $ OGRLayer#m_poAttrQuery. == nullptr) |
| 754 | return TRUEcxx . . $ `port/cpl_port.h:1184:9`!; |
| 755 | |
| 756 | if (EQUALcxx . . $ `port/cpl_port.h:532:9`!(pszCap, OLCRandomReadcxx . . $ `ogr/ogr_core.h:977:9`!)) |
| 757 | return TRUEcxx . . $ `port/cpl_port.h:1184:9`!; |
| 758 | |
| 759 | if (EQUALcxx . . $ `port/cpl_port.h:532:9`!(pszCap, OLCFastSetNextByIndexcxx . . $ `ogr/ogr_core.h:1013:9`!) && m_poFilterGeomcxx . . $ OGRLayer#m_poFilterGeom. == nullptr && |
| 760 | m_poAttrQuerycxx . . $ OGRLayer#m_poAttrQuery. == nullptr) |
| 761 | return TRUEcxx . . $ `port/cpl_port.h:1184:9`!; |
| 762 | |
| 763 | return FALSEcxx . . $ `port/cpl_port.h:1180:9`!; |
| 764 | } |
| 765 | |
| 766 | /************************************************************************/ |
| 767 | /* GetFeatureCount() */ |
| 768 | /************************************************************************/ |
| 769 | |
| 770 | GIntBigcxx . . $ GIntBig# OGRPDSLayercxx . . $ OGRPDS/OGRPDSLayer#::GetFeatureCountcxx . . $ OGRPDS/OGRPDSLayer#GetFeatureCount(9ccc33c3ebad048d).(int bForce) |
| 771 | { |
| 772 | if (TestCapabilitycxx . . $ OGRPDS/OGRPDSLayer#TestCapability(78f035161ffa9fe2).(OLCFastFeatureCountcxx . . $ `ogr/ogr_core.h:983:9`!)) |
| 773 | return nRecordscxx . . $ OGRPDS/OGRPDSLayer#nRecords.; |
| 774 | |
| 775 | return OGRLayercxx . . $ OGRLayer#::GetFeatureCountcxx . . $ OGRLayer#GetFeatureCount(9ccc33c3ebad048d).(bForce); |
| 776 | } |
| 777 | |
| 778 | /************************************************************************/ |
| 779 | /* GetFeature() */ |
| 780 | /************************************************************************/ |
| 781 | |
| 782 | OGRFeaturecxx . . $ OGRFeature# *OGRPDSLayercxx . . $ OGRPDS/OGRPDSLayer#::GetFeaturecxx . . $ OGRPDS/OGRPDSLayer#GetFeature(86ac52c37891ada7).(GIntBigcxx . . $ GIntBig# nFID) |
| 783 | { |
| 784 | if (nFID < 0 || nFID >= nRecordscxx . . $ OGRPDS/OGRPDSLayer#nRecords.) |
| 785 | return nullptr; |
| 786 | |
| 787 | nNextFIDcxx . . $ OGRPDS/OGRPDSLayer#nNextFID. = (int)nFID; |
| 788 | VSIFSeekL(fpPDScxx . . $ OGRPDS/OGRPDSLayer#fpPDS., nStartBytescxx . . $ OGRPDS/OGRPDSLayer#nStartBytes. + nNextFIDcxx . . $ OGRPDS/OGRPDSLayer#nNextFID. * nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize., SEEK_SETcxx . . $ `<external>/232824719582829767/stdio.h:114:9`!); |
| 789 | return GetNextRawFeaturecxx . . $ OGRPDS/OGRPDSLayer#GetNextRawFeature(ec9eceddec1d9563).(); |
| 790 | } |
| 791 | |
| 792 | /************************************************************************/ |
| 793 | /* SetNextByIndex() */ |
| 794 | /************************************************************************/ |
| 795 | |
| 796 | OGRErr OGRPDSLayercxx . . $ OGRPDS/OGRPDSLayer#::SetNextByIndexcxx . . $ OGRPDS/OGRPDSLayer#SetNextByIndex(a070d6d14e988596).(GIntBigcxx . . $ GIntBig# nIndex) |
| 797 | { |
| 798 | if (!TestCapabilitycxx . . $ OGRPDS/OGRPDSLayer#TestCapability(78f035161ffa9fe2).(OLCFastSetNextByIndexcxx . . $ `ogr/ogr_core.h:1013:9`!)) |
| 799 | return OGRLayercxx . . $ OGRLayer#::SetNextByIndexcxx . . $ OGRLayer#SetNextByIndex(a070d6d14e988596).(nIndex); |
| 800 | |
| 801 | if (nIndex < 0 || nIndex >= nRecordscxx . . $ OGRPDS/OGRPDSLayer#nRecords.) |
| 802 | { |
| 803 | nNextFIDcxx . . $ OGRPDS/OGRPDSLayer#nNextFID. = nRecordscxx . . $ OGRPDS/OGRPDSLayer#nRecords.; |
| 804 | return OGRERR_NON_EXISTING_FEATUREcxx . . $ `ogr/ogr_core.h:399:9`!; |
| 805 | } |
| 806 | |
| 807 | nNextFIDcxx . . $ OGRPDS/OGRPDSLayer#nNextFID. = (int)nIndex; |
| 808 | VSIFSeekL(fpPDScxx . . $ OGRPDS/OGRPDSLayer#fpPDS., nStartBytescxx . . $ OGRPDS/OGRPDSLayer#nStartBytes. + nNextFIDcxx . . $ OGRPDS/OGRPDSLayer#nNextFID. * nRecordSizecxx . . $ OGRPDS/OGRPDSLayer#nRecordSize., SEEK_SETcxx . . $ `<external>/232824719582829767/stdio.h:114:9`!); |
| 809 | return OGRERR_NONEcxx . . $ `ogr/ogr_core.h:390:9`!; |
| 810 | } |
| 811 | |
| 812 | } // namespace OGRPDS |