Skip to content

Commit

Permalink
Add some skeleton functions to make the option-using code in gnucash/…
Browse files Browse the repository at this point in the history
…gnome-utils and gnucash/gnome happy.
  • Loading branch information
jralls committed Aug 1, 2021
1 parent 99103ff commit 1eef796
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
18 changes: 18 additions & 0 deletions libgnucash/app-utils/gnc-optiondb.cpp
Expand Up @@ -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*)
{
}

63 changes: 63 additions & 0 deletions libgnucash/app-utils/gnc-optiondb.h
Expand Up @@ -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
}
Expand Down

0 comments on commit 1eef796

Please sign in to comment.