Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 25, 2009, 10:23:58 PM (15 years ago)
Author:
rgrieder
Message:

Merged presentation2 branch back to trunk.
Major new features:

  • Actual GUI with settings, etc.
  • Improved space ship steering (human interaction)
  • Rocket fire and more particle effects
  • Advanced sound framework
Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/CommandLineParser.cc

    r6021 r6417  
    6363                this->value_ = temp;
    6464            }
    65             else if (value == "")
     65            else if (value.empty())
    6666            {
    6767                this->bHasDefaultValue_ = false;
     
    140140                    OrxAssert(cmdLineArgsShortcut_.find(it->second->getShortcut()) == cmdLineArgsShortcut_.end(),
    141141                        "Cannot have two command line shortcut with the same name.");
    142                     if (it->second->getShortcut() != "")
     142                    if (!it->second->getShortcut().empty())
    143143                        cmdLineArgsShortcut_[it->second->getShortcut()] = it->second;
    144144                }
     
    165165                        {
    166166                            // negative number as a value
    167                             value += arguments[i] + " ";
     167                            value += arguments[i] + ' ';
    168168                        }
    169169                        else
     
    173173                            // save old data first
    174174                            value = removeTrailingWhitespaces(value);
    175                             if (name != "")
     175                            if (!name.empty())
    176176                            {
    177177                                checkFullArgument(name, value, bParsingFile);
    178                                 name = "";
    179                                 assert(shortcut == "");
     178                                name.clear();
     179                                assert(shortcut.empty());
    180180                            }
    181                             else if (shortcut != "")
     181                            else if (!shortcut.empty())
    182182                            {
    183183                                checkShortcut(shortcut, value, bParsingFile);
    184                                 shortcut = "";
    185                                 assert(name == "");
     184                                shortcut.clear();
     185                                assert(name.empty());
    186186                            }
    187187
     
    198198
    199199                            // reset value string
    200                             value = "";
     200                            value.clear();
    201201                        }
    202202                    }
     
    205205                        // value string
    206206
    207                         if (name == "" && shortcut == "")
     207                        if (name.empty() && shortcut.empty())
    208208                        {
    209209                            ThrowException(Argument, "Expected \"-\" or \"-\" in command line arguments.\n");
     
    218218            // parse last argument
    219219            value = removeTrailingWhitespaces(value);
    220             if (name != "")
     220            if (!name.empty())
    221221            {
    222222                checkFullArgument(name, value, bParsingFile);
    223                 assert(shortcut == "");
    224             }
    225             else if (shortcut != "")
     223                assert(shortcut.empty());
     224            }
     225            else if (!shortcut.empty())
    226226            {
    227227                checkShortcut(shortcut, value, bParsingFile);
    228                 assert(name == "");
     228                assert(name.empty());
    229229            }
    230230        }
     
    291291            it != inst.cmdLineArgs_.end(); ++it)
    292292        {
    293             if (it->second->getShortcut() != "")
     293            if (!it->second->getShortcut().empty())
    294294                infoStr << " [-" << it->second->getShortcut() << "] ";
    295295            else
    296296                infoStr << "      ";
    297             infoStr << "--" << it->second->getName() << " ";
     297            infoStr << "--" << it->second->getName() << ' ';
    298298            if (it->second->getValue().getType() != MT_Type::Bool)
    299299                infoStr << "ARG ";
     
    347347    void CommandLineParser::_parseFile()
    348348    {
    349         std::string filename = CommandLineParser::getValue("optionsFile").getString();
     349        const 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.