diff options
author | Jeff Sharkey <jsharkey@android.com> | 2013-05-30 13:53:39 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2013-05-30 14:04:28 -0700 |
commit | 69c328d4373f26f712e259302a97431cbc27b74b (patch) | |
tree | 1b4c90f9e25cd10de25f93901f2616dc413dfcdb /TextOutput.cpp | |
parent | 75feddc325a2b52940641bb7af6a2d87643531f3 (diff) | |
download | libhwbinder-69c328d4373f26f712e259302a97431cbc27b74b.tar.gz |
Bring back overloading to print String8/16.
Change-Id: Iecab20db2b8574d5f1e6fdefdc2c8d4ce6c37121
Diffstat (limited to 'TextOutput.cpp')
-rw-r--r-- | TextOutput.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/TextOutput.cpp b/TextOutput.cpp index 9637334..db3e858 100644 --- a/TextOutput.cpp +++ b/TextOutput.cpp @@ -18,6 +18,9 @@ #include <binder/Debug.h> +#include <utils/String8.h> +#include <utils/String16.h> + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -119,6 +122,18 @@ TextOutput& operator<<(TextOutput& to, const void* val) return to; } +TextOutput& operator<<(TextOutput& to, const String8& val) +{ + to << val.string(); + return to; +} + +TextOutput& operator<<(TextOutput& to, const String16& val) +{ + to << String8(val).string(); + return to; +} + static void textOutputPrinter(void* cookie, const char* txt) { ((TextOutput*)cookie)->print(txt, strlen(txt)); |