Setting verse key by text

Add the ability to set a very key by text
Make the main.rs iterate random verses in John 3
This commit is contained in:
Greg Hellings
2025-02-25 00:06:12 -06:00
parent 0c3e46497c
commit 2a890a53cb
6 changed files with 109 additions and 2 deletions
+3 -1
View File
@@ -5,14 +5,16 @@ pub mod ffi {
include!("sword_rs/src/cxx/module.h");
type Mgr;
type Module;
fn new_mgr() -> UniquePtr<Mgr>;
fn new_mgr_with_path(path: &String) -> UniquePtr<Mgr>;
fn get_modules(self: &Mgr) -> Vec<String>;
fn get_module(self: Pin<&mut Mgr>, name: &String) -> UniquePtr<Module>;
type Module;
fn get_name(self: &Module) -> String;
fn set_key_text(self: Pin<&mut Module>, key_text: &String) -> ();
fn strip_text(self: Pin<&mut Module>) -> String;
}
}
+4
View File
@@ -20,4 +20,8 @@ class Module {
(const char*) this->module->stripText()
);
}
void set_key_text(const rust::String& keyText) {
this->module->setKeyText(std::string(keyText).c_str());
}
};