C++: Update InputFormat::get_options for latest version of input API.
This commit is contained in:
parent
43942280bb
commit
7f5a036750
|
@ -1130,14 +1130,13 @@ string InputFormat::get_description()
|
||||||
|
|
||||||
map<string, shared_ptr<Option>> InputFormat::get_options()
|
map<string, shared_ptr<Option>> InputFormat::get_options()
|
||||||
{
|
{
|
||||||
const struct sr_option *option = sr_input_options_get(structure);
|
const struct sr_option **options = sr_input_options_get(structure);
|
||||||
auto option_array = shared_ptr<const struct sr_option>(
|
auto option_array = shared_ptr<const struct sr_option *>(
|
||||||
option, [=](const struct sr_option *) {
|
options, sr_input_options_free);
|
||||||
sr_input_options_free(structure); });
|
|
||||||
map<string, shared_ptr<Option>> result;
|
map<string, shared_ptr<Option>> result;
|
||||||
for (; option->id; option++)
|
for (int i = 0; options[i]; i++)
|
||||||
result[option->id] = shared_ptr<Option>(
|
result[options[i]->id] = shared_ptr<Option>(
|
||||||
new Option(option, option_array), Option::Deleter());
|
new Option(options[i], option_array), Option::Deleter());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue