Now with formatting available

This commit is contained in:
Greg Hellings
2025-02-25 14:55:39 -06:00
parent be7d2873e6
commit 0c7843b386
6 changed files with 26 additions and 11 deletions
+1
View File
@@ -15,6 +15,7 @@ pub mod ffi {
type Module;
fn get_name(self: &Module) -> String;
fn render_text(self: Pin<&mut Module>) -> String;
fn set_key_text(self: Pin<&mut Module>, key_text: &String) -> ();
fn strip_text(self: Pin<&mut Module>) -> String;
}
+10 -4
View File
@@ -7,13 +7,19 @@ namespace sword_rs {
return rust::String(this->module->getName());
}
rust::String Module::render_text() {
return std::string(
(const char*) this->module->renderText()
);
}
void Module::set_key_text(const rust::String& keyText) {
this->module->setKeyText(std::string(keyText).c_str());
}
rust::String Module::strip_text() {
return std::string(
(const char*) this->module->stripText()
);
}
void Module::set_key_text(const rust::String& keyText) {
this->module->setKeyText(std::string(keyText).c_str());
}
}
+3 -1
View File
@@ -15,8 +15,10 @@ namespace sword_rs {
rust::String get_name() const;
rust::String strip_text();
rust::String render_text();
void set_key_text(const rust::String& keyText);
rust::String strip_text();
};
}