xref: /aosp_15_r20/external/cronet/base/strings/string_number_conversions_win.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2020 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 #ifndef BASE_STRINGS_STRING_NUMBER_CONVERSIONS_WIN_H_
6 #define BASE_STRINGS_STRING_NUMBER_CONVERSIONS_WIN_H_
7 
8 #include <string>
9 #include <string_view>
10 
11 #include "base/base_export.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
24 // std::wstring and std::wstring_view.
25 BASE_EXPORT bool StringToInt(std::wstring_view input, int* output);
26 BASE_EXPORT bool StringToUint(std::wstring_view input, unsigned* output);
27 BASE_EXPORT bool StringToInt64(std::wstring_view input, int64_t* output);
28 BASE_EXPORT bool StringToUint64(std::wstring_view input, uint64_t* output);
29 BASE_EXPORT bool StringToSizeT(std::wstring_view input, size_t* output);
30 BASE_EXPORT bool StringToDouble(std::wstring_view input, double* output);
31 
32 }  // namespace base
33 
34 #endif  // BASE_STRINGS_STRING_NUMBER_CONVERSIONS_WIN_H_
35