* Build the vector of pre-command headers. * Used by BOTH ASFormatter.cpp and ASBeautifier.cpp. * NOTE: Cannot be both a header and a preCommandHeader. * * A preCommandHeader is in a function definition between * the closing paren and the opening bracket. * e.g. in "void foo() const {}", "const" is a preCommandHeader. */
| 473 | * e.g. in "void foo() const {}", "const" is a preCommandHeader. |
| 474 | */ |
| 475 | void ASResource::buildPreCommandHeaders(vector<const string*>* preCommandHeaders, int fileType) |
| 476 | { |
| 477 | if (fileType == C_TYPE) |
| 478 | { |
| 479 | preCommandHeaders->push_back(&AS_CONST); |
| 480 | preCommandHeaders->push_back(&AS_VOLATILE); |
| 481 | preCommandHeaders->push_back(&AS_SEALED); // Visual C only |
| 482 | preCommandHeaders->push_back(&AS_OVERRIDE); // Visual C only |
| 483 | } |
| 484 | |
| 485 | if (fileType == JAVA_TYPE) |
| 486 | { |
| 487 | preCommandHeaders->push_back(&AS_THROWS); |
| 488 | } |
| 489 | |
| 490 | if (fileType == SHARP_TYPE) |
| 491 | { |
| 492 | preCommandHeaders->push_back(&AS_WHERE); |
| 493 | } |
| 494 | |
| 495 | sort(preCommandHeaders->begin(), preCommandHeaders->end(), sortOnName); |
| 496 | } |
| 497 | |
| 498 | /** |
| 499 | * Build the vector of pre-definition headers. |
nothing calls this directly
no outgoing calls
no test coverage detected