blob: c167e5f04d006872e1b8c9e54fd83f31f3f53078 [file] [log] [blame]
Avi Drissmane4622aa2022-09-08 20:36:061// Copyright 2020 The Chromium Authors
Jan Wilken Dörrie5048b932020-06-22 12:12:152// 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
13namespace base {
14
15BASE_EXPORT std::wstring NumberToWString(int value);
16BASE_EXPORT std::wstring NumberToWString(unsigned int value);
17BASE_EXPORT std::wstring NumberToWString(long value);
18BASE_EXPORT std::wstring NumberToWString(unsigned long value);
19BASE_EXPORT std::wstring NumberToWString(long long value);
20BASE_EXPORT std::wstring NumberToWString(unsigned long long value);
21BASE_EXPORT std::wstring NumberToWString(double value);
22
23// The following section contains overloads of the cross-platform APIs for
Jan Wilken Dörrie6de7bd9a2021-03-03 16:51:2324// std::wstring and base::WStringPiece.
Jan Wilken Dörrie5048b932020-06-22 12:12:1525BASE_EXPORT bool StringToInt(WStringPiece input, int* output);
26BASE_EXPORT bool StringToUint(WStringPiece input, unsigned* output);
27BASE_EXPORT bool StringToInt64(WStringPiece input, int64_t* output);
28BASE_EXPORT bool StringToUint64(WStringPiece input, uint64_t* output);
29BASE_EXPORT bool StringToSizeT(WStringPiece input, size_t* output);
30BASE_EXPORT bool StringToDouble(WStringPiece input, double* output);
Jan Wilken Dörrie5048b932020-06-22 12:12:1531
32} // namespace base
33
34#endif // BASE_STRINGS_STRING_NUMBER_CONVERSIONS_WIN_H_