| Daniel Cheng | bacd7d5 | 2025-06-06 21:09:49 | [diff] [blame] | 1 | // Copyright 2025 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "base/strings/to_string.h" |
| 6 | |
| 7 | #include <string> |
| 8 | #include <string_view> |
| 9 | |
| 10 | #include "base/strings/utf_string_conversions.h" |
| 11 | |
| 12 | namespace base { |
| 13 | |
| 14 | std::string ToString(std::string_view sv) { |
| 15 | return std::string(sv); |
| 16 | } |
| 17 | |
| 18 | std::string ToString(std::u16string_view sv) { |
| 19 | return UTF16ToUTF8(sv); |
| 20 | } |
| 21 | |
| 22 | std::string ToString(std::wstring_view sv) { |
| 23 | return WideToUTF8(sv); |
| 24 | } |
| 25 | |
| 26 | } // namespace base |