static WString sSwapCase(const WString& s) { WStringBuffer r; r.SetCount(s.GetCount()); for(int i = 0; i < s.GetCount(); i++) r[i] = IsUpper(s[i]) ? ToLower(s[i]) : ToUpper(s[i]); return r; }
void __fastcall TTestBedForm::FormKeyUp(TObject *Sender, WORD &Key, System::WideChar &KeyChar, TShiftState Shift) { if (test) { test->KeyboardUp(static_cast<int>(ToUpper(KeyChar))); } }
/* Transform ASCII chars in string to upper case */ tmbstr tmbstrtoupper(tmbstr s) { tmbstr cp; for (cp = s; *cp; ++cp) *cp = (tmbchar)ToUpper(*cp); return s; }
int ircncmp(const char* s1, const char *s2, size_t n) { const unsigned char *str1 = (const unsigned char *) s1; const unsigned char *str2 = (const unsigned char *) s2; int res; assert(s1 != NULL); assert(s2 != NULL); while ((res = ToUpper(*str1) - ToUpper(*str2)) == 0) { str1++, str2++, n--; if (n == 0 || (*str1 == '\0' && *str2 == '\0')) return 0; } return res; }
/* * irccmp - case insensitive comparison of two 0 terminated strings. * * returns 0, if s1 equal to s2 * <0, if s1 lexicographically less than s2 * >0, if s1 lexicographically greater than s2 */ int irccmp(const char *s1, const char *s2) { const unsigned char* str1 = (const unsigned char*) s1; const unsigned char* str2 = (const unsigned char*) s2; int res; assert(s1 != NULL); assert(s2 != NULL); while ((res = ToUpper(*str1) - ToUpper(*str2)) == 0) { if (*str1 == '\0') return 0; str1++; str2++; } return (res); }
virtual bool HotKey(dword key) { if(TopWindow::HotKey(key)) return true; if(IsAlpha(key)) return TopWindow::HotKey(K_ALT_A + ToUpper((int)key) - 'A'); if(key == K_ESCAPE && esc) b->PseudoPush(); return false; }
wrBuffer get_depth_write_mask_string( const wrName& s ) { if( s.IsEmpty() ) { return wrBuffer("D3D11_DEPTH_WRITE_MASK_ALL"); } wrBuffer buf("D3D11_DEPTH_WRITE_MASK_"); buf += ToUpper( s ); return buf; }
wrBuffer get_depth_func_string( const wrName& s ) { if( s.IsEmpty() ) { return wrBuffer("D3D11_COMPARISON_LESS"); } wrBuffer buf("D3D11_COMPARISON_"); buf += ToUpper( s ); return buf; }
wrBuffer GetTextureAddressMode( const wrName& addrMode ) { if( addrMode.IsEmpty() ) { return wrBuffer("D3D11_TEXTURE_ADDRESS_CLAMP"); } wrBuffer buf("D3D11_TEXTURE_ADDRESS_"); buf += ToUpper( addrMode ); return buf; }
wrBuffer Get_Filter( const wrName& filter ) { if( filter.IsEmpty() ) { return wrBuffer("D3D11_FILTER_MIN_MAG_MIP_LINEAR"); } wrBuffer buf("D3D11_FILTER_"); buf += ToUpper( filter ); return buf; }
/* * irccmp - case insensitive comparison of two 0 terminated strings. * * returns 0, if s1 equal to s2 * 1, if not */ int irccmp(const char *s1, const char *s2) { const unsigned char *str1 = (const unsigned char *)s1; const unsigned char *str2 = (const unsigned char *)s2; assert(s1 != NULL); assert(s2 != NULL); while (ToUpper(*str1) == ToUpper(*str2)) { if (*str1 == '\0') return(0); str1++; str2++; } return(1); }
void irccasecanon(char *str) { while (*str) { *str = ToUpper(*str); str++; } return; }
int ChooseAccessKey(const char *text, dword used) { for(const char *s = text; *s; s++) { byte ac = *s; if(ac < 128 && ac >= 'A' && ac <= 'Z' && (Ctrl::AccessKeyBit(ac) & used) == 0) return MAKELONG(ac, s - text + 1); } for(const char *s = text; *s; s++) { byte ac = ToUpper(*s); if(ac < 128 && ac >= 'A' && ac <= 'Z' && ac != 'I' && ac != 'L' && (Ctrl::AccessKeyBit(ac) & used) == 0) return ac; } for(const char *s = text; *s; s++) { byte ac = ToUpper(*s); if(ac < 128 && ac >= 'A' && ac <= 'Z' && (Ctrl::AccessKeyBit(ac) & used) == 0) return ac; } return 0; }
u32 StartsWithVowel(char* pointer) { char c = pointer[0]; c = ToUpper(c); if (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U') { return true; } return false; }
static CDROM_DeviceCapabilities getCapsUsingProductId(const char* prodID) { std::string productID; auto strID = as_string(prodID); std::for_each(CONST_RANGE(strID, i) { if (IsAlpha(i)) productID.push_back(ToUpper(i)); });
static bool strecmp0(const char *p, const char *s) { while(*p) { if(*p == '*') { while(*p == '*') p++; do if(ToUpper(*p) == ToUpper(*s) && strecmp0(p, s)) return true; while(*s++); return false; } if(*p == '?') { if(*s == '\0') return false; } else if(ToUpper(*p) != ToUpper(*s)) return false; s++; p++; } return *s == '\0'; }
Bool MapDrv(U8 drv_let,CPrt *p) { drv_let=ToUpper(drv_let); if ('A'<=drv_let<='Z') { drv_to_prt[drv_let-'A']=p; p->drv_let=drv_let; return TRUE; } else return FALSE; }
// reads in a report from cin and // saves the wds in the linked list // arg: nothing // rets: true if all the words were read correctly bool BogScorer::read_report() { string status; string word; bool insert_worked; while (cin >> status) { status = ToUpper(status); cin >> word; word = ToUpper(word); insert_worked = insert(word,status); if (!insert_worked) { return false; } } return true; }
int InputManager::GetHashFromKeyName( const String& keyId ) { //Find key ID KeyNameTable::iterator itr = _keyNameTable.find(ToUpper(keyId)); if( itr == _keyNameTable.end() ) return -1; return (*itr).second; }
ActorFactoryDelegate* ActorFactory::FindDelegate( const String& className ) { String useName = ToUpper(className); FactoryDelegateTable::iterator itr = _factoryDelegateTable.find( useName ); if( itr == _factoryDelegateTable.end() ) return NULL; return itr->second; }
int ircncasecmp(const char *str1, const char *str2, size_t n) { const unsigned char *s1 = (const unsigned char *)str1; const unsigned char *s2 = (const unsigned char *)str2; int res; if (match_mapping == MATCH_ASCII) return strncasecmp(str1, str2, n); while ((res = ToUpper(*s1) - ToUpper(*s2)) == 0) { s1++; s2++; n--; if (n == 0 || (*s1 == '\0' && *s2 == '\0')) return 0; } return (res); }
int ircncmp(const char *s1, const char *s2, size_t n) { const unsigned char *str1 = (const unsigned char *)s1; const unsigned char *str2 = (const unsigned char *)s2; assert(s1 != NULL); assert(s2 != NULL); assert(n > 0); if (n == 0) return 0; for (; ToUpper(*str1) == ToUpper(*str2); ++str1, ++str2) if (--n == 0 || *str1 == '\0') return 0; return 1; }
std::string StringUtils::GetWordFromListInLine(std::vector<std::string> &wordList,std::string line) { ToUpper(line); for (size_t i = 0; i < wordList.size(); i++) { if(line.find( wordList[i] ) != std::string::npos ) if( GetStandAloneWordInLineIndex(line,wordList[i]) > -1) return wordList[i]; } return ""; }
void ActorFactory::AddActorFactoryDelegate( const String& className, ActorFactoryDelegate* del ) { String useName = ToUpper(className); ActorFactoryDelegate* foundDelegate = FindDelegate(useName); if( foundDelegate != NULL ) delete foundDelegate; _factoryDelegateTable[useName] = del; del->RegisterOriginalConsoleCommands(); }
CScene* CText2Scene::CreateScene(const char* heading) { CScene *pScene = new CScene(); string title(heading); pScene->m_Location = m_pParser->GetLocation(title.c_str(), title); pScene->m_Time = m_pParser->GetTime(title.c_str(), title); Trim(title); ToUpper(title); pScene->m_Title = title; return pScene; }
char ToAsciiUS(char code) { char ascii; ascii=tecladoUS[shift][code]; if( caps && !shift && IsLetter(ascii) ) ascii=ToUpper(ascii); else if( caps && shift && IsLetter(ascii) ) ascii=ToLower(ascii); return ascii; }
// Returns the name of the environment variable corresponding to the // given flag. For example, FlagToEnvVar("foo") will return // "GTEST_FOO" in the open-source version. static std::string FlagToEnvVar(const char* flag) { const std::string full_flag = (Message() << GTEST_FLAG_PREFIX_ << flag).GetString(); Message env_var; for (size_t i = 0; i != full_flag.length(); i++) { env_var << ToUpper(full_flag.c_str()[i]); } return env_var.GetString(); }
/****************************************************************** ** Procedure: PrettyTmpName (char * oldname) ** Procedure: PrettyNewName (char * oldname) ** Parameters: oldname ** Returns: a new capitalized name ** Description: creates a new name with first character's in caps ** Side Effects: PrettyNewName allocates memory for the new name ** Status: OK 7-Oct-1992 kcm ******************************************************************/ const char * PrettyTmpName( const char * oldname ) { int i = 0; static char newname [BUFSIZ]; newname [0] = '\0'; while( ( oldname [i] != '\0' ) && ( i < BUFSIZ ) ) { newname [i] = ToLower( oldname [i] ); if( oldname [i] == '_' ) { /* character is '_' */ ++i; newname [i] = ToUpper( oldname [i] ); } if( oldname [i] != '\0' ) { ++i; } } newname [0] = ToUpper( oldname [0] ); newname [i] = '\0'; return newname; }
bool FileList::FindChar(int from, int chr) { for(int i = max(0, from); i < GetCount(); i++) { WString x = Get(i).name.ToWString(); if(ToUpper(ToAscii(x[0])) == chr) { ClearSelection(); SetCursor(i); return true; } } return false; }
Value Sql::operator[](SqlId id) const { String s = ~id; for(int j = 0; j < 2; j++) { for(int i = 0; i < cn->info.GetCount(); i++) if(cn->info[i].name == s) return operator[](i); s = ToUpper(s); } NEVER_(String().Cat() << "SQL [" << ~id << "] not found"); return Value(); }