MCPcopy Create free account
hub / github.com/cselab/aphros / CmdSetNext

Method CmdSetNext

src/parse/parser.cpp:213–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213void Parser::Imp::CmdSetNext(std::string s) {
214 std::string cmd, type, key, val;
215 std::stringstream b(s);
216 b >> std::skipws;
217 b >> cmd >> type >> key;
218 char c;
219 // Read first non-ws character
220 b >> c;
221 // Read remaining string
222 std::getline(b, val);
223 val = c + val;
224
225 if (!var_.Int.Contains(key)) {
226 var_.Int.Set(key, 0);
227 }
228 int& id = var_.Int[key];
229 var_.SetStr(type, key + std::to_string(id), val);
230 ++id;
231}
232
233void Parser::Imp::CmdDel(std::string s) {
234 std::string cmd, key;

Callers

nothing calls this directly

Calls 3

ContainsMethod · 0.80
SetStrMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected