diff options
author | Sergio Giro <sgiro@google.com> | 2015-09-23 17:58:25 +0100 |
---|---|---|
committer | Sergio Giro <sgiro@google.com> | 2015-09-23 17:58:25 +0100 |
commit | f777655d85af3aefa4a1683f289da1ec67988330 (patch) | |
tree | 450c8b2064bd5a7a4e04a8bb85b784ea0f9048e2 /libutils/String8.cpp | |
parent | 64c058da2335b37b7a179fd3ffef5cbf7b5e2a25 (diff) | |
parent | 6ee734cfa029e7d2d61fe577af23c28cd831b8b6 (diff) |
resolved conflicts for 6ee734cf to stage-aosp-master
Change-Id: Ia06c4d941d9b8828707299bb363f51fab5549897
Diffstat (limited to 'libutils/String8.cpp')
-rw-r--r-- | libutils/String8.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libutils/String8.cpp b/libutils/String8.cpp index 2d0602357..4fca2c119 100644 --- a/libutils/String8.cpp +++ b/libutils/String8.cpp @@ -22,12 +22,13 @@ #include <utils/Compat.h> #include <utils/Log.h> #include <utils/Unicode.h> -#include <utils/SharedBuffer.h> #include <utils/String16.h> #include <utils/threads.h> #include <ctype.h> +#include "SharedBuffer.h" + /* * Functions outside android is below the namespace android, since they use * functions and constants in android namespace. @@ -214,6 +215,16 @@ String8::~String8() SharedBuffer::bufferFromData(mString)->release(); } +size_t String8::length() const +{ + return SharedBuffer::sizeFromData(mString)-1; +} + +const SharedBuffer* String8::sharedBuffer() const +{ + return SharedBuffer::bufferFromData(mString); +} + String8 String8::format(const char* fmt, ...) { va_list args; |