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
commit80cdb94144a9179a6f0d6a80ee78be6358307eb7 (patch)
tree0b58f551214399aeabda9e029818d4c4e9d1049d /libs/utils/String8.cpp
parent6ef38d73d621b27e97fc76a55633c09fd2fd2b88 (diff)
parentdb360642ed7a48eb3b3607a791bbe449cc6529bb (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 e531a2a0f0..0bc5aff221 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();