1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:17:35 +00:00

Everywhere: Pass AK::StringView by value

This commit is contained in:
Andreas Kling 2021-11-11 00:55:02 +01:00
parent ad5d217e76
commit 8b1108e485
392 changed files with 978 additions and 978 deletions

View file

@ -63,7 +63,7 @@ public:
void set_spans(Vector<TextDocumentSpan> spans) { m_spans = move(spans); }
bool set_text(const StringView&, AllowCallback = AllowCallback::Yes);
bool set_text(StringView, AllowCallback = AllowCallback::Yes);
const NonnullOwnPtrVector<TextDocumentLine>& lines() const { return m_lines; }
NonnullOwnPtrVector<TextDocumentLine>& lines() { return m_lines; }
@ -88,11 +88,11 @@ public:
String text() const;
String text_in_range(const TextRange&) const;
Vector<TextRange> find_all(const StringView& needle, bool regmatch = false);
Vector<TextRange> find_all(StringView needle, bool regmatch = false);
void update_regex_matches(const StringView&);
TextRange find_next(const StringView&, const TextPosition& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true);
TextRange find_previous(const StringView&, const TextPosition& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true);
void update_regex_matches(StringView);
TextRange find_next(StringView, const TextPosition& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true);
TextRange find_previous(StringView, const TextPosition& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true);
TextPosition next_position_after(const TextPosition&, SearchShouldWrap = SearchShouldWrap::Yes) const;
TextPosition previous_position_before(const TextPosition&, SearchShouldWrap = SearchShouldWrap::Yes) const;
@ -122,7 +122,7 @@ public:
void set_all_cursors(const TextPosition&);
TextPosition insert_at(const TextPosition&, u32, const Client* = nullptr);
TextPosition insert_at(const TextPosition&, const StringView&, const Client* = nullptr);
TextPosition insert_at(const TextPosition&, StringView, const Client* = nullptr);
void remove(const TextRange&);
virtual bool is_code_document() const { return false; }
@ -154,14 +154,14 @@ private:
class TextDocumentLine {
public:
explicit TextDocumentLine(TextDocument&);
explicit TextDocumentLine(TextDocument&, const StringView&);
explicit TextDocumentLine(TextDocument&, StringView);
String to_utf8() const;
Utf32View view() const { return { code_points(), length() }; }
const u32* code_points() const { return m_text.data(); }
size_t length() const { return m_text.size(); }
bool set_text(TextDocument&, const StringView&);
bool set_text(TextDocument&, StringView);
void set_text(TextDocument&, Vector<u32>);
void append(TextDocument&, u32);
void prepend(TextDocument&, u32);