Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7414 in orxonox.OLD


Ignore:
Timestamp:
Apr 28, 2006, 1:12:28 AM (18 years ago)
Author:
bensch
Message:

also get the offset

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_command.cc

    r7413 r7414  
    136136  /**
    137137   * @brief takes out an InputLine, searching for a Command.
     138   * @see const ShellCommand* const ShellCommand::getCommandFromInput(const SubString& strings)
    138139   * @param inputLine: the Input to analyse.
     140   * @param paramBegin: The begin of the Splitted SubStrings entry of the Parameters section.
    139141   * @returns: The ShellCommand if found.
    140142   */
    141   const ShellCommand* const ShellCommand::getCommandFromInput(const std::string& inputLine)
    142   {
    143     SubString strings(inputLine, SubString::WhiteSpaces);
     143  const ShellCommand* const ShellCommand::getCommandFromInput(const std::string& inputLine, unsigned int& paramBegin)
     144  {
     145    ShellCommand::getCommandFromInput(SubString(inputLine, SubString::WhiteSpaces), paramBegin);
     146  }
     147
     148  /**
     149   * @brief takes out an InputLine, searching for a Command.
     150   * @param strings: the Input to analyse.
     151   * @param paramBegin: The begin of the Splitted SubStrings entry of the Parameters section.
     152   * @returns: The ShellCommand if found.
     153   */
     154  const ShellCommand* const ShellCommand::getCommandFromInput(const SubString& strings, unsigned int& paramBegin)
     155  {
    144156    // no input, no Command.
    145157    if (strings.size() == 0)
    146       return NULL;
     158    {
     159      paramBegin = 0;
     160      return NULL;
     161    }
    147162
    148163    // CHECK FOR ALIAS
     
    162177      const ShellCommand* retCmd;
    163178      if (strings.size() >= 1)
     179      {
    164180        retCmd = ShellCommand::getCommand(strings[1], cmdClass);
     181        paramBegin = 2;
     182      }
    165183      if (retCmd == NULL && strings.size() >= 2)
     184      {
    166185        retCmd = ShellCommand::getCommand(strings[2], cmdClass);
    167       return retCmd;
    168 
    169     }
     186        paramBegin = 3;
     187      }
     188      if (retCmd != NULL) // check for the paramBegin.
     189        return retCmd;
     190    }
     191    paramBegin = 0;
     192    return NULL;
    170193  }
    171194
  • trunk/src/lib/shell/shell_command.h

    r7413 r7414  
    7676    static const ShellCommand* const getCommand(const std::string& commandName, const ShellCommandClass* cmdClass);
    7777    static bool exists(const std::string& commandName, const std::string& className);
    78     static const ShellCommand* const getCommandFromInput(const std::string& inputLine);
     78    static const ShellCommand* const getCommandFromInput(const std::string& inputLine, unsigned int& paramBegin);
     79    static const ShellCommand* const getCommandFromInput(const SubString& strings, unsigned int& paramBegin);
    7980
    8081    const ShellCommandClass* const getCommandClass() const { return this->shellClass; };
  • trunk/src/lib/shell/shell_completion.cc

    r7413 r7414  
    102102    if (completeType == NullCompletion)
    103103    {
    104       if ((command = ShellCommand::getCommandFromInput(input)) != NULL)
     104
     105      if ((command = ShellCommand::getCommandFromInput(inputSplits, parameterBegin)) != NULL)
    105106        completeType |= ParamCompletion;
    106107    }
     
    116117    if (completeType & ParamCompletion)
    117118      this->paramComplete(completeString, command);
    118 
    119 
    120119
    121120    this->generalComplete(input, completeString);
  • trunk/src/story_entities/game_world.cc

    r7412 r7414  
    299299  else
    300300  {
    301     PRINTF(1)("Unable to set Playmode %d:%s\n", playmode, Playable::playmodeToString(playmode).c_str());
     301    PRINTF(1)("Unable to set Playmode %d:'%s'\n", playmode, Playable::playmodeToString(playmode).c_str());
    302302  }
    303303}
Note: See TracChangeset for help on using the changeset viewer.