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

Method LoadImdTxtFile

gcore/mdreader/reader_eros.cpp:219–247  ·  view source on GitHub ↗

* LoadImdTxtFile */

Source from the content-addressed store, hash-verified

217 * LoadImdTxtFile
218 */
219char **GDALMDReaderEROS::LoadImdTxtFile()
220{
221 char **papszLines = CSLLoad(m_osIMDSourceFilename);
222 if (nullptr == papszLines)
223 return nullptr;
224
225 char **papszIMD = nullptr;
226
227 for (int i = 0; papszLines[i] != nullptr; i++)
228 {
229 const char *pszLine = papszLines[i];
230 if (CPLStrnlen(pszLine, 21) >= 21)
231 {
232 char szName[22];
233 memcpy(szName, pszLine, 21);
234 szName[21] = 0;
235 char *pszSpace = strchr(szName, ' ');
236 if (pszSpace)
237 {
238 *pszSpace = 0;
239 papszIMD = CSLAddNameValue(papszIMD, szName, pszLine + 20);
240 }
241 }
242 }
243
244 CSLDestroy(papszLines);
245
246 return papszIMD;
247}
248
249/**
250 * GetAcqisitionTimeFromString()

Callers

nothing calls this directly

Calls 3

CSLLoadFunction · 0.85
CPLStrnlenFunction · 0.85
CSLAddNameValueFunction · 0.85

Tested by

no test coverage detected