diff options
author | Sergio Giro <sgiro@google.com> | 2015-09-23 16:22:59 +0100 |
---|---|---|
committer | Sergio Giro <sgiro@google.com> | 2015-09-23 16:22:59 +0100 |
commit | d2529f28308ba7583f4d8baaa937218d81cbe8bd (patch) | |
tree | 08e7ec119fa22c98d69f649e7ffa05f544a7d9f0 /libutils/String16.cpp | |
parent | 1d758c90959225c76ed4d318290ad1bf11532409 (diff) | |
download | core-d2529f28308ba7583f4d8baaa937218d81cbe8bd.tar.gz core-d2529f28308ba7583f4d8baaa937218d81cbe8bd.tar.bz2 core-d2529f28308ba7583f4d8baaa937218d81cbe8bd.zip |
libutils: hide SharedBuffer by moving SharedBuffer.h to the implementation directory
Some methods in header files of classes using SharedBuffer need
to be moved to the implementation files accordingly
Change-Id: I891f3ace2b940ab219e4e449040bfed71c0547db
Diffstat (limited to 'libutils/String16.cpp')
-rw-r--r-- | libutils/String16.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libutils/String16.cpp b/libutils/String16.cpp index 91efdaa39..67be9d8fa 100644 --- a/libutils/String16.cpp +++ b/libutils/String16.cpp @@ -25,6 +25,7 @@ #include <stdio.h> #include <ctype.h> +#include "SharedBuffer.h" namespace android { @@ -165,6 +166,16 @@ String16::~String16() SharedBuffer::bufferFromData(mString)->release(); } +size_t String16::size() const +{ + return SharedBuffer::sizeFromData(mString)/sizeof(char16_t)-1; +} + +const SharedBuffer* String16::sharedBuffer() const +{ + return SharedBuffer::bufferFromData(mString); +} + void String16::setTo(const String16& other) { SharedBuffer::bufferFromData(other.mString)->acquire(); |