diff options
| author | 2020-11-16 17:42:38 +0000 | |
|---|---|---|
| committer | 2020-11-16 17:42:38 +0000 | |
| commit | 4f08e84390ca07b496e4af2d89c6f9df2fb5feef (patch) | |
| tree | a90e462ecb7fbbf35e56b866d5efa3d2de68302f | |
| parent | 92183858e217102490ccf8b0ebf5faac139794c3 (diff) | |
| parent | 889c07154c581bb24383a6beebe3d88ba098ef0c (diff) | |
Merge "libbinder: Status s/stringstream/ostream/" am: 5e36c71555 am: 84adff87d5 am: 85b507c3ba am: 889c07154c
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1498439
Change-Id: I2fe370435cbcd27ac6df823029a3ad1c8ae879f0
| -rw-r--r-- | libs/binder/Status.cpp | 5 | ||||
| -rw-r--r-- | libs/binder/include/binder/Status.h | 8 |
2 files changed, 5 insertions, 8 deletions
diff --git a/libs/binder/Status.cpp b/libs/binder/Status.cpp index 64ab7a9d14..b5a078c4c0 100644 --- a/libs/binder/Status.cpp +++ b/libs/binder/Status.cpp @@ -245,10 +245,5 @@ String8 Status::toString8() const { return ret; } -std::stringstream& operator<< (std::stringstream& stream, const Status& s) { - stream << s.toString8().string(); - return stream; -} - } // namespace binder } // namespace android diff --git a/libs/binder/include/binder/Status.h b/libs/binder/include/binder/Status.h index 7d889b6b14..c30ae01d60 100644 --- a/libs/binder/include/binder/Status.h +++ b/libs/binder/include/binder/Status.h @@ -18,7 +18,8 @@ #define ANDROID_BINDER_STATUS_H #include <cstdint> -#include <sstream> +#include <sstream> // historical +#include <ostream> #include <binder/Parcel.h> #include <utils/String8.h> @@ -153,8 +154,9 @@ private: String8 mMessage; }; // class Status -// For gtest output logging -std::stringstream& operator<< (std::stringstream& stream, const Status& s); +static inline std::ostream& operator<< (std::ostream& o, const Status& s) { + return o << s.toString8(); +} } // namespace binder } // namespace android |