output/ao: use IterableSplitString() instead of SplitString()
This commit is contained in:
parent
747436b17e
commit
ae4fd576bf
|
@ -22,7 +22,7 @@
|
|||
#include "thread/SafeSingleton.hxx"
|
||||
#include "system/Error.hxx"
|
||||
#include "util/DivideString.hxx"
|
||||
#include "util/SplitString.hxx"
|
||||
#include "util/IterableSplitString.hxx"
|
||||
#include "util/RuntimeError.hxx"
|
||||
#include "util/Domain.hxx"
|
||||
#include "util/StringAPI.hxx"
|
||||
|
@ -122,14 +122,16 @@ AoOutput::AoOutput(const ConfigBlock &block)
|
|||
|
||||
value = block.GetBlockValue("options", nullptr);
|
||||
if (value != nullptr) {
|
||||
for (const auto &i : SplitString(value, ';')) {
|
||||
const DivideString ss(i.c_str(), '=', true);
|
||||
for (StringView i : IterableSplitString(value, ';')) {
|
||||
i.Strip();
|
||||
|
||||
if (!ss.IsDefined())
|
||||
throw FormatRuntimeError("problems parsing options \"%s\"",
|
||||
i.c_str());
|
||||
auto s = i.Split('=');
|
||||
if (s.first.empty() || s.second.IsNull())
|
||||
throw FormatRuntimeError("problems parsing option \"%.*s\"",
|
||||
int(i.size), i.data);
|
||||
|
||||
ao_append_option(&options, ss.GetFirst(), ss.GetSecond());
|
||||
const std::string n(s.first), v(s.second);
|
||||
ao_append_option(&options, n.c_str(), v.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue