Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 27, 2010, 2:41:03 PM (14 years ago)
Author:
landauf
Message:

re-implemented CommandExecutor and CommandEvaluation. parameter evaluation is currently not implemented, will come soon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/consolecommands3/src/libraries/core/command/Executor.cc

    r7212 r7228  
    3636#include "util/StringUtils.h"
    3737#include "util/SubString.h"
     38#include "CommandExecutor.h"
    3839
    3940namespace orxonox
     
    4950    }
    5051
    51     MultiType Executor::parse(const std::string& params, bool* success, const std::string& delimiter) const
    52     {
    53         if (success)
    54             *success = true;
     52    MultiType Executor::parse(const std::string& params, int* error, const std::string& delimiter, bool bPrintError) const
     53    {
     54        if (error)
     55            *error = CommandExecutor::Success;
    5556
    5657        unsigned int paramCount = this->functor_->getParamCount();
     
    7677            else
    7778            {
    78                 COUT(2) << "Warning: Can't call executor " << this->name_ << " through parser: Not enough parameters or default values given (input: " << temp << ")." << std::endl;
    79                 if (success)
    80                     *success = false;
     79                if (bPrintError)
     80                    COUT(2) << "Warning: Can't call executor " << this->name_ << " through parser: Not enough parameters or default values given (input: " << temp << ")." << std::endl;
     81                if (error)
     82                    *error = CommandExecutor::Incomplete;
    8183                return MT_Type::Null;
    8284            }
     
    9092                if (this->defaultValue_[i].null())
    9193                {
    92                     COUT(2) << "Warning: Can't call executor " << this->name_ << " through parser: Not enough parameters or default values given (input:" << params << ")." << std::endl;
    93                     if (success)
    94                         *success = false;
     94                    if (bPrintError)
     95                        COUT(2) << "Warning: Can't call executor " << this->name_ << " through parser: Not enough parameters or default values given (input: " << params << ")." << std::endl;
     96                    if (error)
     97                        *error = CommandExecutor::Incomplete;
    9598                    return MT_Type::Null;
    9699                }
Note: See TracChangeset for help on using the changeset viewer.