Skip to content

Ciantic/everything-sys-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VoidTools' Everything bindings in Rust

This just wraps the VoidTools' bindings, nothing else.

Example

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*")
}

About

VoidTools' Everything library as Rust crate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published