mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(config): add ability to set value of multivar variable
This commit is contained in:
parent
6a08a7b803
commit
7bea406ab9
3 changed files with 51 additions and 6 deletions
|
@ -113,7 +113,7 @@ class Config {
|
|||
/// Map of key/value entries from config file.
|
||||
Map<String, dynamic> variables = {};
|
||||
|
||||
/// Sets value of config key
|
||||
/// Sets the [value] of config [key]
|
||||
void setVariable(String key, dynamic value) {
|
||||
try {
|
||||
if (value.runtimeType == bool) {
|
||||
|
@ -150,6 +150,15 @@ class Config {
|
|||
return config.getMultivar(configPointer.value, key, regexp);
|
||||
}
|
||||
|
||||
/// Sets the [value] of a multivar [key] in the config file with the
|
||||
/// highest level (usually the local one).
|
||||
///
|
||||
/// The [regexp] is applied case-sensitively on the value.
|
||||
/// Empty [regexp] sets [value] for all values of a multivar [key]
|
||||
void setMultivar(String key, String regexp, String value) {
|
||||
config.setMultivar(configPointer.value, key, regexp, value);
|
||||
}
|
||||
|
||||
/// Releases memory allocated for config object.
|
||||
void close() {
|
||||
calloc.free(configPointer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue