mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-20 17:21:52 +00:00
LibLocale was split off from LibUnicode a couple years ago to reduce the number of applications on SerenityOS that depend on CLDR data. Now that we use ICU, both LibUnicode and LibLocale are actually linking in this data. And since vcpkg gives us static libraries, both libraries are over 30MB in size. This patch reverts the separation and merges LibLocale into LibUnicode again. We now have just one library that includes the ICU data. Further, this will let LibUnicode share the locale cache that previously would only exist in LibLocale.
36 lines
953 B
C++
36 lines
953 B
C++
/*
|
|
* Copyright (c) 2022, Idan Horowitz <idan.horowitz@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Utf16View.h>
|
|
#include <LibJS/Runtime/Intl/Segmenter.h>
|
|
#include <LibJS/Runtime/Object.h>
|
|
#include <LibUnicode/Segmenter.h>
|
|
|
|
namespace JS::Intl {
|
|
|
|
class Segments final : public Object {
|
|
JS_OBJECT(Segments, Object);
|
|
JS_DECLARE_ALLOCATOR(Segments);
|
|
|
|
public:
|
|
static NonnullGCPtr<Segments> create(Realm&, Unicode::Segmenter const&, Utf16String);
|
|
|
|
virtual ~Segments() override = default;
|
|
|
|
Unicode::Segmenter& segments_segmenter() const { return *m_segments_segmenter; }
|
|
|
|
Utf16View segments_string() const { return m_segments_string.view(); }
|
|
|
|
private:
|
|
Segments(Realm&, Unicode::Segmenter const&, Utf16String);
|
|
|
|
NonnullOwnPtr<Unicode::Segmenter> m_segments_segmenter; // [[SegmentsSegmenter]]
|
|
Utf16String m_segments_string; // [[SegmentsString]]
|
|
};
|
|
|
|
}
|