// -*- C++ -*- //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // WARNING, this entire header is generated by // utils/generate_extended_grapheme_cluster_table.py // DO NOT MODIFY! // UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE // // See Terms of Use <https://www.unicode.org/copyright.html> // for definitions of Unicode Inc.'s Data Files and Software. // // NOTICE TO USER: Carefully read the following legal agreement. // BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S // DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), // YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE // TERMS AND CONDITIONS OF THIS AGREEMENT. // IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE // THE DATA FILES OR SOFTWARE. // // COPYRIGHT AND PERMISSION NOTICE // // Copyright (c) 1991-2022 Unicode, Inc. All rights reserved. // Distributed under the Terms of Use in https://www.unicode.org/copyright.html. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of the Unicode data files and any associated documentation // (the "Data Files") or Unicode software and any associated documentation // (the "Software") to deal in the Data Files or Software // without restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, and/or sell copies of // the Data Files or Software, and to permit persons to whom the Data Files // or Software are furnished to do so, provided that either // (a) this copyright and permission notice appear with all copies // of the Data Files or Software, or // (b) this copyright and permission notice appear in associated // Documentation. // // THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT OF THIRD PARTY RIGHTS. // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS // NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL // DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THE DATA FILES OR SOFTWARE. // // Except as contained in this notice, the name of a copyright holder // shall not be used in advertising or otherwise to promote the sale, // use or other dealings in these Data Files or Software without prior // written authorization of the copyright holder. #ifndef _LIBCPP___FORMAT_EXTENDED_GRAPHEME_CLUSTER_TABLE_H #define _LIBCPP___FORMAT_EXTENDED_GRAPHEME_CLUSTER_TABLE_H #include <__algorithm/ranges_upper_bound.h> #include <__config> #include <__iterator/access.h> #include <cstddef> #include <cstdint> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 namespace __extended_grapheme_custer_property_boundary { enum class __property : uint8_t { … }; /// The entries of the extended grapheme cluster bondary property table. /// /// The data is generated from /// - https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakProperty.txt /// - https://www.unicode.org/Public/UCD/latest/ucd/emoji/emoji-data.txt /// /// The data has 3 values /// - bits [0, 3] The property. One of the values generated from the datafiles /// of \ref __property /// - bits [4, 10] The size of the range. /// - bits [11, 31] The lower bound code point of the range. The upper bound of /// the range is lower bound + size. /// /// The 7 bits for the size allow a maximum range of 128 elements. Some ranges /// in the Unicode tables are larger. They are stored in multiple consecutive /// ranges in the data table. An alternative would be to store the sizes in a /// separate 16-bit value. The original MSVC STL code had such an approach, but /// this approach uses less space for the data and is about 4% faster in the /// following benchmark. /// libcxx/benchmarks/std_format_spec_string_unicode.bench.cpp // clang-format off _LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[1496] = …; // clang-format on /// Returns the extended grapheme cluster bondary property of a code point. [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __property __get_property(const char32_t __code_point) noexcept { … } } // namespace __extended_grapheme_custer_property_boundary #endif // _LIBCPP_STD_VER >= 20 _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___FORMAT_EXTENDED_GRAPHEME_CLUSTER_TABLE_H