ListComponentsCommand.cc Source File
Back to the index.
Go to the documentation of this file.
34 :
Command(
"list-components",
"")
46 vector<string> allComponents =
51 for (i=0; i<allComponents.size(); i++)
52 if (allComponents[i].length() > maxLen)
53 maxLen = allComponents[i].length();
55 for (i=0; i<allComponents.size(); i++) {
57 const string& name = allComponents[i];
66 for (
size_t j = 0; j < 3 + maxLen - name.length(); j++)
80 return "Displays all available components.";
86 return "Displays a list of all available components.";
bool IsNULL() const
Checks whether or not an object is referenced by the reference counted pointer.
static vector< string > GetAllComponentNames(bool onlyTemplates)
Returns a vector of all available component names.
A Command is a named function, executed by the CommandInterpreter.
virtual ~ListComponentsCommand()
virtual void ShowDebugMessage(const string &msg)=0
Shows a debug message.
static refcount_ptr< Component > CreateComponent(const string &componentNameAndOptionalArgs, GXemul *gxemul=NULL)
Creates a component given a short component name.
virtual bool Execute(GXemul &gxemul, const vector< string > &arguments)
Executes the command on a given GXemul instance.
static string GetAttribute(const string &name, const string &attributeName)
Gets a specific attribute value for a component.
UI * GetUI()
Gets a pointer to the GXemul instance' active UI.
ListComponentsCommand()
Constructs a ListComponentsCommand.
virtual string GetLongDescription() const
Returns a long description/help message for the command.
virtual string GetShortDescription() const
Returns a short (one-line) description of the command.
Generated on Tue Mar 24 2020 14:04:48 for GXemul by
1.8.17