string_number_conversions_win.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_STRINGS_STRING_NUMBER_CONVERSIONS_WIN_H_
  5. #define BASE_STRINGS_STRING_NUMBER_CONVERSIONS_WIN_H_
  6. #include <string>
  7. #include "base/base_export.h"
  8. #include "base/strings/string_piece.h"
  9. namespace base {
  10. BASE_EXPORT std::wstring NumberToWString(int value);
  11. BASE_EXPORT std::wstring NumberToWString(unsigned int value);
  12. BASE_EXPORT std::wstring NumberToWString(long value);
  13. BASE_EXPORT std::wstring NumberToWString(unsigned long value);
  14. BASE_EXPORT std::wstring NumberToWString(long long value);
  15. BASE_EXPORT std::wstring NumberToWString(unsigned long long value);
  16. BASE_EXPORT std::wstring NumberToWString(double value);
  17. // The following section contains overloads of the cross-platform APIs for
  18. // std::wstring and base::WStringPiece.
  19. BASE_EXPORT bool StringToInt(WStringPiece input, int* output);
  20. BASE_EXPORT bool StringToUint(WStringPiece input, unsigned* output);
  21. BASE_EXPORT bool StringToInt64(WStringPiece input, int64_t* output);
  22. BASE_EXPORT bool StringToUint64(WStringPiece input, uint64_t* output);
  23. BASE_EXPORT bool StringToSizeT(WStringPiece input, size_t* output);
  24. BASE_EXPORT bool StringToDouble(WStringPiece input, double* output);
  25. } // namespace base
  26. #endif // BASE_STRINGS_STRING_NUMBER_CONVERSIONS_WIN_H_