mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add a register_option overload to GncOptionDB
For compatibility with existing scheme code.
This commit is contained in:
@@ -84,6 +84,7 @@ public:
|
||||
size_t num_sections() const noexcept { return m_sections.size(); }
|
||||
bool get_changed() const noexcept { return m_dirty; }
|
||||
void register_option(const char* section, GncOption&& option);
|
||||
void register_option(const char* section, GncOption* option);
|
||||
void unregister_option(const char* section, const char* name);
|
||||
void set_default_section(const char* section);
|
||||
const GncOptionSection* const get_default_section() const noexcept;
|
||||
|
||||
@@ -168,6 +168,13 @@ GncOptionDB::register_option(const char* sectname, GncOption&& option)
|
||||
m_sections.back()->add_option(std::move(option));
|
||||
}
|
||||
|
||||
void
|
||||
GncOptionDB::register_option(const char* sectname, GncOption* option)
|
||||
{
|
||||
register_option(sectname, std::move(*option));
|
||||
delete option;
|
||||
}
|
||||
|
||||
void
|
||||
GncOptionDB::unregister_option(const char* sectname, const char* name)
|
||||
{
|
||||
|
||||
@@ -364,6 +364,11 @@ wrap_unique_ptr(GncOptionDBPtr, GncOptionDB);
|
||||
|
||||
%ignore gnc_option_to_scheme;
|
||||
%ignore gnc_option_from_scheme;
|
||||
/* GncOptionDB::register_option comes in GncOption* and GncOption&&
|
||||
* overloads. The latter isn't useful to SWIG, ignore it.
|
||||
*/
|
||||
%ignore GncOptionDB::register_option(const char*, GncOption&&);
|
||||
|
||||
/* The following functions are overloaded in gnc-optiondb.hpp to provide both
|
||||
* GncOptionDB* and GncOptionDBPtr& versions. That confuses SWIG so ignore the
|
||||
* raw-ptr version.
|
||||
|
||||
Reference in New Issue
Block a user