Avi Drissman | e4622aa | 2022-09-08 20:36:06 | [diff] [blame] | 1 | // Copyright 2020 The Chromium Authors |
Jan Wilken Dörrie | 5048b93 | 2020-06-22 12:12:15 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef BASE_STRINGS_STRING_NUMBER_CONVERSIONS_WIN_H_ |
| 6 | #define BASE_STRINGS_STRING_NUMBER_CONVERSIONS_WIN_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include "base/base_export.h" |
| 11 | #include "base/strings/string_piece.h" |
| 12 | |
| 13 | namespace base { |
| 14 | |
| 15 | BASE_EXPORT std::wstring NumberToWString(int value); |
| 16 | BASE_EXPORT std::wstring NumberToWString(unsigned int value); |
| 17 | BASE_EXPORT std::wstring NumberToWString(long value); |
| 18 | BASE_EXPORT std::wstring NumberToWString(unsigned long value); |
| 19 | BASE_EXPORT std::wstring NumberToWString(long long value); |
| 20 | BASE_EXPORT std::wstring NumberToWString(unsigned long long value); |
| 21 | BASE_EXPORT std::wstring NumberToWString(double value); |
| 22 | |
| 23 | // The following section contains overloads of the cross-platform APIs for |
Jan Wilken Dörrie | 6de7bd9a | 2021-03-03 16:51:23 | [diff] [blame] | 24 | // std::wstring and base::WStringPiece. |
Jan Wilken Dörrie | 5048b93 | 2020-06-22 12:12:15 | [diff] [blame] | 25 | BASE_EXPORT bool StringToInt(WStringPiece input, int* output); |
| 26 | BASE_EXPORT bool StringToUint(WStringPiece input, unsigned* output); |
| 27 | BASE_EXPORT bool StringToInt64(WStringPiece input, int64_t* output); |
| 28 | BASE_EXPORT bool StringToUint64(WStringPiece input, uint64_t* output); |
| 29 | BASE_EXPORT bool StringToSizeT(WStringPiece input, size_t* output); |
| 30 | BASE_EXPORT bool StringToDouble(WStringPiece input, double* output); |
Jan Wilken Dörrie | 5048b93 | 2020-06-22 12:12:15 | [diff] [blame] | 31 | |
| 32 | } // namespace base |
| 33 | |
| 34 | #endif // BASE_STRINGS_STRING_NUMBER_CONVERSIONS_WIN_H_ |