Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 27, 2008, 12:27:13 AM (16 years ago)
Author:
landauf
Message:

autocompletion is almost done

File:
1 edited

Legend:

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

    r1341 r1434  
    3838namespace orxonox
    3939{
     40    SetConsoleCommandShortcutExtern(config).setArgumentCompleter(0, autocompletion::configvalueclasses()).setArgumentCompleter(1, autocompletion::configvalues()).setArgumentCompleter(2, autocompletion::configvalue());
     41    SetConsoleCommandShortcutExtern(tconfig);
    4042    SetConsoleCommandShortcutExtern(reloadConfig);
    4143    SetConsoleCommandShortcutExtern(cleanConfig);
    4244    SetConsoleCommandShortcutExtern(loadSettings);
    4345    SetConsoleCommandShortcutExtern(loadKeybindings);
     46
     47    bool config(const std::string& classname, const std::string& varname, const std::string& value)
     48    {
     49std::cout << "10a_1\n";
     50        std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseIdentifierMap().find(getLowercase(classname));
     51        if (identifier != Identifier::getLowercaseIdentifierMapEnd())
     52        {
     53std::cout << "10a_2\n";
     54            std::map<std::string, ConfigValueContainer*>::const_iterator variable = (*identifier).second->getLowercaseConfigValueMap().find(getLowercase(varname));
     55            if (variable != (*identifier).second->getLowercaseConfigValueMapEnd())
     56            {
     57std::cout << "10a_3\n";
     58                return (*variable).second->tset(value);
     59            }
     60        }
     61        return false;
     62    }
     63
     64    bool tconfig(const std::string& classname, const std::string& varname, const std::string& value)
     65    {
     66std::cout << "10b_1\n";
     67        std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseIdentifierMap().find(getLowercase(classname));
     68        if (identifier != Identifier::getLowercaseIdentifierMapEnd())
     69        {
     70std::cout << "10b_2\n";
     71            std::map<std::string, ConfigValueContainer*>::const_iterator variable = (*identifier).second->getLowercaseConfigValueMap().find(getLowercase(varname));
     72            if (variable != (*identifier).second->getLowercaseConfigValueMapEnd())
     73            {
     74std::cout << "10b_3\n";
     75                return (*variable).second->tset(value);
     76            }
     77        }
     78        return false;
     79    }
    4480
    4581    void reloadConfig()
Note: See TracChangeset for help on using the changeset viewer.