/** * Loads the FLARMnet file */ static void LoadFLARMnet(FlarmNetDatabase &db) try { auto reader = OpenDataTextFileA(_T("data.fln")); unsigned num_records = FlarmNetReader::LoadFile(*reader, db); if (num_records > 0) LogFormat("%u FLARMnet ids found", num_records); } catch (const std::runtime_error &e) { LogError(e); }
/** * Loads the FLARMnet file */ static void LoadFLARMnet(FlarmNetDatabase &db) { NLineReader *reader = OpenDataTextFileA(_T("data.fln")); if (reader == NULL) return; unsigned num_records = FlarmNetReader::LoadFile(*reader, db); delete reader; if (num_records > 0) LogFormat("%u FLARMnet ids found", num_records); }
void FlarmDetails::LoadFLARMnet() { NLineReader *reader = OpenDataTextFileA(_T("data.fln")); if (reader == NULL) return; unsigned num_records = FlarmNet::LoadFile(*reader); delete reader; if (num_records > 0) LogStartUp(_T("%u FLARMnet ids found"), num_records); }
TLineReader * OpenDataTextFile(const TCHAR *name, ConvertLineReader::charset cs) { #ifdef _UNICODE assert(name != NULL); assert(!StringIsEmpty(name)); TCHAR path[MAX_PATH]; LocalPath(path, name); FileLineReader *reader = new FileLineReader(path, cs); if (reader == NULL) return NULL; if (reader->error()) { delete reader; return NULL; } return reader; #else return OpenDataTextFileA(name); #endif }