Crates.io | everything-sys |
lib.rs | everything-sys |
version | 0.1.4 |
source | src |
created_at | 2021-02-25 19:57:56.988529 |
updated_at | 2021-02-27 11:51:40.529803 |
description | VoidTools' Everything C-bindings in Rust |
homepage | |
repository | https://github.com/Ciantic/everything-sys-rs/ |
max_upload_size | |
id | 360670 |
size | 155,943 |
This just wraps the VoidTools' bindings, nothing else.
This example requires widestring
package along with everything-sys
. This
same example can be found from examples
directory.
use everything_sys::*;
use widestring::U16CString;
pub fn search(query: &str) {
unsafe {
let query_as_wchar = U16CString::from_str(query).unwrap();
Everything_SetSearchW(query_as_wchar.as_ptr());
if Everything_QueryW(1) == 1 {
let res = Everything_GetNumResults();
for i in 0..res {
let filename =
U16CString::from_ptr_str(Everything_GetResultFileNameW(i)).to_string_lossy();
let path = U16CString::from_ptr_str(Everything_GetResultPathW(i)).to_string_lossy();
println!("{} {}", path, filename);
}
}
}
}
pub fn main() {
search("notepad*")
}