mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Instantiate GncOption::set_option for guile, initial types string and int.
For proof-of-concept. Guile obviously doesn't know about templates.
This commit is contained in:
parent
9cdcaf0da8
commit
cee3cdaff9
@ -51,5 +51,9 @@ extern "C" SCM scm_init_sw_gnc_optiondb_module(void);
|
|||||||
%ignore GncOption;
|
%ignore GncOption;
|
||||||
|
|
||||||
wrap_unique_ptr(GncOptionDBPtr, GncOptionDB);
|
wrap_unique_ptr(GncOptionDBPtr, GncOptionDB);
|
||||||
|
|
||||||
%include "gnc-optiondb.hpp"
|
%include "gnc-optiondb.hpp"
|
||||||
|
|
||||||
|
%extend GncOptionDB {
|
||||||
|
%template(set_option_string) set_option<std::string>;
|
||||||
|
%template(set_option_int) set_option<int>;
|
||||||
|
};
|
||||||
|
@ -40,6 +40,10 @@
|
|||||||
(let* ((option-db (gnc-option-db-new))
|
(let* ((option-db (gnc-option-db-new))
|
||||||
(string-opt (gnc-register-string-option option-db "foo" "bar" "baz"
|
(string-opt (gnc-register-string-option option-db "foo" "bar" "baz"
|
||||||
"Phony Option" "waldo")))
|
"Phony Option" "waldo")))
|
||||||
(test-equal (GncOptionDB-lookup-option (GncOptionDBPtr-get option-db) "foo" "bar") "waldo"))
|
(test-equal "waldo" (GncOptionDB-lookup-option
|
||||||
|
(GncOptionDBPtr-get option-db) "foo" "bar"))
|
||||||
|
|
||||||
|
(GncOptionDB-set-option-string (GncOptionDBPtr-get option-db) "foo" "bar" "pepper")
|
||||||
|
(test-equal "pepper" (GncOptionDB-lookup-option
|
||||||
|
(GncOptionDBPtr-get option-db) "foo" "bar")))
|
||||||
(test-end "test-gnc-make-string-option"))
|
(test-end "test-gnc-make-string-option"))
|
||||||
|
Loading…
Reference in New Issue
Block a user