mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-24 05:34:51 +00:00
Allow dumping all options in a configuration
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "buffer.h"
|
||||
|
||||
using std::string;
|
||||
using std::map;
|
||||
using std::vector;
|
||||
|
||||
namespace cppkafka {
|
||||
@@ -106,6 +107,14 @@ string TopicConfiguration::get(const string& name) const {
|
||||
return string(buffer.data());
|
||||
}
|
||||
|
||||
map<string, string> TopicConfiguration::get_all() const {
|
||||
size_t count = 0;
|
||||
const char** all = rd_kafka_topic_conf_dump(handle_.get(), &count);
|
||||
map<string, string> output = parse_dump(all, count);
|
||||
rd_kafka_conf_dump_free(all, count);
|
||||
return output;
|
||||
}
|
||||
|
||||
rd_kafka_topic_conf_t* TopicConfiguration::get_handle() const {
|
||||
return handle_.get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user