MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / parseOption

Method parseOption

other_src/astyle/src/astyle_main.cpp:2461–2911  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2459}
2460
2461void ASOptions::parseOption(const string& arg, const string& errorInfo)
2462{
2463 if ( isOption(arg, "style=allman") || isOption(arg, "style=ansi")
2464 || isOption(arg, "style=bsd") || isOption(arg, "style=break") )
2465 {
2466 formatter.setFormattingStyle(STYLE_ALLMAN);
2467 }
2468 else if ( isOption(arg, "style=java") || isOption(arg, "style=attach") )
2469 {
2470 formatter.setFormattingStyle(STYLE_JAVA);
2471 }
2472 else if ( isOption(arg, "style=k&r") || isOption(arg, "style=kr") || isOption(arg, "style=k/r") )
2473 {
2474 formatter.setFormattingStyle(STYLE_KR);
2475 }
2476 else if ( isOption(arg, "style=stroustrup") )
2477 {
2478 formatter.setFormattingStyle(STYLE_STROUSTRUP);
2479 }
2480 else if ( isOption(arg, "style=whitesmith") )
2481 {
2482 formatter.setFormattingStyle(STYLE_WHITESMITH);
2483 }
2484 else if ( isOption(arg, "style=banner") )
2485 {
2486 formatter.setFormattingStyle(STYLE_BANNER);
2487 }
2488 else if ( isOption(arg, "style=gnu") )
2489 {
2490 formatter.setFormattingStyle(STYLE_GNU);
2491 }
2492 else if ( isOption(arg, "style=linux") )
2493 {
2494 formatter.setFormattingStyle(STYLE_LINUX);
2495 }
2496 else if ( isOption(arg, "style=horstmann") )
2497 {
2498 formatter.setFormattingStyle(STYLE_HORSTMANN);
2499 }
2500 else if ( isOption(arg, "style=1tbs") || isOption(arg, "style=otbs") )
2501 {
2502 formatter.setFormattingStyle(STYLE_1TBS);
2503 }
2504 else if ( isOption(arg, "style=pico") )
2505 {
2506 formatter.setFormattingStyle(STYLE_PICO);
2507 }
2508 else if ( isOption(arg, "style=lisp") || isOption(arg, "style=python") )
2509 {
2510 formatter.setFormattingStyle(STYLE_LISP);
2511 }
2512 else if ( isParamOption(arg, "A") )
2513 {
2514 int style = 0;
2515 string styleParam = getParam(arg, "A");
2516 if (styleParam.length() > 0)
2517 style = atoi(styleParam.c_str());
2518 if (style == 1)

Callers

nothing calls this directly

Calls 15

setFormattingStyleMethod · 0.80
c_strMethod · 0.80
setSharpStyleMethod · 0.80
setModeManuallySetMethod · 0.80
setCStyleMethod · 0.80
setJavaStyleMethod · 0.80
setTabIndentationMethod · 0.80
setSpaceIndentationMethod · 0.80
setNamespaceIndentMethod · 0.80
setClassIndentMethod · 0.80

Tested by

no test coverage detected