Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 27, 2008, 1:17:33 AM (16 years ago)
Author:
landauf
Message:

after some changes in MultiTypeMath and co., the new config and tconfig commands work very well. they substitute set and tset respectively.

Location:
code/branches/console/src/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/core/CommandEvaluation.cc

    r1434 r1435  
    100100        if (!this->bNewCommand_)
    101101        {
    102 std::cout << "not new" << std::endl;
    103102            switch (this->state_)
    104103            {
     
    163162        {
    164163            case CS_Uninitialized:
    165 std::cout << "hint: CS_Uninitialized" << std::endl;
    166164                break;
    167165            case CS_Empty:
    168 std::cout << "hint: CS_Empty" << std::endl;
    169166            case CS_ShortcutOrIdentifier:
    170 std::cout << "hint: CS_ShortcutOrIdentifier" << std::endl;
    171167                if (this->listOfPossibleFunctions_.size() == 0)
    172168                    return CommandEvaluation::dump(this->listOfPossibleIdentifiers_);
     
    177173                break;
    178174            case CS_Function:
    179 std::cout << "hint: CS_Function" << std::endl;
    180175                return CommandEvaluation::dump(this->listOfPossibleFunctions_);
    181176                break;
    182177            case CS_ParamPreparation:
    183 std::cout << "hint: CS_ParamPreparation" << std::endl;
    184178            case CS_Params:
    185 std::cout << "hint: CS_Params" << std::endl;
    186179                if (this->listOfPossibleArguments_.size() > 0)
    187180                    return CommandEvaluation::dump(this->listOfPossibleArguments_);
     
    189182                    return CommandEvaluation::dump(this->function_);
    190183            case CS_Finished:
    191 std::cout << "hint: CS_Finished" << std::endl;
    192184                if (this->function_)
    193185                    return CommandEvaluation::dump(this->function_);
    194186                break;
    195187            case CS_Error:
    196 std::cout << "hint: CS_Error" << std::endl;
    197188                return this->errorMessage_;
    198189                break;
  • code/branches/console/src/core/CommandExecutor.cc

    r1434 r1435  
    126126    void CommandExecutor::parseIfNeeded(const std::string& command)
    127127    {
    128 std::cout << "parse if needed: command:      >" << command << "<" << std::endl;
    129 std::cout << "                 old original: >" << CommandExecutor::getEvaluation().originalCommand_ << "<" << std::endl;
    130 std::cout << "                 old modified: >" << CommandExecutor::getEvaluation().command_ << "<" << std::endl;
    131128        if (CommandExecutor::getEvaluation().state_ == CS_Uninitialized)
    132129        {
    133 std::cout << "parse if needed: parse!" << std::endl;
    134130            CommandExecutor::parse(command);
    135131        }
    136         else if (/*removeTrailingWhitespaces*/(CommandExecutor::getEvaluation().originalCommand_) != /*removeTrailingWhitespaces*/(command))
     132        else if (CommandExecutor::getEvaluation().originalCommand_ != command)
    137133        {
    138134            if (CommandExecutor::getEvaluation().command_ == command)
    139135            {
    140 std::cout << "parse if needed: parse and set bNewCommand_ to false" << std::endl;
    141136                CommandExecutor::parse(command);
    142137                CommandExecutor::getEvaluation().bNewCommand_ = false;
     
    144139            else
    145140            {
    146 std::cout << "parse if needed: parse!" << std::endl;
    147141                CommandExecutor::parse(command);
    148142            }
    149143        }
    150 std::cout << "parse if needed: don't parse" << std::endl;
    151144    }
    152145
     
    163156        {
    164157            case CS_Uninitialized:
    165 std::cout << "0: Uninitialized\n";
    166158            {
    167159                // Impossible
     
    169161            }
    170162            case CS_Empty:
    171 std::cout << "0: Empty\n";
    172163            {
    173164                if (CommandExecutor::argumentsGiven() == 0)
     
    184175            }
    185176            case CS_ShortcutOrIdentifier:
    186 std::cout << "0: ShortcutOrIdentifier\n";
    187177            {
    188178                if (CommandExecutor::argumentsGiven() > 1)
     
    201191                    else if (CommandExecutor::getEvaluation().functionclass_)
    202192                    {
    203 std::cout << "MEP" << std::endl;
    204193                        // It's a functionname
    205194                        CommandExecutor::getEvaluation().state_ = CS_Function;
     
    283272            }
    284273            case CS_Function:
    285 std::cout << "0: Function\n";
    286274            {
    287275                if (CommandExecutor::getEvaluation().functionclass_)
     
    295283                        if (CommandExecutor::getEvaluation().function_)
    296284                        {
    297 std::cout << "MEP2" << std::endl;
    298285                            // It's a function
    299286                            CommandExecutor::getEvaluation().state_ = CS_ParamPreparation;
     
    551538    std::string CommandExecutor::getPossibleArgument(const std::string& name, ConsoleCommand* command, unsigned int param)
    552539    {
    553 std::cout << "4_1\n";
    554540        CommandExecutor::createArgumentCompletionList(command, param);
    555541
    556 std::cout << "4_2\n";
    557542        std::string lowercase = getLowercase(name);
    558 std::cout << "4_3\n";
    559543        for (std::list<std::pair<std::string, std::string> >::const_iterator it = command->getArgumentCompletionListBegin(); it != command->getArgumentCompletionListEnd(); ++it)
    560544        {
    561 std::cout << "4_4\n";
    562545            if ((*it).first == lowercase)
    563546                return (*it).second;
    564547        }
    565548
    566 std::cout << "4_5\n";
    567549        return "";
    568550    }
  • code/branches/console/src/core/ConfigFileManager.cc

    r1434 r1435  
    3939{
    4040    SetConsoleCommandShortcutExtern(config).setArgumentCompleter(0, autocompletion::configvalueclasses()).setArgumentCompleter(1, autocompletion::configvalues()).setArgumentCompleter(2, autocompletion::configvalue());
    41     SetConsoleCommandShortcutExtern(tconfig);
     41    SetConsoleCommandShortcutExtern(tconfig).setArgumentCompleter(0, autocompletion::configvalueclasses()).setArgumentCompleter(1, autocompletion::configvalues()).setArgumentCompleter(2, autocompletion::configvalue());
    4242    SetConsoleCommandShortcutExtern(reloadConfig);
    4343    SetConsoleCommandShortcutExtern(cleanConfig);
     
    4747    bool config(const std::string& classname, const std::string& varname, const std::string& value)
    4848    {
    49 std::cout << "10a_1\n";
    5049        std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseIdentifierMap().find(getLowercase(classname));
    5150        if (identifier != Identifier::getLowercaseIdentifierMapEnd())
    5251        {
    53 std::cout << "10a_2\n";
    5452            std::map<std::string, ConfigValueContainer*>::const_iterator variable = (*identifier).second->getLowercaseConfigValueMap().find(getLowercase(varname));
    5553            if (variable != (*identifier).second->getLowercaseConfigValueMapEnd())
    56             {
    57 std::cout << "10a_3\n";
    58                 return (*variable).second->tset(value);
    59             }
     54                return (*variable).second->set(value);
    6055        }
    6156        return false;
     
    6459    bool tconfig(const std::string& classname, const std::string& varname, const std::string& value)
    6560    {
    66 std::cout << "10b_1\n";
    6761        std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseIdentifierMap().find(getLowercase(classname));
    6862        if (identifier != Identifier::getLowercaseIdentifierMapEnd())
    6963        {
    70 std::cout << "10b_2\n";
    7164            std::map<std::string, ConfigValueContainer*>::const_iterator variable = (*identifier).second->getLowercaseConfigValueMap().find(getLowercase(varname));
    7265            if (variable != (*identifier).second->getLowercaseConfigValueMapEnd())
    73             {
    74 std::cout << "10b_3\n";
    7566                return (*variable).second->tset(value);
    76             }
    7767        }
    7868        return false;
Note: See TracChangeset for help on using the changeset viewer.