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
diff --git a/libutils/String16.cpp b/libutils/String16.cpp
index 91efdaa..67be9d8 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 @@
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();