Loading libutils/binder/include/utils/String8.h +1 −14 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <iostream> #include <string> #include <string_view> #include <utils/Errors.h> #include <utils/Unicode.h> Loading @@ -27,11 +28,6 @@ #include <string.h> // for strcmp #include <stdarg.h> #if __has_include(<string_view>) #include <string_view> #define HAS_STRING_VIEW #endif #if __cplusplus >= 202002L #include <compare> #endif Loading @@ -53,9 +49,7 @@ public: String8(const String8& o); explicit String8(const char* o); explicit String8(const char* o, size_t numChars); #ifdef HAS_STRING_VIEW explicit String8(std::string_view o); #endif explicit String8(const String16& o); explicit String8(const char16_t* o); Loading Loading @@ -125,9 +119,7 @@ public: inline operator const char*() const; #ifdef HAS_STRING_VIEW inline explicit operator std::string_view() const; #endif char* lockBuffer(size_t size); void unlockBuffer(); Loading Loading @@ -372,20 +364,15 @@ inline String8::operator const char*() const return mString; } #ifdef HAS_STRING_VIEW inline String8::String8(std::string_view o) : String8(o.data(), o.length()) { } inline String8::operator std::string_view() const { return {mString, length()}; } #endif } // namespace android // --------------------------------------------------------------------------- #undef HAS_STRING_VIEW #endif // ANDROID_STRING8_H Loading
libutils/binder/include/utils/String8.h +1 −14 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <iostream> #include <string> #include <string_view> #include <utils/Errors.h> #include <utils/Unicode.h> Loading @@ -27,11 +28,6 @@ #include <string.h> // for strcmp #include <stdarg.h> #if __has_include(<string_view>) #include <string_view> #define HAS_STRING_VIEW #endif #if __cplusplus >= 202002L #include <compare> #endif Loading @@ -53,9 +49,7 @@ public: String8(const String8& o); explicit String8(const char* o); explicit String8(const char* o, size_t numChars); #ifdef HAS_STRING_VIEW explicit String8(std::string_view o); #endif explicit String8(const String16& o); explicit String8(const char16_t* o); Loading Loading @@ -125,9 +119,7 @@ public: inline operator const char*() const; #ifdef HAS_STRING_VIEW inline explicit operator std::string_view() const; #endif char* lockBuffer(size_t size); void unlockBuffer(); Loading Loading @@ -372,20 +364,15 @@ inline String8::operator const char*() const return mString; } #ifdef HAS_STRING_VIEW inline String8::String8(std::string_view o) : String8(o.data(), o.length()) { } inline String8::operator std::string_view() const { return {mString, length()}; } #endif } // namespace android // --------------------------------------------------------------------------- #undef HAS_STRING_VIEW #endif // ANDROID_STRING8_H