Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions auto/mk-src.in
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,15 @@ class: config
string: key
string: value

method: replace u
posib err
desc => Experimental method that is like replace but will mark
it as being set in an insecure context.
/
void
string: key
string: value

method: remove
posib err
desc => Remove a key and returns TRUE if it exists
Expand Down
9 changes: 9 additions & 0 deletions common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,15 @@ namespace acommon {
return set(entry);
}

PosibErr<void> Config::replace_u(ParmStr key, ParmStr value)
{
Entry * entry = new Entry;
entry->key = key;
entry->value = value;
entry->secure = false;
return set(entry);
}

PosibErr<void> Config::remove(ParmStr key)
{
Entry * entry = new Entry;
Expand Down
5 changes: 5 additions & 0 deletions common/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ namespace acommon {
PosibErr<void> replace(ParmStr, ParmStr);
PosibErr<void> remove(ParmStr);

// replace_u (u is for user value) is like replace except that it
// marks the value as insecure. It should be used when setting a
// config value to anything other than a known constant.
PosibErr<void> replace_u(ParmStr, ParmStr);

bool empty() const {return !first_;}

PosibErr<void> merge(const Config & other);
Expand Down