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/CommandExecutor.h

    r7221 r7228  
    3232#include "core/CorePrereqs.h"
    3333
    34 #include <map>
    35 #include <set>
    3634#include <string>
    3735
     
    4644// tolua_end
    4745        public:
    48             static bool execute(const std::string& command, bool useTcl = true); // tolua_export
     46            static int execute(const std::string& command, bool useTcl = true); // tolua_export
    4947
    50             static MultiType queryMT(const std::string& command, bool* success = 0, bool useTcl = true);
    51             static std::string query(const std::string& command, bool* success = 0, bool useTcl = true); // tolua_export
    52 
    53             static std::string complete(const std::string& command);
    54             static std::string hint(const std::string& command);
     48            static MultiType queryMT(const std::string& command, int* error = 0, bool useTcl = true);
     49            static std::string query(const std::string& command, int* error = 0, bool useTcl = true); // tolua_export
    5550
    5651            static CommandEvaluation evaluate(const std::string& command);
     52
     53            static const int Success = 0;
     54            static const int Error = 1;
     55            static const int Incomplete = 2;
     56            static const int Deactivated = 3;
     57            static const int Denied = 4;
     58
     59            static void _autocomplete(const std::string& group, const std::string& name) {}
    5760
    5861        private:
     
    6265
    6366            static CommandExecutor& getInstance();
    64             static CommandEvaluation& getEvaluation();
    65 
    66             static void parseIfNeeded(const std::string& command);
    67             static void parse(const std::string& command, bool bInitialize = true);
    68 
    69             static unsigned int argumentsFinished();
    70             static unsigned int argumentsGiven();
    71             static bool enoughArgumentsGiven(_ConsoleCommand* command);
    72             static const std::string& getArgument(unsigned int index);
    73             static const std::string& getLastArgument();
    74 
    75             static void createListOfPossibleIdentifiers(const std::string& fragment);
    76             static void createListOfPossibleFunctions(const std::string& fragment, Identifier* identifier = 0);
    77             static void createListOfPossibleArguments(const std::string& fragment, _ConsoleCommand* command, unsigned int param);
    78 
    79             static Identifier* getPossibleIdentifier(const std::string& name);
    80             static _ConsoleCommand* getPossibleCommand(const std::string& name, Identifier* identifier = 0);
    81             static const std::string& getPossibleArgument(const std::string& name, _ConsoleCommand* command, unsigned int param);
    82 
    83             static void createArgumentCompletionList(_ConsoleCommand* command, unsigned int param);
    84             static std::string getCommonBegin(const std::list<std::pair<const std::string*, const std::string*> >& list);
    85             static std::string getCommonBegin(const ArgumentCompletionList& list);
    86 
    87             CommandEvaluation evaluation_;
    8867    }; // tolua_export
    8968} // tolua_export
Note: See TracChangeset for help on using the changeset viewer.