389{
391
392 if (command == macroPathCommand) {
395 }
396 if (command == ExecuteCommand) {
403 }
404 }
405 if (command == suppressAbortionCommand) {
408 }
409 if (command == verboseCommand) {
411 }
412 if (command == doublePrecCommand) {
414 }
415 if (command == historyCommand) {
417 }
418 if (command == stopStoreHistoryCommand) {
420 }
421 if (command == ManualCommand) {
423 }
424 if (command == aliasCommand) {
426 }
427 if (command == unaliasCommand) {
429 }
430 if (command == listAliasCommand) {
432 }
433 if (command == getEnvCmd) {
435 if (std::getenv(newValue) != nullptr) {
437 st += " ";
438 st += std::getenv(newValue);
440 }
441 else {
443 ed << "<" << newValue << "> is not defined as a shell variable. Command ignored.";
445 }
446 }
447 if (command == getValCmd) {
452 if (!(curVal.empty())) {
455 if (!(iIdx.empty())) {
458 for (
G4int i = 0; i <= idx; i++) {
459 theValue = nextVal();
460 }
461 }
463 st += aliName + " " + theValue;
465 }
466 }
467 if (command == echoCmd) {
469 }
470 if (command == shellCommand) {
472 int rc = system(newValue);
473 if (rc < 0) {
475 ed << "<" << newValue << "> is not a valid shell command. Command ignored.";
477 }
478 }
479 if (command == loopCommand) {
486 }
487 }
488 if (command == foreachCommand) {
495 }
496 }
497 if (command == HTMLCommand) {
499 }
500 if (command == maxStoredHistCommand) {
502 }
503 if (command == ifCommand) {
510 if (comp == ">") {
511 x = (l > r);
512 }
513 else if (comp == ">=") {
514 x = (l >= r);
515 }
516 else if (comp == "<") {
517 x = (l < r);
518 }
519 else if (comp == "<=") {
520 x = (l <= r);
521 }
522 else if (comp == "==") {
523 x = (l == r);
524 }
525 else if (comp == "!=") {
526 x = (l != r);
527 }
528 if (x) {
530 }
531 }
532 if (command == doifCommand) {
537
540 while (!((ca = next()).empty())) {
541 c1 += " ";
542 c1 += ca;
543 }
544 if (c1[0] == '"') {
546 if (c1.back() == '"') {
547 strippedValue = c1.substr(1, c1.length() - 2);
548 }
549 else {
550 strippedValue = c1.substr(1, c1.length() - 1);
551 }
552 c1 = strippedValue;
553 }
554
556 if (comp == ">") {
557 x = (l > r);
558 }
559 else if (comp == ">=") {
560 x = (l >= r);
561 }
562 else if (comp == "<") {
563 x = (l < r);
564 }
565 else if (comp == "<=") {
566 x = (l <= r);
567 }
568 else if (comp == "==") {
569 x = (l == r);
570 }
571 else if (comp == "!=") {
572 x = (l != r);
573 }
574 if (x) {
576 }
577 }
578 if (command == addCommand) {
584 st += newA;
585 st += " ";
588 }
589 if (command == subtractCommand) {
595 st += newA;
596 st += " ";
599 }
600 if (command == multiplyCommand) {
606 st += newA;
607 st += " ";
610 }
611 if (command == divideCommand) {
617 st += newA;
618 st += " ";
621 }
622 if (command == remainderCommand) {
628 st += newA;
629 st += " ";
632 }
633 if (command == strifCommand) {
640 if (comp == "==") {
641 x = (l == r);
642 }
643 else if (comp == "!=") {
644 x = (l != r);
645 }
646 if (x) {
648 }
649 }
650 if (command == strdoifCommand) {
655
658 while (!((ca = next()).empty())) {
659 c1 += " ";
660 c1 += ca;
661 }
662 if (c1[0] == '"') {
664 if (c1.back() == '"') {
665 strippedValue = c1.substr(1, c1.length() - 2);
666 }
667 else {
668 strippedValue = c1.substr(1, c1.length() - 1);
669 }
670 c1 = strippedValue;
671 }
672
674 if (comp == "==") {
675 x = (l == r);
676 }
677 else if (comp == "!=") {
678 x = (l != r);
679 }
680 if (x) {
682 }
683 }
684 if (command == ifBatchCommand) {
687 }
688 }
689 if (command == ifInteractiveCommand) {
692 }
693 }
694 if (command == doifBatchCommand) {
697 }
698 }
699 if (command == doifInteractiveCommand) {
702 }
703 }
704}
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
void SetSuppressAbortion(G4int i)
static G4bool GetNewBoolValue(const char *paramString)
static G4int GetNewIntValue(const char *paramString)
void CommandFailed(G4int errCode, G4ExceptionDescription &ed)
static void UseDoublePrecisionStr(G4bool val)
void ForeachS(const char *valueList)
G4int ApplyCommand(const char *aCommand)
void CreateHTML(const char *dir="/")
void LoopS(const char *valueList)
void StoreHistory(const char *fileName="G4history.macro")
void ListCommands(const char *direc)
void ExecuteMacroFile(const char *fileName)
void SetMacroSearchPath(const G4String &path)
void SetMaxHistSize(G4int mx)
G4int GetLastReturnCode() const
G4String GetCurrentValues(const char *aCommand)
void SetAlias(const char *aliasLine)
G4String FindMacroPath(const G4String &fname) const
void RemoveAlias(const char *aliasName)
G4String SolveAlias(const char *aCmd)
void ParseMacroSearchPath()
void SetVerboseLevel(G4int val)
G4double StoD(const G4String &s)
G4String DtoS(G4double a)
G4int StoI(const G4String &s)