diff options
author | Sergio Giro <sgiro@google.com> | 2015-09-23 15:43:44 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-09-23 15:43:44 +0000 |
commit | 6ee734cfa029e7d2d61fe577af23c28cd831b8b6 (patch) | |
tree | 0ed51b4c87b581928a3608528a9fbc0387aa7024 /libutils/String8.cpp | |
parent | 9ea0ff343fa673e7c452b2241bc9738e46e0f5b1 (diff) | |
parent | d2529f28308ba7583f4d8baaa937218d81cbe8bd (diff) |
Merge "libutils: hide SharedBuffer by moving SharedBuffer.h to the implementation directory"
Diffstat (limited to 'libutils/String8.cpp')
-rw-r--r-- | libutils/String8.cpp | 13 |
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 @@ #include <utils/Compat.h> #include <utils/Log.h> #include <utils/Unicode.h> -#include <utils/SharedBuffer.h> #include <utils/String16.h> #include <utils/threads.h> #include <ctype.h> +#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; |