Struct allegro::Config
[−]
[src]
pub struct Config { /* fields omitted */ }
Allegro configuration.
Wraps ALLEGRO_CONFIG.
Methods
impl Config
[src]
fn new() -> Config
Creates an empty configuration.
fn load(path: &str) -> Result<Config, ()>
Loads a config from a path.
fn merge(cfg1: &Config, cfg2: &Config) -> Config
Merge two configs into 1.
fn get_allegro_config(&self) -> *mut ALLEGRO_CONFIG
Returns the wrapped ALLEGRO_CONFIG.
fn save(&self, path: &str) -> Result<(), ()>
Loads a config from a path.
fn add_section(&mut self, name: &str)
Adds an empty section with the specified name.
fn remove_section(&mut self, name: &str) -> bool
Removes a section with the specified name.
fn set_value(&mut self, section: &str, key: &str, value: &str)
Sets the value of a key in a section.
fn remove_key(&mut self, section: &str, key: &str) -> bool
Removes a key with the specified name.
fn add_comment(&mut self, section: &str, comment: &str)
Adds a comment to a section.
fn get_value(&self, section: &str, key: &str) -> Option<String>
Gets a value from a section.
fn merge_from(&mut self, source: &Config)
Merge in sections from a different config.
fn sections<'l>(&'l self) -> ConfigSection<'l>
Returns an iterator over all the sections in the config. The first returned section will typically be the root section, even if it's empty.
fn keys<'l>(&'l self, section: &str) -> ConfigEntry<'l>
Returns an iterator over all the entries in a particular section.
Trait Implementations
impl Clone for Config
[src]
fn clone(&self) -> Config
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more