mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
68
AK/String.h
68
AK/String.h
|
@ -48,7 +48,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
String(const String& other)
|
||||
String(String const& other)
|
||||
: m_impl(const_cast<String&>(other).m_impl)
|
||||
{
|
||||
}
|
||||
|
@ -58,12 +58,12 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
String(const char* cstring, ShouldChomp shouldChomp = NoChomp)
|
||||
String(char const* cstring, ShouldChomp shouldChomp = NoChomp)
|
||||
: m_impl(StringImpl::create(cstring, shouldChomp))
|
||||
{
|
||||
}
|
||||
|
||||
String(const char* cstring, size_t length, ShouldChomp shouldChomp = NoChomp)
|
||||
String(char const* cstring, size_t length, ShouldChomp shouldChomp = NoChomp)
|
||||
: m_impl(StringImpl::create(cstring, length, shouldChomp))
|
||||
{
|
||||
}
|
||||
|
@ -73,12 +73,12 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
String(const StringImpl& impl)
|
||||
String(StringImpl const& impl)
|
||||
: m_impl(const_cast<StringImpl&>(impl))
|
||||
{
|
||||
}
|
||||
|
||||
String(const StringImpl* impl)
|
||||
String(StringImpl const* impl)
|
||||
: m_impl(const_cast<StringImpl*>(impl))
|
||||
{
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
String(const FlyString&);
|
||||
String(FlyString const&);
|
||||
|
||||
[[nodiscard]] static String repeated(char, size_t count);
|
||||
[[nodiscard]] static String repeated(StringView, size_t count);
|
||||
|
@ -102,7 +102,7 @@ public:
|
|||
[[nodiscard]] static String roman_number_from(size_t value);
|
||||
|
||||
template<class SeparatorType, class CollectionType>
|
||||
[[nodiscard]] static String join(const SeparatorType& separator, const CollectionType& collection, StringView fmtstr = "{}"sv)
|
||||
[[nodiscard]] static String join(SeparatorType const& separator, CollectionType const& collection, StringView fmtstr = "{}"sv)
|
||||
{
|
||||
StringBuilder builder;
|
||||
builder.join(separator, collection, fmtstr);
|
||||
|
@ -169,7 +169,7 @@ public:
|
|||
[[nodiscard]] ALWAYS_INLINE bool is_empty() const { return length() == 0; }
|
||||
[[nodiscard]] ALWAYS_INLINE size_t length() const { return m_impl ? m_impl->length() : 0; }
|
||||
// Includes NUL-terminator, if non-nullptr.
|
||||
[[nodiscard]] ALWAYS_INLINE const char* characters() const { return m_impl ? m_impl->characters() : nullptr; }
|
||||
[[nodiscard]] ALWAYS_INLINE char const* characters() const { return m_impl ? m_impl->characters() : nullptr; }
|
||||
|
||||
[[nodiscard]] bool copy_characters_to_buffer(char* buffer, size_t buffer_size) const;
|
||||
|
||||
|
@ -181,13 +181,13 @@ public:
|
|||
return {};
|
||||
}
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE const char& operator[](size_t i) const
|
||||
[[nodiscard]] ALWAYS_INLINE char const& operator[](size_t i) const
|
||||
{
|
||||
VERIFY(!is_null());
|
||||
return (*m_impl)[i];
|
||||
}
|
||||
|
||||
using ConstIterator = SimpleIterator<const String, const char>;
|
||||
using ConstIterator = SimpleIterator<const String, char const>;
|
||||
|
||||
[[nodiscard]] constexpr ConstIterator begin() const { return ConstIterator::begin(*this); }
|
||||
[[nodiscard]] constexpr ConstIterator end() const { return ConstIterator::end(*this); }
|
||||
|
@ -197,27 +197,27 @@ public:
|
|||
[[nodiscard]] bool starts_with(char) const;
|
||||
[[nodiscard]] bool ends_with(char) const;
|
||||
|
||||
bool operator==(const String&) const;
|
||||
bool operator!=(const String& other) const { return !(*this == other); }
|
||||
bool operator==(String const&) const;
|
||||
bool operator!=(String const& other) const { return !(*this == other); }
|
||||
|
||||
bool operator==(StringView) const;
|
||||
bool operator!=(StringView other) const { return !(*this == other); }
|
||||
|
||||
bool operator==(const FlyString&) const;
|
||||
bool operator!=(const FlyString& other) const { return !(*this == other); }
|
||||
bool operator==(FlyString const&) const;
|
||||
bool operator!=(FlyString const& other) const { return !(*this == other); }
|
||||
|
||||
bool operator<(const String&) const;
|
||||
bool operator<(const char*) const;
|
||||
bool operator>=(const String& other) const { return !(*this < other); }
|
||||
bool operator>=(const char* other) const { return !(*this < other); }
|
||||
bool operator<(String const&) const;
|
||||
bool operator<(char const*) const;
|
||||
bool operator>=(String const& other) const { return !(*this < other); }
|
||||
bool operator>=(char const* other) const { return !(*this < other); }
|
||||
|
||||
bool operator>(const String&) const;
|
||||
bool operator>(const char*) const;
|
||||
bool operator<=(const String& other) const { return !(*this > other); }
|
||||
bool operator<=(const char* other) const { return !(*this > other); }
|
||||
bool operator>(String const&) const;
|
||||
bool operator>(char const*) const;
|
||||
bool operator<=(String const& other) const { return !(*this > other); }
|
||||
bool operator<=(char const* other) const { return !(*this > other); }
|
||||
|
||||
bool operator==(const char* cstring) const;
|
||||
bool operator!=(const char* cstring) const { return !(*this == cstring); }
|
||||
bool operator==(char const* cstring) const;
|
||||
bool operator!=(char const* cstring) const { return !(*this == cstring); }
|
||||
|
||||
[[nodiscard]] String isolated_copy() const;
|
||||
|
||||
|
@ -227,7 +227,7 @@ public:
|
|||
}
|
||||
|
||||
[[nodiscard]] StringImpl* impl() { return m_impl.ptr(); }
|
||||
[[nodiscard]] const StringImpl* impl() const { return m_impl.ptr(); }
|
||||
[[nodiscard]] StringImpl const* impl() const { return m_impl.ptr(); }
|
||||
|
||||
String& operator=(String&& other)
|
||||
{
|
||||
|
@ -236,7 +236,7 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
String& operator=(const String& other)
|
||||
String& operator=(String const& other)
|
||||
{
|
||||
if (this != &other)
|
||||
m_impl = const_cast<String&>(other).m_impl;
|
||||
|
@ -265,17 +265,17 @@ public:
|
|||
[[nodiscard]] ByteBuffer to_byte_buffer() const;
|
||||
|
||||
template<typename BufferType>
|
||||
[[nodiscard]] static String copy(const BufferType& buffer, ShouldChomp should_chomp = NoChomp)
|
||||
[[nodiscard]] static String copy(BufferType const& buffer, ShouldChomp should_chomp = NoChomp)
|
||||
{
|
||||
if (buffer.is_empty())
|
||||
return empty();
|
||||
return String((const char*)buffer.data(), buffer.size(), should_chomp);
|
||||
return String((char const*)buffer.data(), buffer.size(), should_chomp);
|
||||
}
|
||||
|
||||
[[nodiscard]] static String vformatted(StringView fmtstr, TypeErasedFormatParams&);
|
||||
|
||||
template<typename... Parameters>
|
||||
[[nodiscard]] static String formatted(CheckedFormatString<Parameters...>&& fmtstr, const Parameters&... parameters)
|
||||
[[nodiscard]] static String formatted(CheckedFormatString<Parameters...>&& fmtstr, Parameters const&... parameters)
|
||||
{
|
||||
VariadicFormatParams variadic_format_parameters { parameters... };
|
||||
return vformatted(fmtstr.view(), variadic_format_parameters);
|
||||
|
@ -320,7 +320,7 @@ private:
|
|||
|
||||
template<>
|
||||
struct Traits<String> : public GenericTraits<String> {
|
||||
static unsigned hash(const String& s) { return s.impl() ? s.impl()->hash() : 0; }
|
||||
static unsigned hash(String const& s) { return s.impl() ? s.impl()->hash() : 0; }
|
||||
};
|
||||
|
||||
struct CaseInsensitiveStringTraits : public Traits<String> {
|
||||
|
@ -328,10 +328,10 @@ struct CaseInsensitiveStringTraits : public Traits<String> {
|
|||
static bool equals(String const& a, String const& b) { return a.equals_ignoring_case(b); }
|
||||
};
|
||||
|
||||
bool operator<(const char*, const String&);
|
||||
bool operator>=(const char*, const String&);
|
||||
bool operator>(const char*, const String&);
|
||||
bool operator<=(const char*, const String&);
|
||||
bool operator<(char const*, String const&);
|
||||
bool operator>=(char const*, String const&);
|
||||
bool operator>(char const*, String const&);
|
||||
bool operator<=(char const*, String const&);
|
||||
|
||||
String escape_html_entities(StringView html);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue