summaryrefslogtreecommitdiffstats
path: root/include/utils/String8.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/utils/String8.h')
-rw-r--r--include/utils/String8.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/utils/String8.h b/include/utils/String8.h
index c4b18a4..ef0b51a 100644
--- a/include/utils/String8.h
+++ b/include/utils/String8.h
@@ -171,6 +171,9 @@ public:
status_t append(const char* other);
status_t append(const char* other, size_t numChars);
+ status_t appendFormat(const char* fmt, ...)
+ __attribute__((format (printf, 2, 3)));
+
// Note that this function takes O(N) time to calculate the value.
// No cache value is stored.
size_t getUtf32Length() const;
@@ -372,7 +375,7 @@ inline String8& String8::operator+=(const String8& other)
inline String8 String8::operator+(const String8& other) const
{
- String8 tmp;
+ String8 tmp(*this);
tmp += other;
return tmp;
}
@@ -385,7 +388,7 @@ inline String8& String8::operator+=(const char* other)
inline String8 String8::operator+(const char* other) const
{
- String8 tmp;
+ String8 tmp(*this);
tmp += other;
return tmp;
}