Loading camera/include/camera/StringUtils.h +5 −6 Original line number Original line Diff line number Diff line Loading @@ -17,8 +17,6 @@ #ifndef ANDROID_SERVERS_CAMERA_STRINGUTILS_H #ifndef ANDROID_SERVERS_CAMERA_STRINGUTILS_H #define ANDROID_SERVERS_CAMERA_STRINGUTILS_H #define ANDROID_SERVERS_CAMERA_STRINGUTILS_H #include <codecvt> #include <locale> #include <memory> #include <memory> #include <optional> #include <optional> #include <string> #include <string> Loading Loading @@ -65,8 +63,8 @@ namespace android { } } inline std::string toStdString(const String16 &str) { inline std::string toStdString(const String16 &str) { std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert; String8 str8(str); return convert.to_bytes(str.c_str()); return std::string(str8.c_str()); } } /** /** Loading @@ -74,8 +72,9 @@ namespace android { * len is the number of characters. * len is the number of characters. */ */ inline std::string toStdString(const char16_t *str, size_t len) { inline std::string toStdString(const char16_t *str, size_t len) { std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert; String16 str16(str, len); return convert.to_bytes(str, str + len); String8 str8(str16); return std::string(str8.c_str()); } } } // namespace android } // namespace android Loading Loading
camera/include/camera/StringUtils.h +5 −6 Original line number Original line Diff line number Diff line Loading @@ -17,8 +17,6 @@ #ifndef ANDROID_SERVERS_CAMERA_STRINGUTILS_H #ifndef ANDROID_SERVERS_CAMERA_STRINGUTILS_H #define ANDROID_SERVERS_CAMERA_STRINGUTILS_H #define ANDROID_SERVERS_CAMERA_STRINGUTILS_H #include <codecvt> #include <locale> #include <memory> #include <memory> #include <optional> #include <optional> #include <string> #include <string> Loading Loading @@ -65,8 +63,8 @@ namespace android { } } inline std::string toStdString(const String16 &str) { inline std::string toStdString(const String16 &str) { std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert; String8 str8(str); return convert.to_bytes(str.c_str()); return std::string(str8.c_str()); } } /** /** Loading @@ -74,8 +72,9 @@ namespace android { * len is the number of characters. * len is the number of characters. */ */ inline std::string toStdString(const char16_t *str, size_t len) { inline std::string toStdString(const char16_t *str, size_t len) { std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert; String16 str16(str, len); return convert.to_bytes(str, str + len); String8 str8(str16); return std::string(str8.c_str()); } } } // namespace android } // namespace android Loading