diff options
author | Jack Lloyd <[email protected]> | 2017-10-02 22:07:57 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-10-02 22:45:20 -0400 |
commit | 34868d4c4b91227db472aa294dfeb6d9075ec056 (patch) | |
tree | 6e43fb977b89de43de246c52d18eeb1442081018 /src/lib/tls/tls_text_policy.cpp | |
parent | 40ec27f8a12e18e7eb17df4ff5874f3bb66987c5 (diff) |
Make kv in TLS_Text_Policy private, add protected setter
Diffstat (limited to 'src/lib/tls/tls_text_policy.cpp')
-rw-r--r-- | src/lib/tls/tls_text_policy.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/tls/tls_text_policy.cpp b/src/lib/tls/tls_text_policy.cpp index 6b3b5af1d..ef5799339 100644 --- a/src/lib/tls/tls_text_policy.cpp +++ b/src/lib/tls/tls_text_policy.cpp @@ -252,6 +252,17 @@ std::string Text_Policy::get_str(const std::string& key, const std::string& def) return i->second; } +bool Text_Policy::set_value(const std::string& key, const std::string& val, bool overwrite) + { + auto i = m_kv.find(key); + + if(overwrite == false && i != m_kv.end()) + return false; + + m_kv.insert(i, std::make_pair(key, val)); + return true; + } + } } |