本文整理汇总了C++中AbstractCommand::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ AbstractCommand::getName方法的具体用法?C++ AbstractCommand::getName怎么用?C++ AbstractCommand::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractCommand
的用法示例。
在下文中一共展示了AbstractCommand::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getCommandByName
AbstractCommand* Terminal::getCommandByName(char* commandName)
{
for(uint8_t q = 0 ; q < commands->getSize() ; q ++)
{
AbstractCommand* command = commands->get(q);
if(strcmp_P(commandName, (char*)command->getName()) == 0)
{
return command;
}
}
return 0;
}
示例2: processHelp
void Terminal::processHelp()
{
if(commands->getSize() == 0)
{
serial->println(F("No commands available."));
return;
}
for(uint8_t q = 0 ; q < commands->getSize() ; q ++)
{
AbstractCommand* command = commands->get(q);
serial->println(command->getName());
}
}
示例3: getCommand
/*
* Return the index number of occurrence of this command. If doesn't exists return NULL;
* The first command has number 0.
*/
AbstractCommand* SyncMLProcessor::getCommand(SyncBody* syncBody, const char*commandName, int index) {
int iterator = 0, found = 0;
ArrayList* list = syncBody->getCommands();
AbstractCommand* a = NULL;
const char* name = NULL;
do {
a = (AbstractCommand*)getArrayElement(list, iterator);
if (a) {
name = a->getName(); // is returned the pointer to the element not a new element
if (name && strcmp(name, commandName) == 0) {
if (found == index)
break;
else
found++;
}
}
++iterator;
} while(a);
return a;
}