From d2529f28308ba7583f4d8baaa937218d81cbe8bd Mon Sep 17 00:00:00 2001 From: Sergio Giro Date: Wed, 23 Sep 2015 16:22:59 +0100 Subject: 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 --- libutils/String8.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'libutils/String8.cpp') diff --git a/libutils/String8.cpp b/libutils/String8.cpp index 69313ead7..5e8552049 100644 --- a/libutils/String8.cpp +++ b/libutils/String8.cpp @@ -19,12 +19,13 @@ #include #include #include -#include #include #include #include +#include "SharedBuffer.h" + /* * Functions outside android is below the namespace android, since they use * functions and constants in android namespace. @@ -211,6 +212,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; -- cgit v1.2.3