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

AK: Add FlyString::to_lowercase() and LogStream operator<<(FlyString)

This commit is contained in:
Andreas Kling 2020-03-22 19:07:02 +01:00
parent 7f8dc347b5
commit c4a6d6ae9f
6 changed files with 39 additions and 16 deletions

View file

@ -24,6 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <AK/FlyString.h>
#include <AK/Memory.h>
#include <AK/StdLibExtras.h>
#include <AK/String.h>
@ -321,4 +322,23 @@ String escape_html_entities(const StringView& html)
return builder.to_string();
}
String::String(const FlyString& string)
: m_impl(string.impl())
{
}
String String::to_lowercase() const
{
if (!m_impl)
return {};
return m_impl->to_lowercase();
}
String String::to_uppercase() const
{
if (!m_impl)
return {};
return m_impl->to_uppercase();
}
}