mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-26 06:07:45 +00:00
Improve CFG documentation
This commit is contained in:
parent
2ded1ac2a0
commit
2f29b8eeae
1 changed files with 3 additions and 0 deletions
|
@ -78,6 +78,7 @@ impl ConfigFile {
|
|||
Some(buffer)
|
||||
}
|
||||
|
||||
/// Checks if the CFG contains a key named `select_key`
|
||||
pub fn has_key(&self, select_key: &str) -> bool {
|
||||
for (_, keys) in &self.settings {
|
||||
for (key, _) in &keys.keys {
|
||||
|
@ -90,6 +91,7 @@ impl ConfigFile {
|
|||
false
|
||||
}
|
||||
|
||||
/// Checks if the CFG contains a category named `select_category`
|
||||
pub fn has_category(&self, select_category: &str) -> bool {
|
||||
for (category, _) in &self.settings {
|
||||
if select_category == category {
|
||||
|
@ -100,6 +102,7 @@ impl ConfigFile {
|
|||
false
|
||||
}
|
||||
|
||||
/// Sets the value to `new_value` of `select_key`
|
||||
pub fn set_value(&mut self, select_key: &str, new_value: &str) {
|
||||
for (_, keys) in &mut self.settings {
|
||||
for (key, value) in &mut keys.keys {
|
||||
|
|
Loading…
Add table
Reference in a new issue