core: convert taxonomy.c to C++

Since the taxonomy is now a real C++ struct with constructor
and destructor, dive_site has to be converted to C++ as well.

A bit hairy for now, but will ultimately be distinctly simpler.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-04 13:39:04 +02:00 committed by bstoeger
parent 3c1401785b
commit 3f8b4604be
39 changed files with 259 additions and 336 deletions

View file

@ -64,7 +64,7 @@ struct parser_state {
struct divecomputer *cur_dc = nullptr; /* non-owning */
struct dive *cur_dive = nullptr; /* owning */
struct dive_site *cur_dive_site = nullptr; /* owning */
std::unique_ptr<dive_site> cur_dive_site; /* owning */
location_t cur_location { 0 };
struct dive_trip *cur_trip = nullptr; /* owning */
struct sample *cur_sample = nullptr; /* non-owning */
@ -96,6 +96,7 @@ struct parser_state {
sqlite3 *sql_handle = nullptr; /* for SQL based parsers */
bool event_active = false;
event_allocation_t event_allocation;
parser_state();
~parser_state();
};