summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergio Giro2015-09-23 10:22:59 -0500
committerSergio Giro2015-09-23 10:22:59 -0500
commitd2529f28308ba7583f4d8baaa937218d81cbe8bd (patch)
tree08e7ec119fa22c98d69f649e7ffa05f544a7d9f0 /libutils/String8.cpp
parent1d758c90959225c76ed4d318290ad1bf11532409 (diff)
downloadplatform-system-core-d2529f28308ba7583f4d8baaa937218d81cbe8bd.tar.gz
platform-system-core-d2529f28308ba7583f4d8baaa937218d81cbe8bd.tar.xz
platform-system-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/String8.cpp')
-rw-r--r--libutils/String8.cpp13
1 files changed, 12 insertions, 1 deletions
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 @@
19#include <utils/Compat.h> 19#include <utils/Compat.h>
20#include <utils/Log.h> 20#include <utils/Log.h>
21#include <utils/Unicode.h> 21#include <utils/Unicode.h>
22#include <utils/SharedBuffer.h>
23#include <utils/String16.h> 22#include <utils/String16.h>
24#include <utils/threads.h> 23#include <utils/threads.h>
25 24
26#include <ctype.h> 25#include <ctype.h>
27 26
27#include "SharedBuffer.h"
28
28/* 29/*
29 * Functions outside android is below the namespace android, since they use 30 * Functions outside android is below the namespace android, since they use
30 * functions and constants in android namespace. 31 * functions and constants in android namespace.
@@ -211,6 +212,16 @@ String8::~String8()
211 SharedBuffer::bufferFromData(mString)->release(); 212 SharedBuffer::bufferFromData(mString)->release();
212} 213}
213 214
215size_t String8::length() const
216{
217 return SharedBuffer::sizeFromData(mString)-1;
218}
219
220const SharedBuffer* String8::sharedBuffer() const
221{
222 return SharedBuffer::bufferFromData(mString);
223}
224
214String8 String8::format(const char* fmt, ...) 225String8 String8::format(const char* fmt, ...)
215{ 226{
216 va_list args; 227 va_list args;