Browse Source

Make unicode blocks constexpr

master
C. J. Howard 1 year ago
parent
commit
a90c5060e9
4 changed files with 644 additions and 992 deletions
  1. +0
    -1
      CMakeLists.txt
  2. +0
    -347
      src/engine/type/unicode/block.cpp
  3. +642
    -642
      src/engine/type/unicode/block.hpp
  4. +2
    -2
      src/engine/type/unicode/convert.hpp

+ 0
- 1
CMakeLists.txt View File

@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 3.25)
option(APPLICATION_NAME "Application name" "Antkeeper")
option(APPLICATION_VERSION "Application version string" "0.0.0")
option(APPLICATION_AUTHOR "Application author" "C. J. Howard")

+ 0
- 347
src/engine/type/unicode/block.cpp View File

@ -1,347 +0,0 @@
/*
* Copyright (C) 2023 Christopher J. Howard
*
* This file is part of Antkeeper source code.
*
* Antkeeper source code is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Antkeeper source code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
*/
#include <engine/type/unicode/block.hpp>
namespace type {
namespace unicode {
const block block::basic_latin{0x0, 0x7F};
const block block::latin_1_supplement{0x80, 0xFF};
const block block::latin_extended_a{0x0100, 0x017F};
const block block::latin_extended_b{0x0180, 0x024F};
const block block::ipa_extensions{0x0250, 0x02AF};
const block block::spacing_modifier_letters{0x02B0, 0x02FF};
const block block::combining_diacritical_marks{0x0300, 0x036F};
const block block::greek_and_coptic{0x0370, 0x03FF};
const block block::cyrillic{0x0400, 0x04FF};
const block block::cyrillic_supplement{0x0500, 0x052F};
const block block::armenian{0x0530, 0x058F};
const block block::hebrew{0x0590, 0x05FF};
const block block::arabic{0x0600, 0x06FF};
const block block::syriac{0x0700, 0x074F};
const block block::arabic_supplement{0x0750, 0x077F};
const block block::thaana{0x0780, 0x07BF};
const block block::nko{0x07C0, 0x07FF};
const block block::samaritan{0x0800, 0x083F};
const block block::mandaic{0x0840, 0x085F};
const block block::syriac_supplement{0x0860, 0x086F};
const block block::arabic_extended_b{0x0870, 0x089F};
const block block::arabic_extended_a{0x08A0, 0x08FF};
const block block::devanagari{0x0900, 0x097F};
const block block::bengali{0x0980, 0x09FF};
const block block::gurmukhi{0x0A00, 0x0A7F};
const block block::gujarati{0x0A80, 0x0AFF};
const block block::oriya{0x0B00, 0x0B7F};
const block block::tamil{0x0B80, 0x0BFF};
const block block::telugu{0x0C00, 0x0C7F};
const block block::kannada{0x0C80, 0x0CFF};
const block block::malayalam{0x0D00, 0x0D7F};
const block block::sinhala{0x0D80, 0x0DFF};
const block block::thai{0x0E00, 0x0E7F};
const block block::lao{0x0E80, 0x0EFF};
const block block::tibetan{0x0F00, 0x0FFF};
const block block::myanmar{0x1000, 0x109F};
const block block::georgian{0x10A0, 0x10FF};
const block block::hangul_jamo{0x1100, 0x11FF};
const block block::ethiopic{0x1200, 0x137F};
const block block::ethiopic_supplement{0x1380, 0x139F};
const block block::cherokee{0x13A0, 0x13FF};
const block block::unified_canadian_aboriginal_syllabics{0x1400, 0x167F};
const block block::ogham{0x1680, 0x169F};
const block block::runic{0x16A0, 0x16FF};
const block block::tagalog{0x1700, 0x171F};
const block block::hanunoo{0x1720, 0x173F};
const block block::buhid{0x1740, 0x175F};
const block block::tagbanwa{0x1760, 0x177F};
const block block::khmer{0x1780, 0x17FF};
const block block::mongolian{0x1800, 0x18AF};
const block block::unified_canadian_aboriginal_syllabics_extended{0x18B0, 0x18FF};
const block block::limbu{0x1900, 0x194F};
const block block::tai_le{0x1950, 0x197F};
const block block::new_tai_lue{0x1980, 0x19DF};
const block block::khmer_symbols{0x19E0, 0x19FF};
const block block::buginese{0x1A00, 0x1A1F};
const block block::tai_tham{0x1A20, 0x1AAF};
const block block::combining_diacritical_marks_extended{0x1AB0, 0x1AFF};
const block block::balinese{0x1B00, 0x1B7F};
const block block::sundanese{0x1B80, 0x1BBF};
const block block::batak{0x1BC0, 0x1BFF};
const block block::lepcha{0x1C00, 0x1C4F};
const block block::ol_chiki{0x1C50, 0x1C7F};
const block block::cyrillic_extended_c{0x1C80, 0x1C8F};
const block block::georgian_extended{0x1C90, 0x1CBF};
const block block::sundanese_supplement{0x1CC0, 0x1CCF};
const block block::vedic_extensions{0x1CD0, 0x1CFF};
const block block::phonetic_extensions{0x1D00, 0x1D7F};
const block block::phonetic_extensions_supplement{0x1D80, 0x1DBF};
const block block::combining_diacritical_marks_supplement{0x1DC0, 0x1DFF};
const block block::latin_extended_additional{0x1E00, 0x1EFF};
const block block::greek_extended{0x1F00, 0x1FFF};
const block block::general_punctuation{0x2000, 0x206F};
const block block::superscripts_and_subscripts{0x2070, 0x209F};
const block block::currency_symbols{0x20A0, 0x20CF};
const block block::combining_diacritical_marks_for_symbols{0x20D0, 0x20FF};
const block block::letterlike_symbols{0x2100, 0x214F};
const block block::number_forms{0x2150, 0x218F};
const block block::arrows{0x2190, 0x21FF};
const block block::mathematical_operators{0x2200, 0x22FF};
const block block::miscellaneous_technical{0x2300, 0x23FF};
const block block::control_pictures{0x2400, 0x243F};
const block block::optical_character_recognition{0x2440, 0x245F};
const block block::enclosed_alphanumerics{0x2460, 0x24FF};
const block block::box_drawing{0x2500, 0x257F};
const block block::block_elements{0x2580, 0x259F};
const block block::geometric_shapes{0x25A0, 0x25FF};
const block block::miscellaneous_symbols{0x2600, 0x26FF};
const block block::dingbats{0x2700, 0x27BF};
const block block::miscellaneous_mathematical_symbols_a{0x27C0, 0x27EF};
const block block::supplemental_arrows_a{0x27F0, 0x27FF};
const block block::braille_patterns{0x2800, 0x28FF};
const block block::supplemental_arrows_b{0x2900, 0x297F};
const block block::miscellaneous_mathematical_symbols_b{0x2980, 0x29FF};
const block block::supplemental_mathematical_operators{0x2A00, 0x2AFF};
const block block::miscellaneous_symbols_and_arrows{0x2B00, 0x2BFF};
const block block::glagolitic{0x2C00, 0x2C5F};
const block block::latin_extended_c{0x2C60, 0x2C7F};
const block block::coptic{0x2C80, 0x2CFF};
const block block::georgian_supplement{0x2D00, 0x2D2F};
const block block::tifinagh{0x2D30, 0x2D7F};
const block block::ethiopic_extended{0x2D80, 0x2DDF};
const block block::cyrillic_extended_a{0x2DE0, 0x2DFF};
const block block::supplemental_punctuation{0x2E00, 0x2E7F};
const block block::cjk_radicals_supplement{0x2E80, 0x2EFF};
const block block::kangxi_radicals{0x2F00, 0x2FDF};
const block block::ideographic_description_characters{0x2FF0, 0x2FFF};
const block block::cjk_symbols_and_punctuation{0x3000, 0x303F};
const block block::hiragana{0x3040, 0x309F};
const block block::katakana{0x30A0, 0x30FF};
const block block::bopomofo{0x3100, 0x312F};
const block block::hangul_compatibility_jamo{0x3130, 0x318F};
const block block::kanbun{0x3190, 0x319F};
const block block::bopomofo_extended{0x31A0, 0x31BF};
const block block::cjk_strokes{0x31C0, 0x31EF};
const block block::katakana_phonetic_extensions{0x31F0, 0x31FF};
const block block::enclosed_cjk_letters_and_months{0x3200, 0x32FF};
const block block::cjk_compatibility{0x3300, 0x33FF};
const block block::cjk_unified_ideographs_extension_a{0x3400, 0x4DBF};
const block block::yijing_hexagram_symbols{0x4DC0, 0x4DFF};
const block block::cjk_unified_ideographs{0x4E00, 0x9FFF};
const block block::yi_syllables{0xA000, 0xA48F};
const block block::yi_radicals{0xA490, 0xA4CF};
const block block::lisu{0xA4D0, 0xA4FF};
const block block::vai{0xA500, 0xA63F};
const block block::cyrillic_extended_b{0xA640, 0xA69F};
const block block::bamum{0xA6A0, 0xA6FF};
const block block::modifier_tone_letters{0xA700, 0xA71F};
const block block::latin_extended_d{0xA720, 0xA7FF};
const block block::syloti_nagri{0xA800, 0xA82F};
const block block::common_indic_number_forms{0xA830, 0xA83F};
const block block::phags_pa{0xA840, 0xA87F};
const block block::saurashtra{0xA880, 0xA8DF};
const block block::devanagari_extended{0xA8E0, 0xA8FF};
const block block::kayah_li{0xA900, 0xA92F};
const block block::rejang{0xA930, 0xA95F};
const block block::hangul_jamo_extended_a{0xA960, 0xA97F};
const block block::javanese{0xA980, 0xA9DF};
const block block::myanmar_extended_b{0xA9E0, 0xA9FF};
const block block::cham{0xAA00, 0xAA5F};
const block block::myanmar_extended_a{0xAA60, 0xAA7F};
const block block::tai_viet{0xAA80, 0xAADF};
const block block::meetei_mayek_extensions{0xAAE0, 0xAAFF};
const block block::ethiopic_extended_a{0xAB00, 0xAB2F};
const block block::latin_extended_e{0xAB30, 0xAB6F};
const block block::cherokee_supplement{0xAB70, 0xABBF};
const block block::meetei_mayek{0xABC0, 0xABFF};
const block block::hangul_syllables{0xAC00, 0xD7AF};
const block block::hangul_jamo_extended_b{0xD7B0, 0xD7FF};
const block block::high_surrogates{0xD800, 0xDB7F};
const block block::high_private_use_surrogates{0xDB80, 0xDBFF};
const block block::low_surrogates{0xDC00, 0xDFFF};
const block block::private_use_area{0xE000, 0xF8FF};
const block block::cjk_compatibility_ideographs{0xF900, 0xFAFF};
const block block::alphabetic_presentation_forms{0xFB00, 0xFB4F};
const block block::arabic_presentation_forms_a{0xFB50, 0xFDFF};
const block block::variation_selectors{0xFE00, 0xFE0F};
const block block::vertical_forms{0xFE10, 0xFE1F};
const block block::combining_half_marks{0xFE20, 0xFE2F};
const block block::cjk_compatibility_forms{0xFE30, 0xFE4F};
const block block::small_form_variants{0xFE50, 0xFE6F};
const block block::arabic_presentation_forms_b{0xFE70, 0xFEFF};
const block block::halfwidth_and_fullwidth_forms{0xFF00, 0xFFEF};
const block block::specials{0xFFF0, 0xFFFF};
const block block::linear_b_syllabary{0x10000, 0x1007F};
const block block::linear_b_ideograms{0x10080, 0x100FF};
const block block::aegean_numbers{0x10100, 0x1013F};
const block block::ancient_greek_numbers{0x10140, 0x1018F};
const block block::ancient_symbols{0x10190, 0x101CF};
const block block::phaistos_disc{0x101D0, 0x101FF};
const block block::lycian{0x10280, 0x1029F};
const block block::carian{0x102A0, 0x102DF};
const block block::coptic_epact_numbers{0x102E0, 0x102FF};
const block block::old_italic{0x10300, 0x1032F};
const block block::gothic{0x10330, 0x1034F};
const block block::old_permic{0x10350, 0x1037F};
const block block::ugaritic{0x10380, 0x1039F};
const block block::old_persian{0x103A0, 0x103DF};
const block block::deseret{0x10400, 0x1044F};
const block block::shavian{0x10450, 0x1047F};
const block block::osmanya{0x10480, 0x104AF};
const block block::osage{0x104B0, 0x104FF};
const block block::elbasan{0x10500, 0x1052F};
const block block::caucasian_albanian{0x10530, 0x1056F};
const block block::vithkuqi{0x10570, 0x105BF};
const block block::linear_a{0x10600, 0x1077F};
const block block::latin_extended_f{0x10780, 0x107BF};
const block block::cypriot_syllabary{0x10800, 0x1083F};
const block block::imperial_aramaic{0x10840, 0x1085F};
const block block::palmyrene{0x10860, 0x1087F};
const block block::nabataean{0x10880, 0x108AF};
const block block::hatran{0x108E0, 0x108FF};
const block block::phoenician{0x10900, 0x1091F};
const block block::lydian{0x10920, 0x1093F};
const block block::meroitic_hieroglyphs{0x10980, 0x1099F};
const block block::meroitic_cursive{0x109A0, 0x109FF};
const block block::kharoshthi{0x10A00, 0x10A5F};
const block block::old_south_arabian{0x10A60, 0x10A7F};
const block block::old_north_arabian{0x10A80, 0x10A9F};
const block block::manichaean{0x10AC0, 0x10AFF};
const block block::avestan{0x10B00, 0x10B3F};
const block block::inscriptional_parthian{0x10B40, 0x10B5F};
const block block::inscriptional_pahlavi{0x10B60, 0x10B7F};
const block block::psalter_pahlavi{0x10B80, 0x10BAF};
const block block::old_turkic{0x10C00, 0x10C4F};
const block block::old_hungarian{0x10C80, 0x10CFF};
const block block::hanifi_rohingya{0x10D00, 0x10D3F};
const block block::rumi_numeral_symbols{0x10E60, 0x10E7F};
const block block::yezidi{0x10E80, 0x10EBF};
const block block::old_sogdian{0x10F00, 0x10F2F};
const block block::sogdian{0x10F30, 0x10F6F};
const block block::old_uyghur{0x10F70, 0x10FAF};
const block block::chorasmian{0x10FB0, 0x10FDF};
const block block::elymaic{0x10FE0, 0x10FFF};
const block block::brahmi{0x11000, 0x1107F};
const block block::kaithi{0x11080, 0x110CF};
const block block::sora_sompeng{0x110D0, 0x110FF};
const block block::chakma{0x11100, 0x1114F};
const block block::mahajani{0x11150, 0x1117F};
const block block::sharada{0x11180, 0x111DF};
const block block::sinhala_archaic_numbers{0x111E0, 0x111FF};
const block block::khojki{0x11200, 0x1124F};
const block block::multani{0x11280, 0x112AF};
const block block::khudawadi{0x112B0, 0x112FF};
const block block::grantha{0x11300, 0x1137F};
const block block::newa{0x11400, 0x1147F};
const block block::tirhuta{0x11480, 0x114DF};
const block block::siddham{0x11580, 0x115FF};
const block block::modi{0x11600, 0x1165F};
const block block::mongolian_supplement{0x11660, 0x1167F};
const block block::takri{0x11680, 0x116CF};
const block block::ahom{0x11700, 0x1174F};
const block block::dogra{0x11800, 0x1184F};
const block block::warang_citi{0x118A0, 0x118FF};
const block block::dives_akuru{0x11900, 0x1195F};
const block block::nandinagari{0x119A0, 0x119FF};
const block block::zanabazar_square{0x11A00, 0x11A4F};
const block block::soyombo{0x11A50, 0x11AAF};
const block block::unified_canadian_aboriginal_syllabics_extended_a{0x11AB0, 0x11ABF};
const block block::pau_cin_hau{0x11AC0, 0x11AFF};
const block block::bhaiksuki{0x11C00, 0x11C6F};
const block block::marchen{0x11C70, 0x11CBF};
const block block::masaram_gondi{0x11D00, 0x11D5F};
const block block::gunjala_gondi{0x11D60, 0x11DAF};
const block block::makasar{0x11EE0, 0x11EFF};
const block block::lisu_supplement{0x11FB0, 0x11FBF};
const block block::tamil_supplement{0x11FC0, 0x11FFF};
const block block::cuneiform{0x12000, 0x123FF};
const block block::cuneiform_numbers_and_punctuation{0x12400, 0x1247F};
const block block::early_dynastic_cuneiform{0x12480, 0x1254F};
const block block::cypro_minoan{0x12F90, 0x12FFF};
const block block::egyptian_hieroglyphs{0x13000, 0x1342F};
const block block::egyptian_hieroglyph_format_controls{0x13430, 0x1343F};
const block block::anatolian_hieroglyphs{0x14400, 0x1467F};
const block block::bamum_supplement{0x16800, 0x16A3F};
const block block::mro{0x16A40, 0x16A6F};
const block block::tangsa{0x16A70, 0x16ACF};
const block block::bassa_vah{0x16AD0, 0x16AFF};
const block block::pahawh_hmong{0x16B00, 0x16B8F};
const block block::medefaidrin{0x16E40, 0x16E9F};
const block block::miao{0x16F00, 0x16F9F};
const block block::ideographic_symbols_and_punctuation{0x16FE0, 0x16FFF};
const block block::tangut{0x17000, 0x187FF};
const block block::tangut_components{0x18800, 0x18AFF};
const block block::khitan_small_script{0x18B00, 0x18CFF};
const block block::tangut_supplement{0x18D00, 0x18D7F};
const block block::kana_extended_b{0x1AFF0, 0x1AFFF};
const block block::kana_supplement{0x1B000, 0x1B0FF};
const block block::kana_extended_a{0x1B100, 0x1B12F};
const block block::small_kana_extension{0x1B130, 0x1B16F};
const block block::nushu{0x1B170, 0x1B2FF};
const block block::duployan{0x1BC00, 0x1BC9F};
const block block::shorthand_format_controls{0x1BCA0, 0x1BCAF};
const block block::znamenny_musical_notation{0x1CF00, 0x1CFCF};
const block block::byzantine_musical_symbols{0x1D000, 0x1D0FF};
const block block::musical_symbols{0x1D100, 0x1D1FF};
const block block::ancient_greek_musical_notation{0x1D200, 0x1D24F};
const block block::mayan_numerals{0x1D2E0, 0x1D2FF};
const block block::tai_xuan_jing_symbols{0x1D300, 0x1D35F};
const block block::counting_rod_numerals{0x1D360, 0x1D37F};
const block block::mathematical_alphanumeric_symbols{0x1D400, 0x1D7FF};
const block block::sutton_signwriting{0x1D800, 0x1DAAF};
const block block::latin_extended_g{0x1DF00, 0x1DFFF};
const block block::glagolitic_supplement{0x1E000, 0x1E02F};
const block block::nyiakeng_puachue_hmong{0x1E100, 0x1E14F};
const block block::toto{0x1E290, 0x1E2BF};
const block block::wancho{0x1E2C0, 0x1E2FF};
const block block::ethiopic_extended_b{0x1E7E0, 0x1E7FF};
const block block::mende_kikakui{0x1E800, 0x1E8DF};
const block block::adlam{0x1E900, 0x1E95F};
const block block::indic_siyaq_numbers{0x1EC70, 0x1ECBF};
const block block::ottoman_siyaq_numbers{0x1ED00, 0x1ED4F};
const block block::arabic_mathematical_alphabetic_symbols{0x1EE00, 0x1EEFF};
const block block::mahjong_tiles{0x1F000, 0x1F02F};
const block block::domino_tiles{0x1F030, 0x1F09F};
const block block::playing_cards{0x1F0A0, 0x1F0FF};
const block block::enclosed_alphanumeric_supplement{0x1F100, 0x1F1FF};
const block block::enclosed_ideographic_supplement{0x1F200, 0x1F2FF};
const block block::miscellaneous_symbols_and_pictographs{0x1F300, 0x1F5FF};
const block block::emoticons{0x1F600, 0x1F64F};
const block block::ornamental_dingbats{0x1F650, 0x1F67F};
const block block::transport_and_map_symbols{0x1F680, 0x1F6FF};
const block block::alchemical_symbols{0x1F700, 0x1F77F};
const block block::geometric_shapes_extended{0x1F780, 0x1F7FF};
const block block::supplemental_arrows_c{0x1F800, 0x1F8FF};
const block block::supplemental_symbols_and_pictographs{0x1F900, 0x1F9FF};
const block block::chess_symbols{0x1FA00, 0x1FA6F};
const block block::symbols_and_pictographs_extended_a{0x1FA70, 0x1FAFF};
const block block::symbols_for_legacy_computing{0x1FB00, 0x1FBFF};
const block block::cjk_unified_ideographs_extension_b{0x20000, 0x2A6DF};
const block block::cjk_unified_ideographs_extension_c{0x2A700, 0x2B73F};
const block block::cjk_unified_ideographs_extension_d{0x2B740, 0x2B81F};
const block block::cjk_unified_ideographs_extension_e{0x2B820, 0x2CEAF};
const block block::cjk_unified_ideographs_extension_f{0x2CEB0, 0x2EBEF};
const block block::cjk_compatibility_ideographs_supplement{0x2F800, 0x2FA1F};
const block block::cjk_unified_ideographs_extension_g{0x30000, 0x3134F};
const block block::tags{0xE0000, 0xE007F};
const block block::variation_selectors_supplement{0xE0100, 0xE01EF};
const block block::supplementary_private_use_area_a{0xF0000, 0xFFFFF};
const block block::supplementary_private_use_area_b{0x100000, 0x10FFFF};
} // namespace unicode
} // namespace type

+ 642
- 642
src/engine/type/unicode/block.hpp
File diff suppressed because it is too large
View File


+ 2
- 2
src/engine/type/unicode/convert.hpp View File

@ -31,7 +31,7 @@ namespace unicode {
* @param u8 UTF-8 string.
* @return UTF-32 string.
*/
std::u32string u32(const std::string& u8);
[[nodiscard]] std::u32string u32(const std::string& u8);
/**
* Converts a UTF-32 string to UTF-8.
@ -39,7 +39,7 @@ std::u32string u32(const std::string& u8);
* @param u32 UTF-32 string.
* @return UTF-8 string.
*/
std::string u8(const std::u32string& u32);
[[nodiscard]] std::string u8(const std::u32string& u32);
} // namespace unicode
} // namespace type

Loading…
Cancel
Save