1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-05 21:29:59 +00:00

AK: Remove now unused to_{int,uint,float,double} String functions

This commit is contained in:
Shannon Booth 2023-12-23 15:58:33 +13:00 committed by Andreas Kling
parent e2e7c4d574
commit d51f84501a
6 changed files with 0 additions and 130 deletions

View File

@ -158,42 +158,6 @@ ByteBuffer ByteString::to_byte_buffer() const
return ByteBuffer::copy(bytes()).release_value_but_fixme_should_propagate_errors();
}
template<typename T>
Optional<T> ByteString::to_int(TrimWhitespace trim_whitespace) const
{
return StringUtils::convert_to_int<T>(view(), trim_whitespace);
}
template Optional<i8> ByteString::to_int(TrimWhitespace) const;
template Optional<i16> ByteString::to_int(TrimWhitespace) const;
template Optional<i32> ByteString::to_int(TrimWhitespace) const;
template Optional<long> ByteString::to_int(TrimWhitespace) const;
template Optional<long long> ByteString::to_int(TrimWhitespace) const;
template<typename T>
Optional<T> ByteString::to_uint(TrimWhitespace trim_whitespace) const
{
return StringUtils::convert_to_uint<T>(view(), trim_whitespace);
}
template Optional<u8> ByteString::to_uint(TrimWhitespace) const;
template Optional<u16> ByteString::to_uint(TrimWhitespace) const;
template Optional<u32> ByteString::to_uint(TrimWhitespace) const;
template Optional<unsigned long> ByteString::to_uint(TrimWhitespace) const;
template Optional<unsigned long long> ByteString::to_uint(TrimWhitespace) const;
#ifndef KERNEL
Optional<double> ByteString::to_double(TrimWhitespace trim_whitespace) const
{
return StringUtils::convert_to_floating_point<double>(*this, trim_whitespace);
}
Optional<float> ByteString::to_float(TrimWhitespace trim_whitespace) const
{
return StringUtils::convert_to_floating_point<float>(*this, trim_whitespace);
}
#endif
bool ByteString::starts_with(StringView str, CaseSensitivity case_sensitivity) const
{
return StringUtils::starts_with(*this, str, case_sensitivity);

View File

@ -110,15 +110,6 @@ public:
[[nodiscard]] bool matches(StringView mask, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
[[nodiscard]] bool matches(StringView mask, Vector<MaskSpan>&, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
template<typename T = int>
[[nodiscard]] Optional<T> to_int(TrimWhitespace = TrimWhitespace::Yes) const;
template<typename T = unsigned>
[[nodiscard]] Optional<T> to_uint(TrimWhitespace = TrimWhitespace::Yes) const;
#ifndef KERNEL
[[nodiscard]] Optional<double> to_double(TrimWhitespace = TrimWhitespace::Yes) const;
[[nodiscard]] Optional<float> to_float(TrimWhitespace = TrimWhitespace::Yes) const;
#endif
template<Arithmetic T>
Optional<T> to_number(TrimWhitespace trim_whitespace = TrimWhitespace::Yes) const
{

View File

@ -71,40 +71,6 @@ DeprecatedFlyString::DeprecatedFlyString(StringView string)
}
}
template<typename T>
Optional<T> DeprecatedFlyString::to_int(TrimWhitespace trim_whitespace) const
{
return StringUtils::convert_to_int<T>(view(), trim_whitespace);
}
template Optional<i8> DeprecatedFlyString::to_int(TrimWhitespace) const;
template Optional<i16> DeprecatedFlyString::to_int(TrimWhitespace) const;
template Optional<i32> DeprecatedFlyString::to_int(TrimWhitespace) const;
template Optional<i64> DeprecatedFlyString::to_int(TrimWhitespace) const;
template<typename T>
Optional<T> DeprecatedFlyString::to_uint(TrimWhitespace trim_whitespace) const
{
return StringUtils::convert_to_uint<T>(view(), trim_whitespace);
}
template Optional<u8> DeprecatedFlyString::to_uint(TrimWhitespace) const;
template Optional<u16> DeprecatedFlyString::to_uint(TrimWhitespace) const;
template Optional<u32> DeprecatedFlyString::to_uint(TrimWhitespace) const;
template Optional<u64> DeprecatedFlyString::to_uint(TrimWhitespace) const;
#ifndef KERNEL
Optional<double> DeprecatedFlyString::to_double(TrimWhitespace trim_whitespace) const
{
return StringUtils::convert_to_floating_point<double>(view(), trim_whitespace);
}
Optional<float> DeprecatedFlyString::to_float(TrimWhitespace trim_whitespace) const
{
return StringUtils::convert_to_floating_point<float>(view(), trim_whitespace);
}
#endif
bool DeprecatedFlyString::equals_ignoring_ascii_case(StringView other) const
{
return StringUtils::equals_ignoring_ascii_case(view(), other);

View File

@ -75,15 +75,6 @@ public:
return view().to_number<T>(trim_whitespace);
}
template<typename T = int>
Optional<T> to_int(TrimWhitespace = TrimWhitespace::Yes) const;
template<typename T = unsigned>
Optional<T> to_uint(TrimWhitespace = TrimWhitespace::Yes) const;
#ifndef KERNEL
Optional<double> to_double(TrimWhitespace = TrimWhitespace::Yes) const;
Optional<float> to_float(TrimWhitespace = TrimWhitespace::Yes) const;
#endif
bool equals_ignoring_ascii_case(StringView) const;
bool starts_with(StringView, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
bool ends_with(StringView, CaseSensitivity = CaseSensitivity::CaseSensitive) const;

View File

@ -222,40 +222,7 @@ bool StringView::copy_characters_to_buffer(char* buffer, size_t buffer_size) con
return characters_to_copy == m_length;
}
template<typename T>
Optional<T> StringView::to_int() const
{
return StringUtils::convert_to_int<T>(*this);
}
template Optional<i8> StringView::to_int() const;
template Optional<i16> StringView::to_int() const;
template Optional<i32> StringView::to_int() const;
template Optional<long> StringView::to_int() const;
template Optional<long long> StringView::to_int() const;
template<typename T>
Optional<T> StringView::to_uint() const
{
return StringUtils::convert_to_uint<T>(*this);
}
template Optional<u8> StringView::to_uint() const;
template Optional<u16> StringView::to_uint() const;
template Optional<u32> StringView::to_uint() const;
template Optional<unsigned long> StringView::to_uint() const;
template Optional<unsigned long long> StringView::to_uint() const;
#ifndef KERNEL
Optional<double> StringView::to_double(TrimWhitespace trim_whitespace) const
{
return StringUtils::convert_to_floating_point<double>(*this, trim_whitespace);
}
Optional<float> StringView::to_float(TrimWhitespace trim_whitespace) const
{
return StringUtils::convert_to_floating_point<float>(*this, trim_whitespace);
}
bool StringView::operator==(ByteString const& string) const
{

View File

@ -219,15 +219,6 @@ public:
// following newline.".
[[nodiscard]] Vector<StringView> lines(bool consider_cr = true) const;
template<typename T = int>
Optional<T> to_int() const;
template<typename T = unsigned>
Optional<T> to_uint() const;
#ifndef KERNEL
Optional<double> to_double(TrimWhitespace trim_whitespace = TrimWhitespace::Yes) const;
Optional<float> to_float(TrimWhitespace trim_whitespace = TrimWhitespace::Yes) const;
#endif
// Create a new substring view of this string view, starting either at the beginning of
// the given substring view, or after its end, and continuing until the end of this string
// view (that is, for the remaining part of its length). For example,