summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergio Giro2015-09-23 11:58:25 -0500
committerSergio Giro2015-09-23 11:58:25 -0500
commitf777655d85af3aefa4a1683f289da1ec67988330 (patch)
tree450c8b2064bd5a7a4e04a8bb85b784ea0f9048e2 /libutils/String8.cpp
parent64c058da2335b37b7a179fd3ffef5cbf7b5e2a25 (diff)
parent6ee734cfa029e7d2d61fe577af23c28cd831b8b6 (diff)
downloadplatform-system-core-f777655d85af3aefa4a1683f289da1ec67988330.tar.gz
platform-system-core-f777655d85af3aefa4a1683f289da1ec67988330.tar.xz
platform-system-core-f777655d85af3aefa4a1683f289da1ec67988330.zip
resolved conflicts for 6ee734cf to stage-aosp-master
Change-Id: Ia06c4d941d9b8828707299bb363f51fab5549897
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 2d0602357..4fca2c119 100644
--- a/libutils/String8.cpp
+++ b/libutils/String8.cpp
@@ -22,12 +22,13 @@
22#include <utils/Compat.h> 22#include <utils/Compat.h>
23#include <utils/Log.h> 23#include <utils/Log.h>
24#include <utils/Unicode.h> 24#include <utils/Unicode.h>
25#include <utils/SharedBuffer.h>
26#include <utils/String16.h> 25#include <utils/String16.h>
27#include <utils/threads.h> 26#include <utils/threads.h>
28 27
29#include <ctype.h> 28#include <ctype.h>
30 29
30#include "SharedBuffer.h"
31
31/* 32/*
32 * Functions outside android is below the namespace android, since they use 33 * Functions outside android is below the namespace android, since they use
33 * functions and constants in android namespace. 34 * functions and constants in android namespace.
@@ -214,6 +215,16 @@ String8::~String8()
214 SharedBuffer::bufferFromData(mString)->release(); 215 SharedBuffer::bufferFromData(mString)->release();
215} 216}
216 217
218size_t String8::length() const
219{
220 return SharedBuffer::sizeFromData(mString)-1;
221}
222
223const SharedBuffer* String8::sharedBuffer() const
224{
225 return SharedBuffer::bufferFromData(mString);
226}
227
217String8 String8::format(const char* fmt, ...) 228String8 String8::format(const char* fmt, ...)
218{ 229{
219 va_list args; 230 va_list args;