Allow dumping all options in a configuration

This commit is contained in:
Matias Fontanini
2016-06-18 08:23:25 -07:00
parent 2532a2d614
commit 84d98b38e5
6 changed files with 53 additions and 4 deletions

View File

@@ -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();
}