1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:17:34 +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:
Timothy Flynn 2023-01-08 19:23:00 -05:00 committed by Linus Groh
parent 2eacc7aec1
commit f3db548a3d
316 changed files with 1177 additions and 1177 deletions

View file

@ -15,33 +15,33 @@ PDFErrorOr<NonnullRefPtr<Object>> ArrayObject::get_object_at(Document* document,
return document->resolve_to<Object>(at(index));
}
PDFErrorOr<NonnullRefPtr<Object>> DictObject::get_object(Document* document, FlyString const& key) const
PDFErrorOr<NonnullRefPtr<Object>> DictObject::get_object(Document* document, DeprecatedFlyString const& key) const
{
return document->resolve_to<Object>(get_value(key));
}
#define DEFINE_ACCESSORS(class_name, snake_name) \
PDFErrorOr<NonnullRefPtr<class_name>> ArrayObject::get_##snake_name##_at(Document* document, size_t index) const \
{ \
if (index >= m_elements.size()) \
return Error { Error::Type::Internal, "Out of bounds array access" }; \
return document->resolve_to<class_name>(m_elements[index]); \
} \
\
NonnullRefPtr<class_name> ArrayObject::get_##snake_name##_at(size_t index) const \
{ \
VERIFY(index < m_elements.size()); \
return cast_to<class_name>(m_elements[index]); \
} \
\
PDFErrorOr<NonnullRefPtr<class_name>> DictObject::get_##snake_name(Document* document, FlyString const& key) const \
{ \
return document->resolve_to<class_name>(get_value(key)); \
} \
\
NonnullRefPtr<class_name> DictObject::get_##snake_name(FlyString const& key) const \
{ \
return cast_to<class_name>(get_value(key)); \
#define DEFINE_ACCESSORS(class_name, snake_name) \
PDFErrorOr<NonnullRefPtr<class_name>> ArrayObject::get_##snake_name##_at(Document* document, size_t index) const \
{ \
if (index >= m_elements.size()) \
return Error { Error::Type::Internal, "Out of bounds array access" }; \
return document->resolve_to<class_name>(m_elements[index]); \
} \
\
NonnullRefPtr<class_name> ArrayObject::get_##snake_name##_at(size_t index) const \
{ \
VERIFY(index < m_elements.size()); \
return cast_to<class_name>(m_elements[index]); \
} \
\
PDFErrorOr<NonnullRefPtr<class_name>> DictObject::get_##snake_name(Document* document, DeprecatedFlyString const& key) const \
{ \
return document->resolve_to<class_name>(get_value(key)); \
} \
\
NonnullRefPtr<class_name> DictObject::get_##snake_name(DeprecatedFlyString const& key) const \
{ \
return cast_to<class_name>(get_value(key)); \
}
ENUMERATE_OBJECT_TYPES(DEFINE_ACCESSORS)