示例#1
0
int compare_wchar(unsigned c1,unsigned c2)
{
	if (c1==c2) return 0;
	c1 = uCharLower(c1);
	c2 = uCharLower(c2);
	if (c1<c2) return -1;
	else if (c1>c2) return 1;
	else return 0;
}
示例#2
0
	void insert(const char * src,unsigned idx,pfc::string_base & out)
	{
		out.reset();
		out.add_string(src,idx);
		out.add_string("&");
		out.add_string(src+idx);
		used.add_char(uCharLower(src[idx]));
	}
示例#3
0
static bool test_recur(const char * fn,const char * rm,bool b_sep)
{
	for(;;)
	{
		if ((b_sep && *rm==';') || *rm==0) return *fn==0;
		else if (*rm=='*')
		{
			rm++;
			do
			{
				if (test_recur(fn,rm,b_sep)) return true;
			} while(pfc::utf8_advance(fn));
			return false;
		}
		else if (*fn==0) return false;
		else if (*rm!='?' && uCharLower(pfc::utf8_get_char(fn))!=uCharLower(pfc::utf8_get_char(rm))) return false;
		
		fn = pfc::utf8_char_next(fn); rm = pfc::utf8_char_next(rm);
	}
}
示例#4
0
	bool check_string(const char * src)
	{//check for existing mnemonics
		const char * ptr = src;
		while(ptr = strchr(ptr,'&'))
		{
			if (ptr[1]=='&') ptr+=2;
			else
			{
				unsigned c = 0;
				if (pfc::utf8_decode_char(ptr+1,c)>0)
				{
					if (!is_used(c)) used.add_char(uCharLower(c));
				}
				return true;
			}
		}
		return false;
	}
示例#5
0
	bool is_used(unsigned c)
	{
		char temp[8];
		temp[pfc::utf8_encode_char(uCharLower(c),temp)]=0;
		return !!strstr(used,temp);
	}
示例#6
0
uint32_t SmartStrStr::ToLower(uint32_t c) {
	return (uint32_t)uCharLower(c);
}