diff --git a/libgnucash/app-utils/gnc-optiondb.cpp b/libgnucash/app-utils/gnc-optiondb.cpp index 0dcaa917bf..def04f72ab 100644 --- a/libgnucash/app-utils/gnc-optiondb.cpp +++ b/libgnucash/app-utils/gnc-optiondb.cpp @@ -1142,3 +1142,21 @@ void gnc_option_db_book_options(GncOptionDB*) { } + +const QofInstance* +gnc_option_db_lookup_qofinstance_value(GncOptionDB*, const char*, const char*) +{ + return nullptr; +} + +GList* +gnc_option_db_lookup_glist_value(GncOptionDB*, const char*, const char*) +{ + return nullptr; +} + +void +gnc_option_db_set_glist_value(GncOptionDB*, const char*, const char*, GList*) +{ +} + diff --git a/libgnucash/app-utils/gnc-optiondb.h b/libgnucash/app-utils/gnc-optiondb.h index 3b86dbfea8..f4b3d4246c 100644 --- a/libgnucash/app-utils/gnc-optiondb.h +++ b/libgnucash/app-utils/gnc-optiondb.h @@ -104,7 +104,70 @@ void gnc_option_db_save(GncOptionDB* odb, QofBook* book, */ void gnc_option_db_book_options(GncOptionDB*); +/** + * Retrieve the string value of an option in the GncOptionDB + * + * @param odb the GncOptionDB + * @param section the section in which the option is stored + * @param name the option name + * @return the static char* of the value or nullptr if the option isn't found + * or if its value isn't a string. + */ +const char* gnc_option_db_lookup_string_value(GncOptionDB*, const char*, + const char*); +/** + * Set the string value of an option in the GncOptionDB. + * + * The value will not be saved if the option is not in the GncOptionDB or if the + * type of the option isn't string or text. + * + * @param odb the GncOptionDB + * @param section the section in which the option is stored + * @param name the option name + * @param value the value to be stored in the option. + */ +void gnc_option_db_set_string_value(GncOptionDB*, const char*, + const char*, const char*); + +/** + * Retrieve the string value of an option in the GncOptionDB + * + * @param odb the GncOptionDB + * @param section the section in which the option is stored + * @param name the option name + * @return the const QofInstance* of the value or nullptr if the option isn't + * found or if its value isn't a QofInstance*. + */ + +const QofInstance* gnc_option_db_lookup_qofinstance_value(GncOptionDB*, + const char*, + const char*); + +/** + * Retrieve the GList* value of an option in the GncOptionDB + * + * @param odb the GncOptionDB + * @param section the section in which the option is stored + * @param name the option name + * @return the GList* of the value or nullptr if the option isn't found + * or if its value isn't a string. + */ +GList* gnc_option_db_lookup_glist_value(GncOptionDB*, const char*, const char*); + +/** + * Set the GList* value of an option in the GncOptionDB. + * + * The value will not be saved if the option is not in the GncOptionDB or if the + * type of the option isn't string or text. + * + * @param odb the GncOptionDB + * @param section the section in which the option is stored + * @param name the option name + * @param value the value to be stored in the option. + */ +void gnc_option_db_set_glist_value(GncOptionDB*, const char*, + const char*, GList*); #ifdef __cplusplus }