Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 5, 2015, 5:32:40 PM (9 years ago)
Author:
landauf
Message:

wrap CommandLineArguments in StaticallyInitializedInstances

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/commandline/CommandLineParser.cc

    r10343 r10345  
    338338        }
    339339    }
     340
     341    /**
     342    @brief
     343        Adds a new CommandLineArgument to the internal map.
     344        Note that only such arguments are actually valid.
     345    */
     346    void CommandLineParser::addArgument(CommandLineArgument* argument)
     347    {
     348        OrxAssert(!_getInstance().existsArgument(argument->getName()),
     349            "Cannot add a command line argument with name '" + argument->getName() + "' twice.");
     350        OrxAssert(!argument->getDefaultValue().isType<bool>() || argument->getDefaultValue().get<bool>() != true,
     351               "Boolean command line arguments with positive default values are not supported." << endl
     352            << "Please use SetCommandLineSwitch and adjust your argument: " << argument->getName());
     353
     354        _getInstance().cmdLineArgs_[argument->getName()] = argument;
     355    }
    340356}
Note: See TracChangeset for help on using the changeset viewer.