• Home
  • Raw
  • Download

Lines Matching refs:len

44 static char* allocFromUTF8(const char* in, size_t len)  in allocFromUTF8()  argument
46 if (len > 0) { in allocFromUTF8()
47 if (len == SIZE_MAX) { in allocFromUTF8()
50 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8()
54 memcpy(str, in, len); in allocFromUTF8()
55 str[len] = 0; in allocFromUTF8()
62 static char* allocFromUTF16(const char16_t* in, size_t len) in allocFromUTF16() argument
64 if (len == 0) return getEmptyString(); in allocFromUTF16()
66 const ssize_t resultStrLen = utf16_to_utf8_length(in, len) + 1; in allocFromUTF16()
76 utf16_to_utf8(in, len, resultStr, resultStrLen); in allocFromUTF16()
79 static char* allocFromUTF32(const char32_t* in, size_t len) in allocFromUTF32() argument
81 if (len == 0) { in allocFromUTF32()
84 const ssize_t resultStrLen = utf32_to_utf8_length(in, len) + 1; in allocFromUTF32()
94 utf32_to_utf8(in, len, resultStr, resultStrLen); in allocFromUTF32()
125 String8::String8(const char* o, size_t len) in String8() argument
126 : mString(allocFromUTF8(o, len)) in String8()
140 String8::String8(const char16_t* o, size_t len) in String8() argument
141 : mString(allocFromUTF16(o, len)) in String8()
148 String8::String8(const char32_t* o, size_t len) in String8() argument
149 : mString(allocFromUTF32(o, len)) in String8()
193 status_t String8::setTo(const char* other, size_t len) in setTo() argument
195 const char *newString = allocFromUTF8(other, len); in setTo()
202 status_t String8::setTo(const char16_t* other, size_t len) in setTo() argument
204 const char *newString = allocFromUTF16(other, len); in setTo()
211 status_t String8::setTo(const char32_t* other, size_t len) in setTo() argument
213 const char *newString = allocFromUTF32(other, len); in setTo()
320 size_t len = size(); in find() local
321 if (start >= len) { in find()
334 size_t len = size(); in removeAll() local
336 while (size_t(index) < len) { in removeAll()
339 next = len; in removeAll()
354 const size_t len = size(); in toLower() local
355 if (start >= len) { in toLower()
358 if (start+length > len) { in toLower()
359 length = len-start; in toLower()
361 char* buf = lockBuffer(len); in toLower()
368 unlockBuffer(len); in toLower()
376 const size_t len = size(); in toUpper() local
377 if (start >= len) { in toUpper()
380 if (start+length > len) { in toUpper()
381 length = len-start; in toUpper()
383 char* buf = lockBuffer(len); in toUpper()
390 unlockBuffer(len); in toUpper()
410 void String8::setPathName(const char* name, size_t len) in setPathName() argument
412 char* buf = lockBuffer(len); in setPathName()
413 memcpy(buf, name, len); in setPathName()
415 if (len > 0 && buf[len-1] == OS_PATH_SEPARATOR) in setPathName()
416 len--; in setPathName()
417 buf[len] = '\0'; in setPathName()
418 unlockBuffer(len); in setPathName()
510 size_t len = length(); in appendPath() local
511 if (len == 0) { in appendPath()
518 char* buf = lockBuffer(len+1+newlen); in appendPath()
520 if (buf[len-1] != OS_PATH_SEPARATOR) in appendPath()
521 buf[len++] = OS_PATH_SEPARATOR; in appendPath()
522 memcpy(buf+len, name, newlen+1); in appendPath()
523 len += newlen; in appendPath()
524 unlockBuffer(len); in appendPath()
534 size_t len = length(); in convertToResPath() local
535 if (len > 0) { in convertToResPath()
536 char * buf = lockBuffer(len); in convertToResPath()
537 for (char * end = buf + len; buf < end; ++buf) { in convertToResPath()
541 unlockBuffer(len); in convertToResPath()