コード例 #1
0
ファイル: string.cpp プロジェクト: alexlzg/acl
string& string::operator +=(short n)
{
	if (use_bin_)
	{
		append(&n, sizeof(n));
		return *this;
	}
	else
		return format_append("%d", n);
}
コード例 #2
0
ファイル: string.cpp プロジェクト: alexlzg/acl
string& string::operator +=(unsigned char n)
{
	if (use_bin_)
	{
		append(&n, sizeof(n));
		return *this;
	}
	else
		return format_append("%c", n);
}
コード例 #3
0
ファイル: string.cpp プロジェクト: alexlzg/acl
string& string::operator +=(acl_uint64 n)
{
	if (use_bin_)
	{
		append(&n, sizeof(n));
		return *this;
	}
	else
		return format_append("%llu", n);
}
コード例 #4
0
ファイル: qq_types.c プロジェクト: 5rather/pidgin-lwqq
const char* qq_level_to_str(int level)
{
	static const char* symbol[] = {"♔","⚙","☾","☆"};
	static const int number[] = {64,16,4,1};
	static char buf[128];
	int l = level;
	int repeat;
	int i,j;
	memset(buf,0,sizeof(buf));
	for(i=0;i<4;i++){
		repeat = l/number[i];
		l=l%number[i];
		for(j=0;j<repeat;j++){
			strcat(buf,symbol[i]);
		}
	}
	format_append(buf,"(%d)",level);
	return buf;
}