diff options
author | Sergio Giro <sgiro@google.com> | 2015-09-23 17:15:12 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-09-23 17:15:12 +0000 |
commit | c565bdb67b801fe2b4965b44e53dccfd9097993c (patch) | |
tree | fae97afa559ac30497bf7b5d1df2009236f8dde7 /libutils/String8.cpp | |
parent | ec22417993d2a9a98ee957ffc7cd4af95debb546 (diff) | |
parent | f777655d85af3aefa4a1683f289da1ec67988330 (diff) |
am f777655d: resolved conflicts for 6ee734cf to stage-aosp-master
* commit 'f777655d85af3aefa4a1683f289da1ec67988330':
libutils: hide SharedBuffer by moving SharedBuffer.h to the implementation directory
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; |