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

AK+Everywhere: Rename String to DeprecatedString

We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
This commit is contained in:
Linus Groh 2022-12-04 18:02:33 +00:00 committed by Andreas Kling
parent f74251606d
commit 6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions

View file

@ -9,12 +9,12 @@
#include <AK/BinarySearch.h>
#include <AK/ByteBuffer.h>
#include <AK/DeprecatedString.h>
#include <AK/Function.h>
#include <AK/HashMap.h>
#include <AK/OwnPtr.h>
#include <AK/RedBlackTree.h>
#include <AK/Result.h>
#include <AK/String.h>
#include <AK/Traits.h>
#include <AK/Utf32View.h>
#include <AK/Utf8View.h>
@ -42,7 +42,7 @@ struct KeyBinding {
InternalFunction,
Insertion,
} kind { Kind::InternalFunction };
String binding;
DeprecatedString binding;
};
struct Configuration {
@ -67,7 +67,7 @@ struct Configuration {
};
struct DefaultTextEditor {
String command;
DeprecatedString command;
};
Configuration()
@ -97,7 +97,7 @@ struct Configuration {
SignalHandler m_signal_mode { SignalHandler::WithSignalHandlers };
OperationMode operation_mode { OperationMode::Unset };
Vector<KeyBinding> keybindings;
String m_default_text_editor {};
DeprecatedString m_default_text_editor {};
bool enable_bracketed_paste { false };
};
@ -144,15 +144,15 @@ public:
~Editor();
Result<String, Error> get_line(String const& prompt);
Result<DeprecatedString, Error> get_line(DeprecatedString const& prompt);
void initialize();
void refetch_default_termios();
void add_to_history(String const& line);
bool load_history(String const& path);
bool save_history(String const& path);
void add_to_history(DeprecatedString const& line);
bool load_history(DeprecatedString const& path);
bool save_history(DeprecatedString const& path);
auto const& history() const { return m_history; }
bool is_history_dirty() const { return m_history_dirty; }
@ -194,11 +194,11 @@ public:
}
Vector<u32, 1024> const& buffer() const { return m_buffer; }
u32 buffer_at(size_t pos) const { return m_buffer.at(pos); }
String line() const { return line(m_buffer.size()); }
String line(size_t up_to_index) const;
DeprecatedString line() const { return line(m_buffer.size()); }
DeprecatedString line(size_t up_to_index) const;
// Only makes sense inside a character_input callback or on_* callback.
void set_prompt(String const& prompt)
void set_prompt(DeprecatedString const& prompt)
{
if (m_cached_prompt_valid)
m_old_prompt_metrics = m_cached_prompt_metrics;
@ -208,7 +208,7 @@ public:
}
void clear_line();
void insert(String const&);
void insert(DeprecatedString const&);
void insert(StringView);
void insert(Utf32View const&);
void insert(const u32);
@ -318,7 +318,7 @@ private:
m_prompt_lines_at_suggestion_initiation = 0;
m_refresh_needed = true;
m_input_error.clear();
m_returned_line = String::empty();
m_returned_line = DeprecatedString::empty();
m_chars_touched_in_the_middle = 0;
m_drawn_end_of_line_offset = 0;
m_drawn_spans = {};
@ -420,7 +420,7 @@ private:
ByteBuffer m_pending_chars;
Vector<char, 512> m_incomplete_data;
Optional<Error> m_input_error;
String m_returned_line;
DeprecatedString m_returned_line;
size_t m_cursor { 0 };
size_t m_drawn_cursor { 0 };
@ -447,7 +447,7 @@ private:
OwnPtr<SuggestionDisplay> m_suggestion_display;
Vector<u32, 32> m_remembered_suggestion_static_data;
String m_new_prompt;
DeprecatedString m_new_prompt;
SuggestionManager m_suggestion_manager;
@ -471,7 +471,7 @@ private:
// FIXME: This should be something more take_first()-friendly.
struct HistoryEntry {
String entry;
DeprecatedString entry;
time_t timestamp;
};
Vector<HistoryEntry> m_history;