Esempio n. 1
0
bool compareCaseInsensitive(const std::string& str1, const std::string& str2)
{
	if (str1.size() != str2.size())
		return false;

	return makeLowerCase(str1) == makeLowerCase(str2);
}
int main ()
{
    char buf1[ 100 ], buf2[ 100 ];
    gets( buf1 );
    gets( buf2 );

    makeUpperCase( buf1 );
    makeLowerCase( buf2 );

    printf( "Upper case: %s\n", buf1 );
    printf( "Lower case: %s\n", buf2 );

    return 0;
}
Esempio n. 3
0
static void createAndAppendTransformationsSubMenu(const HitTestResult& result, ContextMenuItem& transformationsMenuItem)
{
    ContextMenu transformationsMenu(result);

    ContextMenuItem makeUpperCase(ActionType, ContextMenuItemTagMakeUpperCase, contextMenuItemTagMakeUpperCase());
    ContextMenuItem makeLowerCase(ActionType, ContextMenuItemTagMakeLowerCase, contextMenuItemTagMakeLowerCase());
    ContextMenuItem capitalize(ActionType, ContextMenuItemTagCapitalize, contextMenuItemTagCapitalize());

    transformationsMenu.appendItem(makeUpperCase);
    transformationsMenu.appendItem(makeLowerCase);
    transformationsMenu.appendItem(capitalize);

    transformationsMenuItem.setSubMenu(&transformationsMenu);
}
Esempio n. 4
0
void CliHandler::operator()(const int sockfd) {
  for (;;) {
    std::string line = fetchMessageString(sockfd);
    auto cmd = detachToken(line);
    makeLowerCase(cmd);
    if (cmd == "at")
      addTarget(line);
    else if (cmd == "ao")
      addObstacle(line);
    else if (cmd == "clear")
      clear(line);
    else if (cmd == "eot")
      return;
  }
}