mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-01 02:57:53 +00:00
Allow dumping all options in a configuration
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#define CPPKAFKA_CONFIGURATION_BASE_H
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
namespace cppkafka {
|
||||
|
||||
@@ -59,6 +60,14 @@ public:
|
||||
void set(const std::string& name, const char* value) {
|
||||
proxy_set(name, value);
|
||||
}
|
||||
protected:
|
||||
static std::map<std::string, std::string> parse_dump(const char** values, size_t count) {
|
||||
std::map<std::string, std::string> output;
|
||||
for (size_t i = 0; i < count; i += 2) {
|
||||
output[values[i]] = values[i + 1];
|
||||
}
|
||||
return output;
|
||||
}
|
||||
private:
|
||||
void proxy_set(const std::string& name, const std::string& value) {
|
||||
static_cast<Concrete&>(*this).set(name, value);
|
||||
|
||||
Reference in New Issue
Block a user