Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor garmin_fs class #1203

Merged
merged 8 commits into from
Nov 1, 2023
Merged

refactor garmin_fs class #1203

merged 8 commits into from
Nov 1, 2023

Conversation

tsteven4
Copy link
Collaborator

  • use a Qt container for ilinks.
  • let the container manage memory, taking advantage of copy on write.
  • replace garmin_fs_alloc with new.
  • make garmin_fs_t* constant where possible, eliminating the possibility of the ilinks list detaching.
  • return an optional from garmin_fs_t::convert_category instead of returning status and passing a pointer to the output value.
  • retire garmin_fs_convert_category. This was mostly duplicated between garmin_fs_t::convert_category and the caller.
  • create garmin_fs_t::print_categories from the original in garmin_txt, and use it in both garmin_txt and the gpx writer.
  • add opt_utc to garmin_txt reader (it was already in the garmin_txt writer)
  • correct bugs in garmin_txt function strftime_to_timespec. %H was mistranslated, %p was missing, if the format code wasn't found a character from outside the buffer could be used. add warning when a conversion isn't found.
  • add a test proving categories can go from gpx to garmin_txt and back. additionally the test exercises the ini file category support.
  • improve debug message in convert_from_human_[time|date]_format.

@robertlipe
Copy link
Collaborator

Consistently good stuff.. %his is so much less fragile and easier to read.. Thanx.

@tsteven4 tsteven4 merged commit bc0e8b9 into GPSBabel:master Nov 1, 2023
19 checks passed
@tsteven4 tsteven4 deleted the ilinks branch November 1, 2023 13:16
robertlipe pushed a commit that referenced this pull request Aug 12, 2024
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants