MCPcopy Create free account
hub / github.com/OSGeo/gdal / CSVGetFileFieldId

Function CSVGetFileFieldId

port/cpl_csv.cpp:1279–1298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1277/************************************************************************/
1278
1279static int CSVGetFileFieldId(CSVTable *const psTable, const char *pszFieldName)
1280
1281{
1282 /* -------------------------------------------------------------------- */
1283 /* Find the requested field. */
1284 /* -------------------------------------------------------------------- */
1285 const int nFieldNameLength = static_cast<int>(strlen(pszFieldName));
1286 for (int i = 0; psTable->papszFieldNames != nullptr &&
1287 psTable->papszFieldNames[i] != nullptr;
1288 i++)
1289 {
1290 if (psTable->panFieldNamesLength[i] == nFieldNameLength &&
1291 EQUALN(psTable->papszFieldNames[i], pszFieldName, nFieldNameLength))
1292 {
1293 return i;
1294 }
1295 }
1296
1297 return -1;
1298}
1299
1300int CSVGetFileFieldId(const char *pszFilename, const char *pszFieldName)
1301

Callers 8

CSVScanFileByNameFunction · 0.85
CSVGetFieldFunction · 0.85
subCenterLookupFunction · 0.85
processLookupFunction · 0.85
GetGrib2Table4_2_RecordFunction · 0.85
Table45LookupFunction · 0.85

Calls 1

CSVAccessFunction · 0.85

Tested by

no test coverage detected