mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 18:19:03 +00:00
AK: Add StringBuilder::to_fly_string()
This commit is contained in:
parent
a35fa553dd
commit
1453ac79e7
Notes:
sideshowbarker
2024-07-17 03:45:48 +09:00
Author: https://github.com/AtkinsSJ
Commit: 1453ac79e7
Pull-request: https://github.com/SerenityOS/serenity/pull/17478
Reviewed-by: https://github.com/trflynn89 ✅
2 changed files with 7 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#ifndef KERNEL
|
#ifndef KERNEL
|
||||||
# include <AK/DeprecatedString.h>
|
# include <AK/DeprecatedString.h>
|
||||||
|
# include <AK/FlyString.h>
|
||||||
# include <AK/Utf16View.h>
|
# include <AK/Utf16View.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -122,6 +123,11 @@ ErrorOr<String> StringBuilder::to_string() const
|
||||||
{
|
{
|
||||||
return String::from_utf8(string_view());
|
return String::from_utf8(string_view());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ErrorOr<FlyString> StringBuilder::to_fly_string() const
|
||||||
|
{
|
||||||
|
return FlyString::from_utf8(string_view());
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
StringView StringBuilder::string_view() const
|
StringView StringBuilder::string_view() const
|
||||||
|
|
|
@ -66,6 +66,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ErrorOr<String> to_string() const;
|
ErrorOr<String> to_string() const;
|
||||||
|
ErrorOr<FlyString> to_fly_string() const;
|
||||||
|
|
||||||
[[nodiscard]] ByteBuffer to_byte_buffer() const;
|
[[nodiscard]] ByteBuffer to_byte_buffer() const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue