Lines Matching refs:buf
48 SharedBuffer* buf = SharedBuffer::alloc(1); in getEmptyString() local
49 char* str = static_cast<char*>(buf->data()); in getEmptyString()
51 return buf; in getEmptyString()
66 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8() local
67 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF8()
68 if (buf) { in allocFromUTF8()
69 char* str = (char*)buf->data(); in allocFromUTF8()
90 SharedBuffer* buf = SharedBuffer::alloc(resultStrLen); in allocFromUTF16() local
91 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF16()
92 if (!buf) { in allocFromUTF16()
96 char* resultStr = (char*)buf->data(); in allocFromUTF16()
112 SharedBuffer* buf = SharedBuffer::alloc(resultStrLen); in allocFromUTF32() local
113 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF32()
114 if (!buf) { in allocFromUTF32()
118 char* resultStr = (char*) buf->data(); in allocFromUTF32()
321 char* buf = lockBuffer(oldLength + n); in appendFormatV() local
322 if (buf) { in appendFormatV()
323 vsnprintf(buf + oldLength, n + 1, fmt, args); in appendFormatV()
334 SharedBuffer* buf; in real_append() local
338 (buf = SharedBuffer::bufferFromData(mString)->editResize(newLen)) == nullptr) { in real_append()
342 char* str = (char*)buf->data(); in real_append()
352 SharedBuffer* buf = SharedBuffer::bufferFromData(mString) in lockBuffer() local
354 if (buf) { in lockBuffer()
355 char* str = (char*)buf->data(); in lockBuffer()
370 SharedBuffer* buf = SharedBuffer::bufferFromData(mString) in unlockBuffer() local
372 if (! buf) { in unlockBuffer()
376 char* str = (char*)buf->data(); in unlockBuffer()
399 char* buf = lockBuffer(size()); in removeAll() local
400 if (!buf) return false; // out of memory in removeAll()
411 memmove(buf + tail, buf + index + skip, next - index - skip); in removeAll()
424 char* buf = lockBuffer(length); in toLower() local
426 *buf = static_cast<char>(tolower(*buf)); in toLower()
427 buf++; in toLower()
437 char* buf = s.lockBuffer(len); in setPathName() local
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()
451 const char*const buf = mString; in getPathLeaf() local
453 cp = strrchr(buf, OS_PATH_SEPARATOR); in getPathLeaf()
476 const char* buf = str; in walkPath() local
478 cp = strchr(buf, OS_PATH_SEPARATOR); in walkPath()
479 if (cp == buf) { in walkPath()
481 buf = buf+1; in walkPath()
482 cp = strchr(buf, OS_PATH_SEPARATOR); in walkPath()
486 String8 res = buf != str ? String8(buf) : *this; in walkPath()
491 String8 res(buf, cp-buf); in walkPath()
565 char* buf = lockBuffer(len+1+newlen); in appendPath() local
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()
588 char * buf = lockBuffer(len); in convertToResPath() local
589 for (char * end = buf + len; buf < end; ++buf) { in convertToResPath()
590 if (*buf == OS_PATH_SEPARATOR) in convertToResPath()
591 *buf = RES_PATH_SEPARATOR; in convertToResPath()