#[cfg(target_os = "linux")]
mod linux;
#[cfg(target_os = "macos")]
mod macos;
#[cfg(target_os = "windows")]
mod windows;
#[cfg(not(target_os = "windows"))]
mod unix;
use crate::entry::Entry;
use crate::error::Error;
use crate::walk::StorageHint;
use std::path::Path;
pub fn scan_dir(path: &Path) -> Result<Vec<Entry>, Error> {
scan_dir_prefixed(path, "", StorageHint::Local)
}
pub fn scan_dir_with_hint(path: &Path, hint: StorageHint) -> Result<Vec<Entry>, Error> {
scan_dir_prefixed(path, "", hint)
}
pub(crate) fn scan_dir_prefixed(
path: &Path,
prefix: &str,
hint: StorageHint,
) -> Result<Vec<Entry>, Error> {
#[cfg(target_os = "windows")]
{
windows::scan_dir_platform(path, prefix, hint)
}
#[cfg(target_os = "macos")]
{
macos::scan_dir_platform(path, prefix, hint)
}
#[cfg(target_os = "linux")]
{
linux::scan_dir_platform(path, prefix, hint)
}
#[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "linux")))]
{
unix::scan_dir_platform(path, prefix, hint)
}
}