这篇教程C++ toUpper函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中toUpper函数的典型用法代码示例。如果您正苦于以下问题:C++ toUpper函数的具体用法?C++ toUpper怎么用?C++ toUpper使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了toUpper函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: filenametoshortvoid filenametoshort(char *fname, char rets[12]){ unsigned short i = 0; for(; i < 8; ++i) { if(fname[i] == '.') break; rets[i] = toUpper(fname[i]); } for(; i < 8; ++i) rets[i] = ' '; while(*fname != '.') ++fname; ++fname; for(i = 8; i < 11; ++i) { if(*fname == 0) break; rets[i] = toUpper(*fname++); } for(; i < 11; ++i) rets[i] = ' '; rets[11] = 0;}
开发者ID:CatharticMonkey,项目名称:rix,代码行数:28,
示例2: MoveFile/* * MoveFile() * * This function will move a file to a new name and location. */void MoveFile(char *oldname, char *newname){ char buffer[100]; FILE *infd, *outfd; int s; if (toUpper(*oldname) == toUpper(*newname)) { rename(oldname, newname); if (access(newname, 0) == 0) return; } CitSystem(FALSE, "copy %s %s > nul", oldname, newname); if (access(newname, 0) == 0) { unlink(oldname); } else { if ((infd = fopen(oldname, READ_ANY)) == NULL) return; if ((outfd = fopen(newname, WRITE_ANY)) == NULL) { fclose(infd); return; } while ((s = fread(buffer, sizeof buffer, 1, infd)) > 0) fwrite(buffer, s, 1, outfd); fclose(infd); fclose(outfd); unlink(oldname); }}
开发者ID:dylancarlson,项目名称:citadel-86,代码行数:32,
示例3: autosprintfvoid cIPLog::GetLastLogin(const string &who, bool isNick, int limit, ostream &os){ string ip; if(isNick) os << autosprintf(_("Nick %s has lately been in the hub with the following IP"), who.c_str()) << "/n"; else os << autosprintf(_("IP %s has lately been in the hub with following nicknames"), who.c_str()) << "/n"; MakeSearchQuery(who, isNick, 1, limit); SetBaseTo(&mModel); os << "/n "; os << setw(25) << setiosflags(ios::left) << toUpper(_("Date")); os << (isNick ? "IP" : toUpper(_("Nickname"))) << "/n"; os << " " << string(25+20,'=') << endl; db_iterator it; for(it = db_begin(); it != db_end(); ++it) { cBanList::Num2Ip(mModel.mIP, ip); os << " " << setw(25) << setiosflags(ios::left) << cTime(mModel.mDate,0).AsDate(); os << (isNick ? ip : mModel.mNick) << endl; } mQuery.Clear();}
开发者ID:Gerlofius,项目名称:verlihub-1.0.0,代码行数:25,
示例4: toStringstring toString(PElement element) { if (element == NULL) { return "*"; } string result; PElement child = element->getChild(); while (child != NULL) { if (child->getTagname() == "#text") { // Then this child only contains text, no markup result += child->getText(); } else if (child->getTagname() == "#cdata") { ; } else { // Since only using on <that> and <pattern> // The tag can only be <bot_xxx/> or <bot name="xxx"/> or <name/> if (child->getTagname() == "name") { result += Kernel::respond("BOT NAME", "unknown"); } else if (child->getTagname() == "bot") { // Is a <bot name="xxx"/> predicate result += Kernel::respond("BOT " + toUpper(child->getAttribute("name")), "unknown"); } else { // It is old-skool <bot_xxx/> result += Kernel::respond("BOT " + toUpper(child->getTagname().substr(4)), "unknown"); } } child = child->getNextSibling(); } return trim(toUpper(result));//Substituter::normalize(result);}
开发者ID:zekoman,项目名称:tibiaauto,代码行数:30,
示例5: auxifyECStringauxify(ECString wM, ECString trmM){ char temp[128]; ECString w = toUpper(wM.c_str(),temp); ECString trm = toUpper(trmM.c_str(),temp); cerr << "AUX!!!" << endl; assert(0); if( isVerb( trm ) ) { //cout << "saw verb " << trm << " " << wM << endl; if( isAux( w ) || hasAuxSuf( w ) ) { //cout << "was aux " << w << endl; return "AUX"; } else if( isAuxg( w ) ) { //cout << "was auxg " << w << endl; return "AUXG"; } } if(trm == "BES" || trm == "HVS") //??? strange tags in switchboard { assert(w == "'S" || w == "-S"); return "AUX"; } return trmM;}
开发者ID:jimwhite,项目名称:bllip-parser,代码行数:29,
示例6: whileint IconvGNUTransService::compareNIString(const XMLCh* const comp1 , const XMLCh* const comp2 , const unsigned int maxChars){ unsigned int n = 0; const XMLCh* cptr1 = comp1; const XMLCh* cptr2 = comp2; while (true && maxChars) { XMLCh c1 = toUpper(*cptr1); XMLCh c2 = toUpper(*cptr2); if (c1 != c2) return (int) (c1 - c2); // If either ended, then both ended, so equal if (!*cptr1 || !*cptr2) break; cptr1++; cptr2++; // Bump the count of chars done. If it equals the count then we // are equal for the requested count, so break out and return // equal. n++; if (n == maxChars) break; } return 0;}
开发者ID:js422,项目名称:PERL,代码行数:33,
示例7: inFile int Settings::load(const string & filename) { mFileName = filename; ifstream inFile(filename.c_str(), std::istream::in); mMap.clear(); string strLine, strKey, strValue; string::iterator itLine; bool bKey = true; bool bBlanks = false; while (getline(inFile, strLine)) // TODO Errorhandling { if (strLine.find('=') == strLine.npos) continue; strKey.clear(); strValue.clear(); bKey = true; bBlanks = false; for (itLine = strLine.begin(); itLine != strLine.end(); itLine++) { if (!bKey && (*itLine == '"')) { if (!bBlanks) bBlanks = true; else bBlanks = false; continue; } if (!bBlanks && isspace(*itLine)) continue; if (*itLine == '#') break; if (*itLine == '=') { bKey = false; continue; } bKey ? strKey.push_back(*itLine) : strValue.push_back(*itLine); } if (strValue.empty()) continue; switch (mCase) { case KEEP: mMap[strKey] = strValue; break; case UPPER: mMap[toUpper(strKey)] = toUpper(strValue); break; case LOWER: mMap[toLower(strKey)] = toLower(strValue); break; default: break; } } inFile.close(); return 0; }
开发者ID:raldus,项目名称:libxstd,代码行数:57,
示例8: setw void cRedirectConsole::ListHead(ostream *os) { (*os) << "/r/n "; (*os) << setw(10) << setiosflags(ios::left) << toUpper(_("Count")); (*os) << setw(35) << setiosflags(ios::left) << toUpper(_("Address")); (*os) << setw(35) << setiosflags(ios::left) << toUpper(_("Type")); (*os) << toUpper(_("Status")) << "/r/n"; (*os) << " " << string(30 + 25 + 25, '='); }
开发者ID:Eco-logical,项目名称:verlihub-1.0.0,代码行数:9,
示例9: toUppervector<Vertex*> ShortestDistance::shortestDistance(string &airport1, string &airport2){ toUpper(airport1); toUpper(airport2); vector<Vertex*> vec; Vertex* u; set<Vertex*, Prioritize> Q; int starting_airport = -1, destination_airport = -1; for(map<int,Vertex*>::const_iterator mt = table.begin(); mt != table.end(); ++mt) if(!mt->second->airport_iata.empty()) { if(!mt->second->airport_iata.compare(airport1)) starting_airport = mt->second->airport_id; else if(!mt->second->airport_iata.compare(airport2)) destination_airport = mt->second->airport_id; } if(starting_airport == -1) { cout << "Starting airport not found." << endl; return vec; } else if(destination_airport == -1) { cout << "Destination airport not found." << endl; return vec; } table[starting_airport]->cost = 0; Q.insert(table[starting_airport]); while(!Q.empty()) { u = *Q.begin(); if(u->airport_id == destination_airport) { while(table[u->airport_id]->prev) { vec.insert(vec.begin(), table[u->airport_id]->prev); u = table[u->airport_id]->prev; } vec.push_back(table[destination_airport]); return vec; } Q.erase(Q.begin()); for(vector<Routes*>::iterator neighbor = u->routes.begin(); neighbor != u->routes.end(); ++neighbor) { double alt = u->cost + (*neighbor)->distance; if(alt < table[(*neighbor)->nextAirport]->cost) { table[(*neighbor)->nextAirport]->cost = alt; table[(*neighbor)->nextAirport]->prev = u; if(Q.find(table[(*neighbor)->nextAirport]) == Q.end()) Q.insert(table[(*neighbor)->nextAirport]); } } } return vec;}
开发者ID:Secret-Asian-Man,项目名称:cs8,代码行数:56,
示例10: equalsIgnoreCaseboolean equalsIgnoreCase(Char *s1_, Char *s2_){ Char s1[256], s2[256]; strcpy(s1, s1_); strcpy(s2, s2_); toUpper(s1); toUpper(s2); return (strcmp(s1, s2) == 0);}
开发者ID:texlive,项目名称:texlive-source,代码行数:10,
示例11: startsWithIgnoreCaseboolean startsWithIgnoreCase(Char *s1_, Char *s2_){ Char s1[256], s2[256]; strcpy(s1, s1_); strcpy(s2, s2_); toUpper(s1); toUpper(s2); return (startsWith(s1, s2));}
开发者ID:texlive,项目名称:texlive-source,代码行数:10,
示例12: isLetterint isLetter(char input){ int ret = 0; if((toUpper(input) >= 'A' && toUpper(input) <= 'Z') || input == ' '){ ret = 1; } return ret;}
开发者ID:kshmir,项目名称:Arqui-2011,代码行数:10,
示例13: mainint main(int argc, char *argv[]) { printf("%c/n",toUpper('g')); printf("%c/n",toUpper('=')); printf("%c/n",toUpper('Z')); printf("%c/n",toUpper('x')); return(EXIT_SUCCESS);}
开发者ID:BaptisteDegryse,项目名称:SystemesInformatiques,代码行数:11,
示例14: mainvoid main(){ char word[20] = "Hello World!"; int i; for(i = 0; i<20; i++){ if(word[i] == '/0') { printf("%c", toUpper(word[i])); break; } printf("%c", toUpper(word[i])); } printf("/n");}
开发者ID:ta5aka1,项目名称:practice,代码行数:12,
示例15: setwostream& operator << (ostream &os, const cPlug &plug){ os << " [*] " << setw(PADDING) << setiosflags(ios::left) << _("Name") << plug.mNick.c_str() << " [" << (plug.IsLoaded() ? toUpper(_("On")) : toUpper(_("Off"))) << "]"; os << " [" << (plug.mLoadOnStartup ? toUpper(_("Auto")) : toUpper(_("Manual"))) << "]" << endl; os << " [*] " << setw(PADDING) << setiosflags(ios::left) << _("Path") << plug.mPath.c_str() << endl; if (!plug.mDesc.empty()) os << " [*] " << setw(PADDING) << setiosflags(ios::left) << _("Description") << plug.mDesc.c_str() << endl; if (!plug.mLastError.empty()) os << " [*] " << setw(PADDING) << setiosflags(ios::left) << _("Last error") << plug.mLastError.c_str() << endl; return os;}
开发者ID:Eco-logical,项目名称:verlihub-1.0.0,代码行数:14,
示例16: ShowUsersint cRegList::ShowUsers(cConnDC *op, ostringstream &os, int cls){ if (op && op->mpUser) { ostringstream oss; oss << "SELECT `nick` FROM " << mMySQLTable.mName << " WHERE `class` = " << cls << " ORDER BY `nick` ASC"; mQuery.OStream() << oss.str(); if (mQuery.Query() <= 0) return 0; int n = mQuery.StoreResult(); cMySQLColumn col; MYSQL_ROW row; cUser *usr = NULL; for (int i = 0; i < n; i++) { row = mQuery.Row(); usr = mS->mUserList.GetUserByNick(row[0]); os << " " << row[0]; if (usr && usr->mxConn) os << " [" << toUpper(_("On")) << "]"; os << "/r/n"; } mQuery.Clear(); return n; } return 0;}
开发者ID:Gerlofius,项目名称:verlihub-1.0.0,代码行数:26,
示例17: exec_Lineint exec_Line (int conn, int argc, char **argv){ XHCP_command *cmd; int retValue=0; toUpper (argv[0]); for ( cmd = XHCP_commandList; cmd->id != END_CMD; cmd++ ) if ( strcmp (argv[0], cmd->str) == 0 ) break; if ( cmd->id == END_CMD ) { XHCP_printXHCPResponse (conn, RES_COMNOTREC ); // 500 Command not recognised //retValue = 1; } else { if ( cmd->fnct == NULL ) { /*XHCP_printXHCPResponse(conn, RES_INTNERROR ); // 503 Internal error - command not performed ----- Pour l'instant !!!*/ XHCP_printMessage (conn, 500, "Command not implemented" ); //retValue = 1; } else retValue = cmd->fnct (conn, argc, argv); } return retValue;}
开发者ID:cpoyet,项目名称:DdraftDolo,代码行数:33,
示例18: XHCPcmd_CAPABILITIESint XHCPcmd_CAPABILITIES (int sockd, int argc, char **argv){ int s = 0; if ( argc>1) { toUpper (argv[1]); if ( strcmp (argv[1], "SCRIPTING") == 0 ) s = 1; else { XHCP_printXHCPResponse (sockd, RES_SYNTAXERR ); // Syntax error return XHCP_EXE_ERROR; } } XHCP_printMessage (sockd, s?241:236, "--000U0" ); if (s) XHCP_print (sockd, "." ); return XHCP_EXE_SUCCESS;}
开发者ID:cpoyet,项目名称:DdraftDolo,代码行数:26,
示例19: opendirbool cConsole::cfFilesLuaScript::operator()(){ DIR *dir = opendir(GetPI()->mScriptDir.c_str()); if (!dir) { (*mOS) << autosprintf(_("Failed loading directory: %s"), GetPI()->mScriptDir.c_str()); return false; } (*mOS) << autosprintf(_("Lua scripts found in: %s"), GetPI()->mScriptDir.c_str()) << "/r/n/r/n "; (*mOS) << setw(6) << setiosflags(ios::left) << _("ID"); (*mOS) << toUpper(_("Script")) << "/r/n"; (*mOS) << " " << string(6 + 20, '=') << "/r/n"; string filename; struct dirent *dent = NULL; int i = 0; while (NULL != (dent = readdir(dir))) { filename = dent->d_name; if ((filename.size() > 4) && (StrCompare(filename, filename.size() - 4, 4, ".lua") == 0)) { (*mOS) << " " << setw(6) << setiosflags(ios::left) << i << filename << "/r/n"; i++; } } closedir(dir); return true;}
开发者ID:Eco-logical,项目名称:verlihub-1.0.0,代码行数:29,
示例20: CheckArea/* * CheckArea() * * This function deals with the question of whether the given string is a * directory and to create it if possible and needed. */char CheckArea(MenuId id, char c, char *drive, char *dir_x){ char work[100]; switch (c) { case IS_DIR: return TRUE; case NO_IDEA: if (strLen(dir_x) != 0) { sprintf(work, "%s does not exist. Create it", dir_x); if (SysopGetYesNo(id, "", work)) { DoBdos(SETDISK, toUpper(*drive) - 'A'); if (mkdir(dir_x) == BAD_DIR) { SysopPrintf(id, "?ERROR CREATING!"); homeSpace(); return FALSE; } else { homeSpace(); return TRUE; } } } else { return TRUE; } return FALSE; default: SysopPrintf(id, "That's not a directory!/n "); return FALSE; }}
开发者ID:dylancarlson,项目名称:citadel-86,代码行数:38,
示例21: capitalize_sentenceString capitalize_sentence(const String& s) { String ret = s;//.Lower(); if (!ret.empty()) { ret[0] = toUpper(ret[0]); } return ret;}
开发者ID:XVicarious,项目名称:magicseteditor,代码行数:7,
示例22: mainint main(void) { //Prepare server address int fd = socket(AF_INET6, SOCK_DGRAM, 0); struct sockaddr_in6 serveraddr; memset(&serveraddr, 0, sizeof(struct sockaddr_in6)); serveraddr.sin6_family = AF_INET6; serveraddr.sin6_port = htons(PORT); //Bind to server address if( bind(fd, (struct sockaddr*)&serveraddr, sizeof(struct sockaddr_in6)) == -1 ) perror("server bind"); char buf[BUF_SIZE]; char clientstr[INET6_ADDRSTRLEN]; struct sockaddr_in6 clientaddr; socklen_t len = sizeof(struct sockaddr_in6); while(1) { //Wait for messages if( recvfrom(fd, buf, BUF_SIZE, 0, (struct sockaddr*)&clientaddr, &len) == -1) perror("server recvfrom"); inet_ntop(AF_INET6, &clientaddr.sin6_addr, clientstr, INET6_ADDRSTRLEN); printf( "Server-Receive message from: (%s, %u)", clientstr, ntohs(clientaddr.sin6_port) ); //Convert to upper and send back message if(strcmp(buf, "Done") == 0) break; toUpper(buf); if( sendto(fd, buf, strlen(buf)+1, 0,(struct sockaddr*)&clientaddr, sizeof(struct sockaddr_in6) ) != strlen(buf)+1 ) perror("server sendto"); } return 0;}
开发者ID:Cintia92,项目名称:EserciziUni,代码行数:35,
示例23: convertToLowerOrUpperstatic inline UChar32 convertToLowerOrUpper(UChar32 c, ConvertType type){ if (type == ConvertLower) return toLower(c); else return toUpper(c);}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:7,
示例24: meGetKeyFromStringmeUShortmeGetKeyFromString(meUByte **tp){ meUByte *ss=*tp, cc, dd ; meUShort ii=0 ; for(;;) { if(((cc=*ss++) == '/0') || ((dd=*ss++) != '-')) break ; if (cc == 'C') ii |= ME_CONTROL ; else if(cc == 'S') ii |= ME_SHIFT ; else if(cc == 'A') ii |= ME_ALT ; } if(cc != '/0') { if(!isSpace(dd)) { meUByte *s1=ss ; int skey ; while(((dd=*s1) != '/0') && (dd != ' ')) s1++ ; *s1 = '/0' ; skey = biChopFindString(ss-2,13,specKeyNames,SKEY_MAX) ; *s1 = dd ; if(skey >= 0) { if(skey == SKEY_space) ii |= 32 ; else ii |= (skey|ME_SPECIAL) ; *tp = s1 ; return ii ; } /* duff key string - fail */ return 0 ; } if(ii) { cc = toUpper(cc) ; if((ii == ME_CONTROL) && (cc >= 'A') && (cc <= '_')) ii = cc - '@' ; else { cc = toLower(cc) ; ii |= cc ; } } else ii |= cc ; } *tp = ss-1 ; return ii ;}
开发者ID:Russtopia,项目名称:microemacs,代码行数:60,
示例25: toUpperJNIEXPORT void JNICALL Java_ToUpperExample_toUpper (JNIEnv *env, jobject jobj, jbyteArray jBuf){ jbyte *cpu_buf = env->GetByteArrayElements(jBuf, 0); toUpper((uint8_t *)cpu_buf); env->ReleaseByteArrayElements(jBuf, cpu_buf, 0);}
开发者ID:dpointer80906,项目名称:ToUpper,代码行数:7,
示例26: toUpper// ---------------------------------------------------------------------------// IconvGNUTransService: The virtual transcoding service API// ---------------------------------------------------------------------------int IconvGNUTransService::compareIString(const XMLCh* const comp1 , const XMLCh* const comp2){ const XMLCh* cptr1 = comp1; const XMLCh* cptr2 = comp2; XMLCh c1 = toUpper(*cptr1); XMLCh c2 = toUpper(*cptr2); while ( (*cptr1 != 0) && (*cptr2 != 0) ) { if (c1 != c2) break; c1 = toUpper(*(++cptr1)); c2 = toUpper(*(++cptr2)); } return (int) ( c1 - c2 );}
开发者ID:js422,项目名称:PERL,代码行数:20,
示例27: getComparisonRowFilter::Comparison RowFilter::getComparison(const std::string& comp) const{ Comparisons::const_iterator it = _comparisons.find(toUpper(comp)); if (it == _comparisons.end()) throw NotFoundException("Comparison not found", comp); return it->second;}
开发者ID:12307,项目名称:poco,代码行数:8,
示例28: _fMemiCmpint _fMemiCmp(const byte far * dest, const byte far * src, unsigned length){ int d; DBG_ENTER("_fMemiCmp", Suppl_farmem) if(!length) DBG_RETURN_I( 0) if(dest == 0) DBG_RETURN_I(src != 0) if(src == 0) DBG_RETURN_I(-1) while((d = toUpper(*dest++) - toUpper(*src++)) == 0 && --length); DBG_RETURN_I( d)}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:17,
注:本文中的toUpper函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ toV8函数代码示例 C++ toUnicode函数代码示例 |