MCPcopy Create free account
hub / github.com/PiSCSI/piscsi / ParseParameters

Method ParseParameters

cpp/shared/protobuf_util.cpp:25–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23#define FPRT(fp, ...) fprintf(fp, __VA_ARGS__ )
24
25void protobuf_util::ParseParameters(PbDeviceDefinition& device, const string& params)
26{
27 if (params.empty()) {
28 return;
29 }
30
31 // Old style parameter (filename), for backwards compatibility only
32 if (params.find(KEY_VALUE_SEPARATOR) == string::npos) {
33 SetParam(device, "file", params);
34
35 return;
36 }
37
38 for (const auto& p : Split(params, COMPONENT_SEPARATOR)) {
39 if (const auto& param = Split(p, KEY_VALUE_SEPARATOR, 2); param.size() == 2) {
40 SetParam(device, param[0], param[1]);
41 }
42 }
43}
44
45string protobuf_util::SetCommandParams(PbCommand& command, const string& params)
46{

Callers

nothing calls this directly

Calls 1

SetParamFunction · 0.85

Tested by

no test coverage detected