mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Add Delete operation to IConfigurationProvider
This commit is contained in:
1 parent
256ed1e562
commit
441f302bf9
2 files changed
+10
No files matched your search
@@ -12,6 +12,8 @@ namespace BepInEx.Configuration
|
||||
ConfigurationNode Get(string[] path);
|
||||
|
||||
void Set(string[] path, ConfigurationNode node);
|
||||
|
||||
ConfigurationNode Delete(string[] path);
|
||||
|
||||
IEnumerable<string[]> EntryPaths { get; }
|
||||
}
|
||||
|
||||
@@ -79,6 +79,14 @@ namespace BepInEx.Configuration
|
||||
|
||||
public void Set(string[] path, ConfigurationNode node) => items[path] = node.Value;
|
||||
|
||||
public ConfigurationNode Delete(string[] path)
|
||||
{
|
||||
var val = Get(path);
|
||||
if (val == null) return null;
|
||||
items.Remove(path);
|
||||
return val;
|
||||
}
|
||||
|
||||
public IEnumerable<string[]> EntryPaths => items.Keys.ToList();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user