Declare all folder names in a single source file (#2039)

This commit is contained in:
Mark Thompson 2024-03-25 02:44:49 -05:00 committed by GitHub
parent d9bbd1b9ff
commit d5c8525afc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 224 additions and 105 deletions

View file

@ -23,10 +23,11 @@
#include "database.hpp"
#include "file.hpp"
#include "file_path.hpp"
#include <cstring>
int database::retrieve_mid_record(MidDBRecord* record, std::string search_term) {
file_path = "AIS/mids.db";
file_path = ais_dir / u"mids.db";
index_item_length = 4;
record_length = 32;
@ -36,7 +37,7 @@ int database::retrieve_mid_record(MidDBRecord* record, std::string search_term)
}
int database::retrieve_airline_record(AirlinesDBRecord* record, std::string search_term) {
file_path = "ADSB/airlines.db";
file_path = adsb_dir / u"airlines.db";
index_item_length = 4;
record_length = 64;
@ -46,7 +47,7 @@ int database::retrieve_airline_record(AirlinesDBRecord* record, std::string sear
}
int database::retrieve_aircraft_record(AircraftDBRecord* record, std::string search_term) {
file_path = "ADSB/icao24.db";
file_path = adsb_dir / u"icao24.db";
index_item_length = 7;
record_length = 146;
@ -55,7 +56,7 @@ int database::retrieve_aircraft_record(AircraftDBRecord* record, std::string sea
return (result);
}
int database::retrieve_record(std::string file_path, int index_item_length, int record_length, void* record, std::string search_term) {
int database::retrieve_record(std::filesystem::path file_path, int index_item_length, int record_length, void* record, std::string search_term) {
if (search_term.empty())
return DATABASE_RECORD_NOT_FOUND;