Lines Matching refs:buf
62 SharedBuffer* buf = SharedBuffer::alloc(1); in initialize_string8() local
63 char* str = (char*)buf->data(); in initialize_string8()
65 gEmptyStringBuf = buf; in initialize_string8()
81 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8() local
82 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF8()
83 if (buf) { in allocFromUTF8()
84 char* str = (char*)buf->data(); in allocFromUTF8()
104 SharedBuffer* buf = SharedBuffer::alloc(bytes+1); in allocFromUTF16() local
105 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF16()
106 if (!buf) { in allocFromUTF16()
110 char* str = (char*)buf->data(); in allocFromUTF16()
126 SharedBuffer* buf = SharedBuffer::alloc(bytes+1); in allocFromUTF32() local
127 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF32()
128 if (!buf) { in allocFromUTF32()
132 char* str = (char*) buf->data(); in allocFromUTF32()
339 char* buf = lockBuffer(oldLength + n); in appendFormatV() local
340 if (buf) { in appendFormatV()
341 vsnprintf(buf + oldLength, n + 1, fmt, args); in appendFormatV()
353 SharedBuffer* buf = SharedBuffer::bufferFromData(mString) in real_append() local
355 if (buf) { in real_append()
356 char* str = (char*)buf->data(); in real_append()
368 SharedBuffer* buf = SharedBuffer::bufferFromData(mString) in lockBuffer() local
370 if (buf) { in lockBuffer()
371 char* str = (char*)buf->data(); in lockBuffer()
386 SharedBuffer* buf = SharedBuffer::bufferFromData(mString) in unlockBuffer() local
388 if (! buf) { in unlockBuffer()
392 char* str = (char*)buf->data(); in unlockBuffer()
415 char* buf = lockBuffer(size()); in removeAll() local
416 if (!buf) return false; // out of memory in removeAll()
427 memcpy(buf + tail, buf + index + skip, next - index - skip); in removeAll()
449 char* buf = lockBuffer(len); in toLower() local
450 buf += start; in toLower()
452 *buf = tolower(*buf); in toLower()
453 buf++; in toLower()
473 char* buf = lockBuffer(len); in toUpper() local
474 buf += start; in toUpper()
476 *buf = toupper(*buf); in toUpper()
477 buf++; in toUpper()
508 char* buf = lockBuffer(len); in setPathName() local
510 memcpy(buf, name, len); in setPathName()
513 if (len > 0 && buf[len-1] == OS_PATH_SEPARATOR) in setPathName()
516 buf[len] = '\0'; in setPathName()
524 const char*const buf = mString; in getPathLeaf() local
526 cp = strrchr(buf, OS_PATH_SEPARATOR); in getPathLeaf()
549 const char* buf = str; in walkPath() local
551 cp = strchr(buf, OS_PATH_SEPARATOR); in walkPath()
552 if (cp == buf) { in walkPath()
554 buf = buf+1; in walkPath()
555 cp = strchr(buf, OS_PATH_SEPARATOR); in walkPath()
559 String8 res = buf != str ? String8(buf) : *this; in walkPath()
564 String8 res(buf, cp-buf); in walkPath()
638 char* buf = lockBuffer(len+1+newlen); in appendPath() local
641 if (buf[len-1] != OS_PATH_SEPARATOR) in appendPath()
642 buf[len++] = OS_PATH_SEPARATOR; in appendPath()
644 memcpy(buf+len, name, newlen+1); in appendPath()
661 char * buf = lockBuffer(len); in convertToResPath() local
662 for (char * end = buf + len; buf < end; ++buf) { in convertToResPath()
663 if (*buf == OS_PATH_SEPARATOR) in convertToResPath()
664 *buf = RES_PATH_SEPARATOR; in convertToResPath()