blob: 245c9230ff4b242c7581437894f83e5fc307cfa8 [file] [log] [blame]
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_STRINGS_ABSEIL_STRING_NUMBER_CONVERSIONS_H_
#define BASE_STRINGS_ABSEIL_STRING_NUMBER_CONVERSIONS_H_
#include <string_view>
#include "polyfills/base/base_export.h"
#include "absl/numeric/int128.h"
namespace gurl_base {
// Best effort conversion, see `gurl_base::StringToInt()` for restrictions.
// Will only successfully parse values that will fit into `output`.
BASE_EXPORT bool StringToUint128(std::string_view input, absl::uint128* output);
// Best effort conversion, see `gurl_base::StringToInt()` for restrictions.
// Will only successfully parse hex values that will fit into `output`.
// The string is not required to start with 0x.
BASE_EXPORT bool HexStringToUInt128(std::string_view input,
absl::uint128* output);
} // namespace base
#endif // BASE_STRINGS_ABSEIL_STRING_NUMBER_CONVERSIONS_H_