Commit Graph

4 Commits

Author SHA1 Message Date
John Ralls
4146251cc7 Add GncOptionUIItem manipulation to GncOptionDB. 2021-07-10 17:24:56 -07:00
John Ralls
6ccb9dbb9e Use a std::unique_ptr<GncOptionDB> instead of a raw ptr.
Passing references to it to the gnc_register_option functions.

Not tested yet with SWIG, might not work.

Includes introducing fixtures to gtest-gnc-optiondb.cpp.
2021-07-10 17:24:56 -07:00
John Ralls
f3eee511e8 Add free functions to create a new GncOptionDB and to register options.
The objective of the free functions is to hide the GncOption from language
bindings so that the GncOptions can be moved into the GncOptionDB instead
of having shared ptrs splattered around the heap. Nearly all access to
the options can then be mediated through the GncOptionDB container.

Note that gnc_option_db_new creates the GncOptionDB on the heap and
returns a raw ptr, so it's up to the creator of the GncOptionDB to
call delete on it when it's no longer needed.
2021-07-10 17:24:56 -07:00
John Ralls
455d3c2d60 Add GncOptionDB class. 2021-07-10 17:24:56 -07:00