summaryrefslogtreecommitdiff
path: root/libs/utils/String8.cpp
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2010-12-02 16:03:05 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2010-12-02 16:03:05 -0800
commitfddcb0617456da836c8a4e5e16cc4177447608be (patch)
treeb25907cf96374ff4bcc0aed3ccec1c6901d734d4 /libs/utils/String8.cpp
parentcd5e8b60cad508714fc9ecf42d6431ad8ccf7db1 (diff)
parent9065504a63d6bf37bf621191fda1d1fe4da76ee3 (diff)
Merge "Improve support for external keyboards."
Diffstat (limited to 'libs/utils/String8.cpp')
-rw-r--r--libs/utils/String8.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/utils/String8.cpp b/libs/utils/String8.cpp
index e531a2a0f0ce..0bc5aff2216b 100644
--- a/libs/utils/String8.cpp
+++ b/libs/utils/String8.cpp
@@ -195,6 +195,24 @@ String8::~String8()
SharedBuffer::bufferFromData(mString)->release();
}
+String8 String8::format(const char* fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+
+ String8 result(formatV(fmt, args));
+
+ va_end(args);
+ return result;
+}
+
+String8 String8::formatV(const char* fmt, va_list args)
+{
+ String8 result;
+ result.appendFormatV(fmt, args);
+ return result;
+}
+
void String8::clear() {
SharedBuffer::bufferFromData(mString)->release();
mString = getEmptyString();