summaryrefslogtreecommitdiff
path: root/base/HidlSupport.cpp
diff options
context:
space:
mode:
authorScott Randolph <randolphs@google.com>2017-04-03 14:07:14 -0700
committerSteven Moreland <smoreland@google.com>2017-04-12 05:13:22 +0000
commiteb0c337c4fdfe35b12039036555c2760a7c60884 (patch)
treecca821342193007a86c2947d01aa32afaecb0c94 /base/HidlSupport.cpp
parent89308d02d2665ea331ac7f729e8c1af3bb9a2170 (diff)
downloadlibhidl-eb0c337c4fdfe35b12039036555c2760a7c60884.tar.gz
Implicit const char* cast removed, operator<< added to hidl_string.
hidl_string no longer will provide an implicit cast to const char* as it interfers with other expected behaviors of the class. It now emulated std::string in requiring a call to .c_str() to get the same behavior. Bug: 36532780 Test: Build the tree for marlin, bullhead, bat (cherry picked from commit 0c84ab4192f9b0b03b9840b85fc430afa17f55f1) Merged-In: I6ba76522ef65aa211bc156144990ad8b7495b051 Change-Id: I6ba76522ef65aa211bc156144990ad8b7495b051
Diffstat (limited to 'base/HidlSupport.cpp')
-rw-r--r--base/HidlSupport.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/base/HidlSupport.cpp b/base/HidlSupport.cpp
index 5789d04..7cc8ef5 100644
--- a/base/HidlSupport.cpp
+++ b/base/HidlSupport.cpp
@@ -208,8 +208,9 @@ hidl_string::operator std::string() const {
return std::string(mBuffer, mSize);
}
-hidl_string::operator const char *() const {
- return mBuffer;
+std::ostream& operator<<(std::ostream& os, const hidl_string& str) {
+ os << str.c_str();
+ return os;
}
void hidl_string::copyFrom(const char *data, size_t size) {