pub struct IniFileSystem { /* private fields */ }
๐Deprecated since 1.2.0: Replaced by dedicated glacier-ini crate
Expand description
A hierarchical file system of IniFile.
example usage:
โ
use std::path::PathBuf;
use rpkg_rs::misc::ini_file_system::IniFileSystem;
let retail_path = PathBuf::from("Path to retail folder");
let thumbs_path = retail_path.join("thumbs.dat");
let thumbs = IniFileSystem::from(&thumbs_path.as_path())?;
let app_options = &thumbs.root()?;
if let (Some(proj_path), Some(runtime_path)) = (app_options.get("PROJECT_PATH"), app_options.get("RUNTIME_PATH")) {
println!("Project path: {}", proj_path);
println!("Runtime path: {}", runtime_path);
}
Implementationsยง
Sourceยงimpl IniFileSystem
impl IniFileSystem
pub fn new() -> Self
๐Deprecated since 1.2.0: Replaced by dedicated glacier-ini crate
Sourcepub fn load(&mut self, root_file: impl AsRef<Path>) -> Result<(), IniFileError>
๐Deprecated since 1.2.0: Replaced by dedicated glacier-ini crate
pub fn load(&mut self, root_file: impl AsRef<Path>) -> Result<(), IniFileError>
Loads an IniFileSystem from the given root file.
pub fn from(root_file: impl AsRef<Path>) -> Result<Self, IniFileError>
๐Deprecated since 1.2.0: Replaced by dedicated glacier-ini crate
pub fn write_to_folder<P: AsRef<Path>>( &self, path: P, ) -> Result<(), IniFileError>
๐Deprecated since 1.2.0: Replaced by dedicated glacier-ini crate
Sourcepub fn normalize(&mut self)
๐Deprecated since 1.2.0: Replaced by dedicated glacier-ini crate
pub fn normalize(&mut self)
Normalizes the IniFileSystem by merging sections and console commands from included files into the root file.
Sourcepub fn console_cmds(&self) -> Vec<String>
๐Deprecated since 1.2.0: Replaced by dedicated glacier-ini crate
pub fn console_cmds(&self) -> Vec<String>
Retrieves all console commands from the IniFileSystem, including those from included files.
Trait Implementationsยง
Sourceยงimpl Debug for IniFileSystem
impl Debug for IniFileSystem
Sourceยงimpl Default for IniFileSystem
impl Default for IniFileSystem
Sourceยงfn default() -> IniFileSystem
fn default() -> IniFileSystem
Returns the โdefault valueโ for a type. Read more
Sourceยงimpl<'de> Deserialize<'de> for IniFileSystem
impl<'de> Deserialize<'de> for IniFileSystem
Sourceยงfn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementationsยง
impl Freeze for IniFileSystem
impl RefUnwindSafe for IniFileSystem
impl Send for IniFileSystem
impl Sync for IniFileSystem
impl Unpin for IniFileSystem
impl UnwindSafe for IniFileSystem
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
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more