Beispiel #1
0
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;
}
Beispiel #2
0
void __fastcall TTestBedForm::FormKeyUp(TObject *Sender, WORD &Key, System::WideChar &KeyChar,
          TShiftState Shift)
{
  if (test)
  {
    test->KeyboardUp(static_cast<int>(ToUpper(KeyChar)));
  }
}
Beispiel #3
0
/* 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;
}
Beispiel #4
0
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;
}
Beispiel #5
0
/*
 * 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);
}
Beispiel #6
0
	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;
	}
Beispiel #7
0
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;
}
Beispiel #8
0
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;
}
Beispiel #9
0
wrBuffer GetTextureAddressMode( const wrName& addrMode )
{
	if( addrMode.IsEmpty() ) {
		return wrBuffer("D3D11_TEXTURE_ADDRESS_CLAMP");
	}
	wrBuffer	buf("D3D11_TEXTURE_ADDRESS_");
	buf += ToUpper( addrMode );
	return buf;
}
Beispiel #10
0
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;
}
Beispiel #11
0
/*
 * 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);
}
Beispiel #12
0
void irccasecanon(char *str)
{
	while (*str)
	{
		*str = ToUpper(*str);
		str++;
	}
	return;
}
Beispiel #13
0
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;
}
Beispiel #15
0
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));
	});
Beispiel #16
0
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';
}
Beispiel #17
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;
}
Beispiel #18
0
// 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;

}
Beispiel #20
0
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;
}
Beispiel #21
0
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;
}
Beispiel #23
0
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 "";
}
Beispiel #24
0
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();
}
Beispiel #25
0
	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;
	}
Beispiel #26
0
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;
}
Beispiel #27
0
// 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();
}
Beispiel #28
0
/******************************************************************
 ** 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;
}
Beispiel #29
0
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;
}
Beispiel #30
0
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();
}