MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / ParseParameters

Function ParseParameters

src/util.cpp:337–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337void ParseParameters(int argc, const char* const argv[])
338{
339 mapArgs.clear();
340 mapMultiArgs.clear();
341
342 for (int i = 1; i < argc; i++)
343 {
344 std::string str(argv[i]);
345 std::string strValue;
346 size_t is_index = str.find('=');
347 if (is_index != std::string::npos)
348 {
349 strValue = str.substr(is_index+1);
350 str = str.substr(0, is_index);
351 }
352#ifdef WIN32
353 boost::to_lower(str);
354 if (boost::algorithm::starts_with(str, "/"))
355 str = "-" + str.substr(1);
356#endif
357
358 if (str[0] != '-')
359 break;
360
361 // Interpret --foo as -foo.
362 // If both --foo and -foo are set, the last takes effect.
363 if (str.length() > 1 && str[1] == '-')
364 str = str.substr(1);
365 InterpretNegativeSetting(str, strValue);
366
367 mapArgs[str] = strValue;
368 mapMultiArgs[str].push_back(strValue);
369 }
370}
371
372std::string GetArg(const std::string& strArg, const std::string& strDefault)
373{

Callers 6

AppInitRawTxFunction · 0.85
AppInitRPCFunction · 0.85
AppInitFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
ResetArgsFunction · 0.85
mainFunction · 0.85

Calls 4

InterpretNegativeSettingFunction · 0.85
findMethod · 0.80
clearMethod · 0.45
push_backMethod · 0.45

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.68
ResetArgsFunction · 0.68