Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2009, 12:28:59 PM (14 years ago)
Author:
rgrieder
Message:

Renamed CommandLine to CommandLineParse to avoid confusions with the class name.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/CommandLineParser.cc

    r6014 r6021  
    2727 */
    2828
    29 #include "CommandLine.h"
     29#include "CommandLineParser.h"
    3030
    3131#include <algorithm>
     
    8888        Destructor destroys all CommandLineArguments with it.
    8989    */
    90     CommandLine::~CommandLine()
    91     {
    92         CommandLine::destroyAllArguments();
     90    CommandLineParser::~CommandLineParser()
     91    {
     92        CommandLineParser::destroyAllArguments();
    9393    }
    9494
     
    9797        Returns a unique instance (Meyers Singleton).
    9898    */
    99     CommandLine& CommandLine::_getInstance()
    100     {
    101         static CommandLine instance;
     99    CommandLineParser& CommandLineParser::_getInstance()
     100    {
     101        static CommandLineParser instance;
    102102        return instance;
    103103    }
     
    108108        of main. Do not use before that.
    109109    */
    110     void CommandLine::destroyAllArguments()
     110    void CommandLineParser::destroyAllArguments()
    111111    {
    112112        for (std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.begin();
     
    127127        Vector of space separated strings.
    128128    */
    129     void CommandLine::_parse(const std::vector<std::string>& arguments, bool bParsingFile)
     129    void CommandLineParser::_parse(const std::vector<std::string>& arguments, bool bParsingFile)
    130130    {
    131131        try
     
    232232        {
    233233            COUT(0) << "Could not parse command line (including additional files): " << ex.what() << std::endl;
    234             COUT(0) << CommandLine::getUsageInformation() << std::endl;
     234            COUT(0) << CommandLineParser::getUsageInformation() << std::endl;
    235235            throw GeneralException("");
    236236        }
     
    245245        String containing the value
    246246    */
    247     void CommandLine::checkFullArgument(const std::string& name, const std::string& value, bool bParsingFile)
     247    void CommandLineParser::checkFullArgument(const std::string& name, const std::string& value, bool bParsingFile)
    248248    {
    249249        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.find(name);
     
    262262        String containing the value
    263263    */
    264     void CommandLine::checkShortcut(const std::string& shortcut, const std::string& value, bool bParsingFile)
     264    void CommandLineParser::checkShortcut(const std::string& shortcut, const std::string& value, bool bParsingFile)
    265265    {
    266266        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgsShortcut_.find(shortcut);
     
    271271    }
    272272
    273     std::string CommandLine::getUsageInformation()
    274     {
    275         CommandLine& inst = _getInstance();
     273    std::string CommandLineParser::getUsageInformation()
     274    {
     275        CommandLineParser& inst = _getInstance();
    276276        std::ostringstream infoStr;
    277277
     
    315315        You shold of course not call this method before the command line has been parsed.
    316316    */
    317     const CommandLineArgument* CommandLine::getArgument(const std::string& name)
     317    const CommandLineArgument* CommandLineParser::getArgument(const std::string& name)
    318318    {
    319319        std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
     
    332332        Parses only the command line for CommandLineArguments.
    333333    */
    334     void CommandLine::_parseCommandLine(const std::string& cmdLine)
     334    void CommandLineParser::_parseCommandLine(const std::string& cmdLine)
    335335    {
    336336        std::vector<std::string> args;
     
    345345        Parses start.ini (or the file specified with --optionsFile) for CommandLineArguments.
    346346    */
    347     void CommandLine::_parseFile()
    348     {
    349         std::string filename = CommandLine::getValue("optionsFile").getString();
     347    void CommandLineParser::_parseFile()
     348    {
     349        std::string filename = CommandLineParser::getValue("optionsFile").getString();
    350350
    351351        // look for additional arguments in given file or start.ini as default
Note: See TracChangeset for help on using the changeset viewer.