summaryrefslogtreecommitdiff
path: root/libutils/String16.cpp
diff options
context:
space:
mode:
authorSergio Giro <sgiro@google.com>2015-09-23 17:15:12 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-23 17:15:12 +0000
commitc565bdb67b801fe2b4965b44e53dccfd9097993c (patch)
treefae97afa559ac30497bf7b5d1df2009236f8dde7 /libutils/String16.cpp
parentec22417993d2a9a98ee957ffc7cd4af95debb546 (diff)
parentf777655d85af3aefa4a1683f289da1ec67988330 (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/String16.cpp')
-rw-r--r--libutils/String16.cpp11
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();