Ejemplo n.º 1
0
char16_t* packet::read_S(char16_t* dst_t)
{
	ushort len = 0;
	len = strlen16((char16_t*)&raw[pos]);
	if (!dst_t)
		dst_t = new char16_t[len + 1];
	len = strcpy16(dst_t, (char16_t*)&raw[pos]);
	pos += len;
	return dst_t;
}
Ejemplo n.º 2
0
String16::String16(const char16_t* o)
{
    size_t len = strlen16(o);
    SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t));
    ALOG_ASSERT(buf, "Unable to allocate shared buffer");
    if (buf) {
        char16_t* str = (char16_t*)buf->data();
        strcpy16(str, o);
        mString = str;
        return;
    }
    
    mString = getEmptyString();
}