Skip to content

Commit

Permalink
refactor garmin_fs class (#1203)
Browse files Browse the repository at this point in the history
* use container for garmin_fs ilinks.

and leave memory management up to the copy on write container.

* make gmsd const for read only usage.

this prevents the possiblity of detachment of the ilinks list.

* incorporate some variables and functions into garmin_fs_t

* unify garmin category conversions.

* fiddle with test time zone sensitivity.

* add utc option for garmin_txt reader.

* correct sign of adjustment

* update garmin_txt includes.
  • Loading branch information
tsteven4 authored and robertlipe committed Aug 12, 2024
1 parent fde28de commit f645939
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions xcsv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,43 @@ XcsvFormat::xcsv_waypt_pr(const Waypoint* wpt)
break;
case XT_EMAIL: {
garmin_fs_t* gmsd = garmin_fs_t::find(wpt);
case XcsvStyle::XT_COUNTRY: {
const garmin_fs_t* gmsd = garmin_fs_t::find(wpt);
buff = QString::asprintf(fmp.printfc.constData(), CSTR(garmin_fs_t::get_country(gmsd, "")));
}
break;
case XcsvStyle::XT_STATE: {
const garmin_fs_t* gmsd = garmin_fs_t::find(wpt);
buff = QString::asprintf(fmp.printfc.constData(), CSTR(garmin_fs_t::get_state(gmsd, "")));
}
break;
case XcsvStyle::XT_CITY: {
const garmin_fs_t* gmsd = garmin_fs_t::find(wpt);
buff = QString::asprintf(fmp.printfc.constData(), CSTR(garmin_fs_t::get_city(gmsd, "")));
}
break;
case XcsvStyle::XT_POSTAL_CODE: {
const garmin_fs_t* gmsd = garmin_fs_t::find(wpt);
buff = QString::asprintf(fmp.printfc.constData(), CSTR(garmin_fs_t::get_postal_code(gmsd, "")));
}
break;
case XcsvStyle::XT_STREET_ADDR: {
const garmin_fs_t* gmsd = garmin_fs_t::find(wpt);
buff = QString::asprintf(fmp.printfc.constData(), CSTR(garmin_fs_t::get_addr(gmsd, "")));
}
break;
case XcsvStyle::XT_PHONE_NR: {
const garmin_fs_t* gmsd = garmin_fs_t::find(wpt);
buff = QString::asprintf(fmp.printfc.constData(), CSTR(garmin_fs_t::get_phone_nr(gmsd, "")));
}
break;
case XcsvStyle::XT_FACILITY: {
const garmin_fs_t* gmsd = garmin_fs_t::find(wpt);
buff = QString::asprintf(fmp.printfc.constData(), CSTR(garmin_fs_t::get_facility(gmsd, "")));
}
break;
case XcsvStyle::XT_EMAIL: {
const garmin_fs_t* gmsd = garmin_fs_t::find(wpt);
buff = QString::asprintf(fmp.printfc.constData(), CSTR(garmin_fs_t::get_email(gmsd, "")));
}
break;
Expand Down

0 comments on commit f645939

Please sign in to comment.