pub struct IniFile { /* private fields */ }Expand description
Represents a system config file for the Glacier engine
§Example contents
[application]
ForceVSync=0
CapWorkerThreads=1
SCENE_FILE=assembly:/path/to/scene.entity
....
[Hitman5]
usegamecontroller=1
ConsoleCmd UI_EnableMouseEvents 0
....Implementations§
Source§impl IniFile
impl IniFile
pub fn new(name: &str) -> Self
pub fn name(&self) -> String
pub fn sections(&self) -> &HashMap<String, IniFileSection>
pub fn includes(&self) -> &Vec<IniFile>
pub fn get_or_add_include(&mut self, include_name: &str) -> &mut IniFile
pub fn find_include(&self, include_name: &str) -> Option<&IniFile>
pub fn find_include_mut(&mut self, include_name: &str) -> Option<&mut IniFile>
pub fn get_option( &self, section_name: &str, option_name: &str, ) -> Result<String, IniFileError>
pub fn set_description(&mut self, description: &str)
pub fn with_description(&mut self, description: &str) -> &mut Self
pub fn with_command(&mut self, command: &str) -> &mut Self
pub fn add_section(&mut self, section: IniFileSection)
pub fn with_section(&mut self, name: &str) -> &mut IniFileSection
pub fn add_new_section( &mut self, section_name: &str, values: Option<Vec<(&str, &str)>>, )
pub fn section(&self, name: &str) -> Option<&IniFileSection>
pub fn section_mut(&mut self, name: &str) -> Option<&mut IniFileSection>
pub fn set_value( &mut self, section_name: &str, option_name: &str, value: &str, ) -> Result<(), IniFileError>
pub fn push_console_command(&mut self, command: String)
pub fn add_include(&mut self, include: IniFile) -> Result<(), IniFileError>
pub fn console_cmds(&self) -> &Vec<String>
pub fn write_to_file<W: Write>( &self, writer: &mut W, xtea: &Xtea, ) -> Result<(), IniFileError>
Trait Implementations§
impl Eq for IniFile
Source§impl Index<&str> for IniFile
impl Index<&str> for IniFile
Source§type Output = IniFileSection
type Output = IniFileSection
The returned type after indexing.
impl StructuralPartialEq for IniFile
Auto Trait Implementations§
impl Freeze for IniFile
impl RefUnwindSafe for IniFile
impl Send for IniFile
impl Sync for IniFile
impl Unpin for IniFile
impl UnsafeUnpin for IniFile
impl UnwindSafe for IniFile
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.