Lines Matching refs:len

60 static char* allocFromUTF8(const char* in, size_t len)  in allocFromUTF8()  argument
62 if (len > 0) { in allocFromUTF8()
63 if (len == SIZE_MAX) { in allocFromUTF8()
66 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8()
70 memcpy(str, in, len); in allocFromUTF8()
71 str[len] = 0; in allocFromUTF8()
80 static char* allocFromUTF16(const char16_t* in, size_t len) in allocFromUTF16() argument
82 if (len == 0) return getEmptyString(); in allocFromUTF16()
85 const ssize_t resultStrLen = utf16_to_utf8_length(in, len) + 1; in allocFromUTF16()
97 utf16_to_utf8(in, len, resultStr, resultStrLen); in allocFromUTF16()
101 static char* allocFromUTF32(const char32_t* in, size_t len) in allocFromUTF32() argument
103 if (len == 0) { in allocFromUTF32()
107 const ssize_t resultStrLen = utf32_to_utf8_length(in, len) + 1; in allocFromUTF32()
119 utf32_to_utf8(in, len, resultStr, resultStrLen); in allocFromUTF32()
145 String8::String8(const char* o, size_t len) in String8() argument
146 : mString(allocFromUTF8(o, len)) in String8()
163 String8::String8(const char16_t* o, size_t len) in String8() argument
164 : mString(allocFromUTF16(o, len)) in String8()
171 String8::String8(const char32_t* o, size_t len) in String8() argument
172 : mString(allocFromUTF32(o, len)) in String8()
227 status_t String8::setTo(const char* other, size_t len) in setTo() argument
229 const char *newString = allocFromUTF8(other, len); in setTo()
238 status_t String8::setTo(const char16_t* other, size_t len) in setTo() argument
240 const char *newString = allocFromUTF16(other, len); in setTo()
249 status_t String8::setTo(const char32_t* other, size_t len) in setTo() argument
251 const char *newString = allocFromUTF32(other, len); in setTo()
386 size_t len = size(); in find() local
387 if (start >= len) { in find()
403 size_t len = size(); in removeAll() local
405 while (size_t(index) < len) { in removeAll()
408 next = len; in removeAll()
436 size_t len = strlen(name); in setPathName() local
437 char* buf = s.lockBuffer(len); in setPathName()
439 memcpy(buf, name, len); in setPathName()
442 if (len > 0 && buf[len - 1] == OS_PATH_SEPARATOR) len--; in setPathName()
443 buf[len] = '\0'; in setPathName()
445 s.unlockBuffer(len); in setPathName()
555 size_t len = length(); in appendPath() local
556 if (len == 0) { in appendPath()
565 char* buf = lockBuffer(len+1+newlen); in appendPath()
568 if (buf[len-1] != OS_PATH_SEPARATOR) in appendPath()
569 buf[len++] = OS_PATH_SEPARATOR; in appendPath()
571 memcpy(buf+len, name, newlen+1); in appendPath()
572 len += newlen; in appendPath()
574 unlockBuffer(len); in appendPath()
586 size_t len = length(); in convertToResPath() local
587 if (len > 0) { in convertToResPath()
588 char * buf = lockBuffer(len); in convertToResPath()
589 for (char * end = buf + len; buf < end; ++buf) { in convertToResPath()
593 unlockBuffer(len); in convertToResPath()