bool ReadWaypointFile(Path path, Waypoints &way_points, WaypointFactory factory, OperationEnvironment &operation) { return ReadWaypointFile(path, DetermineWaypointFileType(path), way_points, factory, operation); }
static bool LoadWaypointFile(Waypoints &waypoints, const TCHAR *path, WaypointOrigin origin, const RasterTerrain *terrain, OperationEnvironment &operation) { if (!ReadWaypointFile(path, waypoints, WaypointFactory(origin, terrain), operation)) { LogFormat(_T("Failed to read waypoint file: %s"), path); return false; } return true; }
static bool LoadWaypointFile(Waypoints &waypoints, struct zzip_dir *dir, const char *path, WaypointFileType file_type, WaypointOrigin origin, const RasterTerrain *terrain, OperationEnvironment &operation) { if (!ReadWaypointFile(dir, path, file_type, waypoints, WaypointFactory(origin, terrain), operation)) { LogFormat("Failed to read waypoint file: %s", path); return false; } return true; }
static bool TestWaypointFile(const TCHAR* filename, Waypoints &way_points, unsigned num_wps) { NullOperationEnvironment operation; if (!ok1(ReadWaypointFile(filename, way_points, WaypointFactory(WaypointOrigin::NONE), operation))) { skip(2, 0, "parsing waypoint file failed"); return false; } way_points.Optimise(); ok1(!way_points.IsEmpty()); ok1(way_points.size() == num_wps); return true; }