- Timestamp:
- Aug 19, 2010, 4:57:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/Executor.cc
r7187 r7189 50 50 } 51 51 52 bool Executor::parse(const std::string& params, const std::string& delimiter) const 53 { 52 MultiType Executor::parse(const std::string& params, bool* success, const std::string& delimiter) const 53 { 54 if (success) 55 *success = true; 56 54 57 unsigned int paramCount = this->functor_->getParamCount(); 55 58 … … 57 60 { 58 61 COUT(5) << "Calling Executor " << this->name_ << " through parser without parameters." << std::endl; 59 (*this->functor_)();62 return (*this->functor_)(); 60 63 } 61 64 else if (paramCount == 1) … … 65 68 { 66 69 COUT(5) << "Calling Executor " << this->name_ << " through parser with one parameter, using whole string: " << params << std::endl; 67 (*this->functor_)(MultiType(params));70 return (*this->functor_)(MultiType(params)); 68 71 } 69 72 else if (!this->defaultValue_[0].null()) 70 73 { 71 74 COUT(5) << "Calling Executor " << this->name_ << " through parser with one parameter, using default value: " << this->defaultValue_[0] << std::endl; 72 (*this->functor_)(this->defaultValue_[0]);75 return (*this->functor_)(this->defaultValue_[0]); 73 76 } 74 77 else 75 78 { 76 79 COUT(2) << "Warning: Can't call executor " << this->name_ << " through parser: Not enough parameters or default values given (input: " << temp << ")." << std::endl; 77 return false; 80 if (success) 81 *success = false; 82 return MT_Type::Null; 78 83 } 79 84 } … … 87 92 { 88 93 COUT(2) << "Warning: Can't call executor " << this->name_ << " through parser: Not enough parameters or default values given (input:" << params << ")." << std::endl; 89 return false; 94 if (success) 95 *success = false; 96 return MT_Type::Null; 90 97 } 91 98 } … … 120 127 { 121 128 case 2: 122 (*this->functor_)(param[0], param[1]); 123 break; 129 return (*this->functor_)(param[0], param[1]); 124 130 case 3: 125 (*this->functor_)(param[0], param[1], param[2]); 126 break; 131 return (*this->functor_)(param[0], param[1], param[2]); 127 132 case 4: 128 (*this->functor_)(param[0], param[1], param[2], param[3]); 129 break; 133 return (*this->functor_)(param[0], param[1], param[2], param[3]); 130 134 case 5: 131 (*this->functor_)(param[0], param[1], param[2], param[3], param[4]); 132 break; 133 } 134 } 135 136 return true; 135 return (*this->functor_)(param[0], param[1], param[2], param[3], param[4]); 136 } 137 } 138 139 return MT_Type::Null; 137 140 } 138 141
Note: See TracChangeset
for help on using the changeset viewer.