mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:57:35 +00:00
AK+Everywhere: Rename FlyString to DeprecatedFlyString
DeprecatedFlyString relies heavily on DeprecatedString's StringImpl, so let's rename it to A) match the name of DeprecatedString, B) write a new FlyString class that is tied to String.
This commit is contained in:
parent
2eacc7aec1
commit
f3db548a3d
316 changed files with 1177 additions and 1177 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/SourceLocation.h>
|
||||
|
@ -44,14 +44,14 @@ private:
|
|||
|
||||
class NameObject final : public Object {
|
||||
public:
|
||||
explicit NameObject(FlyString name)
|
||||
explicit NameObject(DeprecatedFlyString name)
|
||||
: m_name(move(name))
|
||||
{
|
||||
}
|
||||
|
||||
~NameObject() override = default;
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE FlyString const& name() const { return m_name; }
|
||||
[[nodiscard]] ALWAYS_INLINE DeprecatedFlyString const& name() const { return m_name; }
|
||||
|
||||
char const* type_name() const override { return "name"; }
|
||||
DeprecatedString to_deprecated_string(int indent) const override;
|
||||
|
@ -60,7 +60,7 @@ protected:
|
|||
bool is_name() const override { return true; }
|
||||
|
||||
private:
|
||||
FlyString m_name;
|
||||
DeprecatedFlyString m_name;
|
||||
};
|
||||
|
||||
class ArrayObject final : public Object {
|
||||
|
@ -106,14 +106,14 @@ private:
|
|||
|
||||
class DictObject final : public Object {
|
||||
public:
|
||||
explicit DictObject(HashMap<FlyString, Value> map)
|
||||
explicit DictObject(HashMap<DeprecatedFlyString, Value> map)
|
||||
: m_map(move(map))
|
||||
{
|
||||
}
|
||||
|
||||
~DictObject() override = default;
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE HashMap<FlyString, Value> const& map() const { return m_map; }
|
||||
[[nodiscard]] ALWAYS_INLINE HashMap<DeprecatedFlyString, Value> const& map() const { return m_map; }
|
||||
|
||||
template<typename... Args>
|
||||
bool contains(Args&&... keys) const { return (m_map.contains(keys) && ...); }
|
||||
|
@ -121,20 +121,20 @@ public:
|
|||
template<typename... Args>
|
||||
bool contains_any_of(Args&&... keys) const { return (m_map.contains(keys) || ...); }
|
||||
|
||||
ALWAYS_INLINE Optional<Value> get(FlyString const& key) const { return m_map.get(key); }
|
||||
ALWAYS_INLINE Optional<Value> get(DeprecatedFlyString const& key) const { return m_map.get(key); }
|
||||
|
||||
Value get_value(FlyString const& key) const
|
||||
Value get_value(DeprecatedFlyString const& key) const
|
||||
{
|
||||
auto value = get(key);
|
||||
VERIFY(value.has_value());
|
||||
return value.value();
|
||||
}
|
||||
|
||||
PDFErrorOr<NonnullRefPtr<Object>> get_object(Document*, FlyString const& key) const;
|
||||
PDFErrorOr<NonnullRefPtr<Object>> get_object(Document*, DeprecatedFlyString const& key) const;
|
||||
|
||||
#define DEFINE_GETTER(class_name, snake_name) \
|
||||
PDFErrorOr<NonnullRefPtr<class_name>> get_##snake_name(Document*, FlyString const& key) const; \
|
||||
NonnullRefPtr<class_name> get_##snake_name(FlyString const& key) const;
|
||||
#define DEFINE_GETTER(class_name, snake_name) \
|
||||
PDFErrorOr<NonnullRefPtr<class_name>> get_##snake_name(Document*, DeprecatedFlyString const& key) const; \
|
||||
NonnullRefPtr<class_name> get_##snake_name(DeprecatedFlyString const& key) const;
|
||||
ENUMERATE_OBJECT_TYPES(DEFINE_GETTER)
|
||||
#undef DEFINE_GETTER
|
||||
|
||||
|
@ -148,7 +148,7 @@ protected:
|
|||
bool is_dict() const override { return true; }
|
||||
|
||||
private:
|
||||
HashMap<FlyString, Value> m_map;
|
||||
HashMap<DeprecatedFlyString, Value> m_map;
|
||||
};
|
||||
|
||||
class StreamObject : public Object {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue