MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / parseSwitches

Method parseSwitches

src/jrd/svc.cpp:350–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348}
349
350void Service::parseSwitches()
351{
352 svc_parsed_sw = svc_switches;
353 svc_parsed_sw.trim();
354 argv.clear();
355 argv.push("service"); // why not use it for argv[0]
356
357 if (svc_parsed_sw.isEmpty())
358 {
359 return;
360 }
361
362 bool inStr = false;
363 for (FB_SIZE_T i = 0; i < svc_parsed_sw.length(); ++i)
364 {
365 switch (svc_parsed_sw[i])
366 {
367 case SVC_TRMNTR:
368 svc_parsed_sw.erase(i, 1);
369 if (inStr)
370 {
371 if (i < svc_parsed_sw.length() && svc_parsed_sw[i] != SVC_TRMNTR)
372 {
373 inStr = false;
374 --i;
375 }
376 }
377 else
378 {
379 inStr = true;
380 --i;
381 }
382 break;
383
384 case ' ':
385 if (!inStr)
386 {
387 svc_parsed_sw[i] = 0;
388 }
389 break;
390 }
391 }
392
393 argv.push(svc_parsed_sw.c_str());
394
395 for (const char* p = svc_parsed_sw.begin(); p < svc_parsed_sw.end(); ++p)
396 {
397 if (!*p)
398 {
399 argv.push(p + 1);
400 }
401 }
402}
403
404void Service::outputVerbose(const char* text)
405{

Callers

nothing calls this directly

Calls 9

trimMethod · 0.45
clearMethod · 0.45
pushMethod · 0.45
isEmptyMethod · 0.45
lengthMethod · 0.45
eraseMethod · 0.45
c_strMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected