diff options
| author | 2020-11-16 17:28:31 +0000 | |
|---|---|---|
| committer | 2020-11-16 17:28:31 +0000 | |
| commit | 889c07154c581bb24383a6beebe3d88ba098ef0c (patch) | |
| tree | ebbf436f9e51f296a17e57d9955ce5897084e37c | |
| parent | 02d77dcfdf88063b0492869cbb61cfdcd7442f4e (diff) | |
| parent | 85b507c3ba6546f04d09373f1dbdb78b6b401f31 (diff) | |
Merge "libbinder: Status s/stringstream/ostream/" am: 5e36c71555 am: 84adff87d5 am: 85b507c3ba
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1498439
Change-Id: I055291edccd72c21065e7386f547bc1d878621ec
| -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 |