pub struct FileSystem<P: PackFile> { /* private fields */ }Expand description
Core FileSystem representation holding physical directories and loaded pack files.
Implementations§
Source§impl<P: PackFile> FileSystem<P>
impl<P: PackFile> FileSystem<P>
Sourcepub fn load_from_path<G: GameInfoProvider>(
game_path: &Path,
options: &FileSystemOptions,
) -> Option<Self>
pub fn load_from_path<G: GameInfoProvider>( game_path: &Path, options: &FileSystemOptions, ) -> Option<Self>
Loads the filesystem from a specific game directory (where gameinfo.txt resides).
pub fn search_path_dirs(&self) -> &HashMap<String, Vec<PathBuf>>
pub fn search_path_dirs_mut(&mut self) -> &mut HashMap<String, Vec<PathBuf>>
pub fn search_path_vpks(&self) -> &HashMap<String, Vec<Arc<P>>>
pub fn search_path_vpks_mut(&mut self) -> &mut HashMap<String, Vec<Arc<P>>>
pub fn find_file(&self, file_path: &str, search_path: &str) -> Option<PathBuf>
Sourcepub fn read(
&self,
file_path: &str,
search_path: &str,
prioritize_vpks: bool,
) -> Option<Vec<u8>>
pub fn read( &self, file_path: &str, search_path: &str, prioritize_vpks: bool, ) -> Option<Vec<u8>>
Reads data from the internal mounted paths using standard Source Engine priorities.
Sourcepub fn read_for_map(
&self,
map_pack: Option<&P>,
file_path: &str,
search_path: &str,
prioritize_vpks: bool,
) -> Option<Vec<u8>>
pub fn read_for_map( &self, map_pack: Option<&P>, file_path: &str, search_path: &str, prioritize_vpks: bool, ) -> Option<Vec<u8>>
Same as read, but takes an optional active map pack file which gets highest priority.
pub fn read_str( &self, file_path: &str, search_path: &str, prioritize_vpks: bool, ) -> Option<String>
Auto Trait Implementations§
impl<P> Freeze for FileSystem<P>
impl<P> RefUnwindSafe for FileSystem<P>where
P: RefUnwindSafe,
impl<P> Send for FileSystem<P>
impl<P> Sync for FileSystem<P>
impl<P> Unpin for FileSystem<P>
impl<P> UnsafeUnpin for FileSystem<P>
impl<P> UnwindSafe for FileSystem<P>where
P: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more