当前位置: 首页>>代码示例>>C++>>正文


C++ AbstractCommand::getName方法代码示例

本文整理汇总了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;
}
开发者ID:wmarkow,项目名称:arduino-terminal,代码行数:13,代码来源:Terminal.cpp

示例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());
	}
}
开发者ID:wmarkow,项目名称:arduino-terminal,代码行数:14,代码来源:Terminal.cpp

示例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;
}
开发者ID:ruphy,项目名称:kfunambol,代码行数:26,代码来源:SyncMLProcessor.cpp


注:本文中的AbstractCommand::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。