ladybird/Userland/Libraries/LibUnicode/Normalize.h
Linus Groh 6e19ab2bbc 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 :^)
2022-12-06 08:54:33 +01:00

33 lines
740 B
C++

/*
* Copyright (c) 2022, mat
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/DeprecatedString.h>
#include <AK/Forward.h>
#include <AK/Optional.h>
#include <AK/Span.h>
#include <AK/StringView.h>
#include <LibUnicode/Forward.h>
namespace Unicode {
Optional<CodePointDecomposition const> code_point_decomposition(u32 code_point);
Optional<CodePointDecomposition const> code_point_decomposition_by_index(size_t index);
enum class NormalizationForm {
NFD,
NFC,
NFKD,
NFKC
};
NormalizationForm normalization_form_from_string(StringView form);
StringView normalization_form_to_string(NormalizationForm form);
[[nodiscard]] DeprecatedString normalize(StringView string, NormalizationForm form);
}