| 1 | // Copyright (C) 2021 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QLOCALE_H |
| 5 | #define QLOCALE_H |
| 6 | |
| 7 | #include <QtCore/qvariant.h> |
| 8 | #include <QtCore/qstring.h> |
| 9 | #include <QtCore/qobjectdefs.h> |
| 10 | #include <QtCore/qshareddata.h> |
| 11 | |
| 12 | QT_BEGIN_NAMESPACE |
| 13 | |
| 14 | class QCalendar; |
| 15 | class QDataStream; |
| 16 | class QDate; |
| 17 | class QDateTime; |
| 18 | class QLocale; |
| 19 | class QTime; |
| 20 | class QVariant; |
| 21 | class QTextStream; |
| 22 | class QTextStreamPrivate; |
| 23 | |
| 24 | class QLocalePrivate; |
| 25 | |
| 26 | Q_CORE_EXPORT size_t qHash(const QLocale &key, size_t seed = 0) noexcept; |
| 27 | |
| 28 | class Q_CORE_EXPORT QLocale |
| 29 | { |
| 30 | Q_GADGET |
| 31 | friend class QString; |
| 32 | friend class QByteArray; |
| 33 | friend class QIntValidator; |
| 34 | friend class QDoubleValidatorPrivate; |
| 35 | friend class QTextStream; |
| 36 | friend class QTextStreamPrivate; |
| 37 | |
| 38 | public: |
| 39 | static constexpr int DefaultTwoDigitBaseYear = 1900; |
| 40 | |
| 41 | // see qlocale_data_p.h for more info on generated data |
| 42 | // GENERATED PART STARTS HERE |
| 43 | enum Language : ushort { |
| 44 | AnyLanguage = 0, |
| 45 | C = 1, |
| 46 | Abkhazian = 2, |
| 47 | Afar = 3, |
| 48 | Afrikaans = 4, |
| 49 | Aghem = 5, |
| 50 | Akan = 6, |
| 51 | Akkadian = 7, |
| 52 | Akoose = 8, |
| 53 | Albanian = 9, |
| 54 | AmericanSignLanguage = 10, |
| 55 | Amharic = 11, |
| 56 | AncientEgyptian = 12, |
| 57 | AncientGreek = 13, |
| 58 | Arabic = 14, |
| 59 | Aragonese = 15, |
| 60 | Aramaic = 16, |
| 61 | Armenian = 17, |
| 62 | Assamese = 18, |
| 63 | Asturian = 19, |
| 64 | Asu = 20, |
| 65 | Atsam = 21, |
| 66 | Avaric = 22, |
| 67 | Avestan = 23, |
| 68 | Aymara = 24, |
| 69 | Azerbaijani = 25, |
| 70 | Bafia = 26, |
| 71 | Balinese = 27, |
| 72 | Bambara = 28, |
| 73 | Bamun = 29, |
| 74 | Bangla = 30, |
| 75 | Basaa = 31, |
| 76 | Bashkir = 32, |
| 77 | Basque = 33, |
| 78 | BatakToba = 34, |
| 79 | Belarusian = 35, |
| 80 | Bemba = 36, |
| 81 | Bena = 37, |
| 82 | Bhojpuri = 38, |
| 83 | Bislama = 39, |
| 84 | Blin = 40, |
| 85 | Bodo = 41, |
| 86 | Bosnian = 42, |
| 87 | Breton = 43, |
| 88 | Buginese = 44, |
| 89 | Bulgarian = 45, |
| 90 | Burmese = 46, |
| 91 | Cantonese = 47, |
| 92 | Catalan = 48, |
| 93 | Cebuano = 49, |
| 94 | CentralAtlasTamazight = 50, |
| 95 | CentralKurdish = 51, |
| 96 | Chakma = 52, |
| 97 | Chamorro = 53, |
| 98 | Chechen = 54, |
| 99 | Cherokee = 55, |
| 100 | Chickasaw = 56, |
| 101 | Chiga = 57, |
| 102 | Chinese = 58, |
| 103 | Church = 59, |
| 104 | Chuvash = 60, |
| 105 | Colognian = 61, |
| 106 | Coptic = 62, |
| 107 | Cornish = 63, |
| 108 | Corsican = 64, |
| 109 | Cree = 65, |
| 110 | Croatian = 66, |
| 111 | Czech = 67, |
| 112 | Danish = 68, |
| 113 | Divehi = 69, |
| 114 | Dogri = 70, |
| 115 | Duala = 71, |
| 116 | Dutch = 72, |
| 117 | Dzongkha = 73, |
| 118 | Embu = 74, |
| 119 | English = 75, |
| 120 | Erzya = 76, |
| 121 | Esperanto = 77, |
| 122 | Estonian = 78, |
| 123 | Ewe = 79, |
| 124 | Ewondo = 80, |
| 125 | Faroese = 81, |
| 126 | Fijian = 82, |
| 127 | Filipino = 83, |
| 128 | Finnish = 84, |
| 129 | French = 85, |
| 130 | Friulian = 86, |
| 131 | Fulah = 87, |
| 132 | Gaelic = 88, |
| 133 | Ga = 89, |
| 134 | Galician = 90, |
| 135 | Ganda = 91, |
| 136 | Geez = 92, |
| 137 | Georgian = 93, |
| 138 | German = 94, |
| 139 | Gothic = 95, |
| 140 | Greek = 96, |
| 141 | Guarani = 97, |
| 142 | Gujarati = 98, |
| 143 | Gusii = 99, |
| 144 | Haitian = 100, |
| 145 | Hausa = 101, |
| 146 | Hawaiian = 102, |
| 147 | Hebrew = 103, |
| 148 | Herero = 104, |
| 149 | Hindi = 105, |
| 150 | HiriMotu = 106, |
| 151 | Hungarian = 107, |
| 152 | Icelandic = 108, |
| 153 | Ido = 109, |
| 154 | Igbo = 110, |
| 155 | InariSami = 111, |
| 156 | Indonesian = 112, |
| 157 | Ingush = 113, |
| 158 | Interlingua = 114, |
| 159 | Interlingue = 115, |
| 160 | Inuktitut = 116, |
| 161 | Inupiaq = 117, |
| 162 | Irish = 118, |
| 163 | Italian = 119, |
| 164 | Japanese = 120, |
| 165 | Javanese = 121, |
| 166 | Jju = 122, |
| 167 | JolaFonyi = 123, |
| 168 | Kabuverdianu = 124, |
| 169 | Kabyle = 125, |
| 170 | Kako = 126, |
| 171 | Kalaallisut = 127, |
| 172 | Kalenjin = 128, |
| 173 | Kamba = 129, |
| 174 | Kannada = 130, |
| 175 | Kanuri = 131, |
| 176 | Kashmiri = 132, |
| 177 | Kazakh = 133, |
| 178 | Kenyang = 134, |
| 179 | Khmer = 135, |
| 180 | Kiche = 136, |
| 181 | Kikuyu = 137, |
| 182 | Kinyarwanda = 138, |
| 183 | Komi = 139, |
| 184 | Kongo = 140, |
| 185 | Konkani = 141, |
| 186 | Korean = 142, |
| 187 | Koro = 143, |
| 188 | KoyraboroSenni = 144, |
| 189 | KoyraChiini = 145, |
| 190 | Kpelle = 146, |
| 191 | Kuanyama = 147, |
| 192 | Kurdish = 148, |
| 193 | Kwasio = 149, |
| 194 | Kyrgyz = 150, |
| 195 | Lakota = 151, |
| 196 | Langi = 152, |
| 197 | Lao = 153, |
| 198 | Latin = 154, |
| 199 | Latvian = 155, |
| 200 | Lezghian = 156, |
| 201 | Limburgish = 157, |
| 202 | Lingala = 158, |
| 203 | LiteraryChinese = 159, |
| 204 | Lithuanian = 160, |
| 205 | Lojban = 161, |
| 206 | LowerSorbian = 162, |
| 207 | LowGerman = 163, |
| 208 | LubaKatanga = 164, |
| 209 | LuleSami = 165, |
| 210 | Luo = 166, |
| 211 | Luxembourgish = 167, |
| 212 | Luyia = 168, |
| 213 | Macedonian = 169, |
| 214 | Machame = 170, |
| 215 | Maithili = 171, |
| 216 | MakhuwaMeetto = 172, |
| 217 | Makonde = 173, |
| 218 | Malagasy = 174, |
| 219 | Malayalam = 175, |
| 220 | Malay = 176, |
| 221 | Maltese = 177, |
| 222 | Mandingo = 178, |
| 223 | Manipuri = 179, |
| 224 | Manx = 180, |
| 225 | Maori = 181, |
| 226 | Mapuche = 182, |
| 227 | Marathi = 183, |
| 228 | Marshallese = 184, |
| 229 | Masai = 185, |
| 230 | Mazanderani = 186, |
| 231 | Mende = 187, |
| 232 | Meru = 188, |
| 233 | Meta = 189, |
| 234 | Mohawk = 190, |
| 235 | Mongolian = 191, |
| 236 | Morisyen = 192, |
| 237 | Mundang = 193, |
| 238 | Muscogee = 194, |
| 239 | Nama = 195, |
| 240 | NauruLanguage = 196, |
| 241 | Navajo = 197, |
| 242 | Ndonga = 198, |
| 243 | Nepali = 199, |
| 244 | Newari = 200, |
| 245 | Ngiemboon = 201, |
| 246 | Ngomba = 202, |
| 247 | NigerianPidgin = 203, |
| 248 | Nko = 204, |
| 249 | NorthernLuri = 205, |
| 250 | NorthernSami = 206, |
| 251 | NorthernSotho = 207, |
| 252 | NorthNdebele = 208, |
| 253 | NorwegianBokmal = 209, |
| 254 | NorwegianNynorsk = 210, |
| 255 | Nuer = 211, |
| 256 | Nyanja = 212, |
| 257 | Nyankole = 213, |
| 258 | Occitan = 214, |
| 259 | Odia = 215, |
| 260 | Ojibwa = 216, |
| 261 | OldIrish = 217, |
| 262 | OldNorse = 218, |
| 263 | OldPersian = 219, |
| 264 | Oromo = 220, |
| 265 | Osage = 221, |
| 266 | Ossetic = 222, |
| 267 | Pahlavi = 223, |
| 268 | Palauan = 224, |
| 269 | Pali = 225, |
| 270 | Papiamento = 226, |
| 271 | Pashto = 227, |
| 272 | Persian = 228, |
| 273 | Phoenician = 229, |
| 274 | Polish = 230, |
| 275 | Portuguese = 231, |
| 276 | Prussian = 232, |
| 277 | Punjabi = 233, |
| 278 | Quechua = 234, |
| 279 | Romanian = 235, |
| 280 | Romansh = 236, |
| 281 | Rombo = 237, |
| 282 | Rundi = 238, |
| 283 | Russian = 239, |
| 284 | Rwa = 240, |
| 285 | Saho = 241, |
| 286 | Sakha = 242, |
| 287 | Samburu = 243, |
| 288 | Samoan = 244, |
| 289 | Sango = 245, |
| 290 | Sangu = 246, |
| 291 | Sanskrit = 247, |
| 292 | Santali = 248, |
| 293 | Sardinian = 249, |
| 294 | Saurashtra = 250, |
| 295 | Sena = 251, |
| 296 | Serbian = 252, |
| 297 | Shambala = 253, |
| 298 | Shona = 254, |
| 299 | SichuanYi = 255, |
| 300 | Sicilian = 256, |
| 301 | Sidamo = 257, |
| 302 | Silesian = 258, |
| 303 | Sindhi = 259, |
| 304 | Sinhala = 260, |
| 305 | SkoltSami = 261, |
| 306 | Slovak = 262, |
| 307 | Slovenian = 263, |
| 308 | Soga = 264, |
| 309 | Somali = 265, |
| 310 | SouthernKurdish = 266, |
| 311 | SouthernSami = 267, |
| 312 | SouthernSotho = 268, |
| 313 | SouthNdebele = 269, |
| 314 | Spanish = 270, |
| 315 | StandardMoroccanTamazight = 271, |
| 316 | Sundanese = 272, |
| 317 | Swahili = 273, |
| 318 | Swati = 274, |
| 319 | Swedish = 275, |
| 320 | SwissGerman = 276, |
| 321 | Syriac = 277, |
| 322 | Tachelhit = 278, |
| 323 | Tahitian = 279, |
| 324 | TaiDam = 280, |
| 325 | Taita = 281, |
| 326 | Tajik = 282, |
| 327 | Tamil = 283, |
| 328 | Taroko = 284, |
| 329 | Tasawaq = 285, |
| 330 | Tatar = 286, |
| 331 | Telugu = 287, |
| 332 | Teso = 288, |
| 333 | Thai = 289, |
| 334 | Tibetan = 290, |
| 335 | Tigre = 291, |
| 336 | Tigrinya = 292, |
| 337 | TokelauLanguage = 293, |
| 338 | TokPisin = 294, |
| 339 | Tongan = 295, |
| 340 | Tsonga = 296, |
| 341 | Tswana = 297, |
| 342 | Turkish = 298, |
| 343 | Turkmen = 299, |
| 344 | TuvaluLanguage = 300, |
| 345 | Tyap = 301, |
| 346 | Ugaritic = 302, |
| 347 | Ukrainian = 303, |
| 348 | UpperSorbian = 304, |
| 349 | Urdu = 305, |
| 350 | Uyghur = 306, |
| 351 | Uzbek = 307, |
| 352 | Vai = 308, |
| 353 | Venda = 309, |
| 354 | Vietnamese = 310, |
| 355 | Volapuk = 311, |
| 356 | Vunjo = 312, |
| 357 | Walloon = 313, |
| 358 | Walser = 314, |
| 359 | Warlpiri = 315, |
| 360 | Welsh = 316, |
| 361 | WesternBalochi = 317, |
| 362 | WesternFrisian = 318, |
| 363 | Wolaytta = 319, |
| 364 | Wolof = 320, |
| 365 | Xhosa = 321, |
| 366 | Yangben = 322, |
| 367 | Yiddish = 323, |
| 368 | Yoruba = 324, |
| 369 | Zarma = 325, |
| 370 | Zhuang = 326, |
| 371 | Zulu = 327, |
| 372 | Kaingang = 328, |
| 373 | Nheengatu = 329, |
| 374 | Haryanvi = 330, |
| 375 | NorthernFrisian = 331, |
| 376 | Rajasthani = 332, |
| 377 | Moksha = 333, |
| 378 | TokiPona = 334, |
| 379 | Pijin = 335, |
| 380 | Obolo = 336, |
| 381 | Baluchi = 337, |
| 382 | Ligurian = 338, |
| 383 | Rohingya = 339, |
| 384 | Torwali = 340, |
| 385 | Anii = 341, |
| 386 | Kangri = 342, |
| 387 | Venetian = 343, |
| 388 | Kuvi = 344, |
| 389 | KaraKalpak = 345, |
| 390 | SwampyCree = 346, |
| 391 | |
| 392 | Afan = Oromo, |
| 393 | Bengali = Bangla, |
| 394 | Bhutani = Dzongkha, |
| 395 | Byelorussian = Belarusian, |
| 396 | Cambodian = Khmer, |
| 397 | CentralMoroccoTamazight = CentralAtlasTamazight, |
| 398 | Chewa = Nyanja, |
| 399 | Frisian = WesternFrisian, |
| 400 | Greenlandic = Kalaallisut, |
| 401 | Inupiak = Inupiaq, |
| 402 | Kirghiz = Kyrgyz, |
| 403 | Kurundi = Rundi, |
| 404 | Kwanyama = Kuanyama, |
| 405 | Navaho = Navajo, |
| 406 | Oriya = Odia, |
| 407 | RhaetoRomance = Romansh, |
| 408 | Uighur = Uyghur, |
| 409 | Uigur = Uyghur, |
| 410 | Walamo = Wolaytta, |
| 411 | |
| 412 | LastLanguage = SwampyCree |
| 413 | }; |
| 414 | |
| 415 | enum Script : ushort { |
| 416 | AnyScript = 0, |
| 417 | AdlamScript = 1, |
| 418 | AhomScript = 2, |
| 419 | AnatolianHieroglyphsScript = 3, |
| 420 | ArabicScript = 4, |
| 421 | ArmenianScript = 5, |
| 422 | AvestanScript = 6, |
| 423 | BalineseScript = 7, |
| 424 | BamumScript = 8, |
| 425 | BanglaScript = 9, |
| 426 | BassaVahScript = 10, |
| 427 | BatakScript = 11, |
| 428 | BhaiksukiScript = 12, |
| 429 | BopomofoScript = 13, |
| 430 | BrahmiScript = 14, |
| 431 | BrailleScript = 15, |
| 432 | BugineseScript = 16, |
| 433 | BuhidScript = 17, |
| 434 | CanadianAboriginalScript = 18, |
| 435 | CarianScript = 19, |
| 436 | CaucasianAlbanianScript = 20, |
| 437 | ChakmaScript = 21, |
| 438 | ChamScript = 22, |
| 439 | CherokeeScript = 23, |
| 440 | CopticScript = 24, |
| 441 | CuneiformScript = 25, |
| 442 | CypriotScript = 26, |
| 443 | CyrillicScript = 27, |
| 444 | DeseretScript = 28, |
| 445 | DevanagariScript = 29, |
| 446 | DuployanScript = 30, |
| 447 | EgyptianHieroglyphsScript = 31, |
| 448 | ElbasanScript = 32, |
| 449 | EthiopicScript = 33, |
| 450 | FraserScript = 34, |
| 451 | GeorgianScript = 35, |
| 452 | GlagoliticScript = 36, |
| 453 | GothicScript = 37, |
| 454 | GranthaScript = 38, |
| 455 | GreekScript = 39, |
| 456 | GujaratiScript = 40, |
| 457 | GurmukhiScript = 41, |
| 458 | HangulScript = 42, |
| 459 | HanScript = 43, |
| 460 | HanunooScript = 44, |
| 461 | HanWithBopomofoScript = 45, |
| 462 | HatranScript = 46, |
| 463 | HebrewScript = 47, |
| 464 | HiraganaScript = 48, |
| 465 | ImperialAramaicScript = 49, |
| 466 | InscriptionalPahlaviScript = 50, |
| 467 | InscriptionalParthianScript = 51, |
| 468 | JamoScript = 52, |
| 469 | JapaneseScript = 53, |
| 470 | JavaneseScript = 54, |
| 471 | KaithiScript = 55, |
| 472 | KannadaScript = 56, |
| 473 | KatakanaScript = 57, |
| 474 | KayahLiScript = 58, |
| 475 | KharoshthiScript = 59, |
| 476 | KhmerScript = 60, |
| 477 | KhojkiScript = 61, |
| 478 | KhudawadiScript = 62, |
| 479 | KoreanScript = 63, |
| 480 | LannaScript = 64, |
| 481 | LaoScript = 65, |
| 482 | LatinScript = 66, |
| 483 | LepchaScript = 67, |
| 484 | LimbuScript = 68, |
| 485 | LinearAScript = 69, |
| 486 | LinearBScript = 70, |
| 487 | LycianScript = 71, |
| 488 | LydianScript = 72, |
| 489 | MahajaniScript = 73, |
| 490 | MalayalamScript = 74, |
| 491 | MandaeanScript = 75, |
| 492 | ManichaeanScript = 76, |
| 493 | MarchenScript = 77, |
| 494 | MeiteiMayekScript = 78, |
| 495 | MendeScript = 79, |
| 496 | MeroiticCursiveScript = 80, |
| 497 | MeroiticScript = 81, |
| 498 | ModiScript = 82, |
| 499 | MongolianScript = 83, |
| 500 | MroScript = 84, |
| 501 | MultaniScript = 85, |
| 502 | MyanmarScript = 86, |
| 503 | NabataeanScript = 87, |
| 504 | NewaScript = 88, |
| 505 | NewTaiLueScript = 89, |
| 506 | NkoScript = 90, |
| 507 | OdiaScript = 91, |
| 508 | OghamScript = 92, |
| 509 | OlChikiScript = 93, |
| 510 | OldHungarianScript = 94, |
| 511 | OldItalicScript = 95, |
| 512 | OldNorthArabianScript = 96, |
| 513 | OldPermicScript = 97, |
| 514 | OldPersianScript = 98, |
| 515 | OldSouthArabianScript = 99, |
| 516 | OrkhonScript = 100, |
| 517 | OsageScript = 101, |
| 518 | OsmanyaScript = 102, |
| 519 | PahawhHmongScript = 103, |
| 520 | PalmyreneScript = 104, |
| 521 | PauCinHauScript = 105, |
| 522 | PhagsPaScript = 106, |
| 523 | PhoenicianScript = 107, |
| 524 | PollardPhoneticScript = 108, |
| 525 | PsalterPahlaviScript = 109, |
| 526 | RejangScript = 110, |
| 527 | RunicScript = 111, |
| 528 | SamaritanScript = 112, |
| 529 | SaurashtraScript = 113, |
| 530 | SharadaScript = 114, |
| 531 | ShavianScript = 115, |
| 532 | SiddhamScript = 116, |
| 533 | SignWritingScript = 117, |
| 534 | SimplifiedHanScript = 118, |
| 535 | SinhalaScript = 119, |
| 536 | SoraSompengScript = 120, |
| 537 | SundaneseScript = 121, |
| 538 | SylotiNagriScript = 122, |
| 539 | SyriacScript = 123, |
| 540 | TagalogScript = 124, |
| 541 | TagbanwaScript = 125, |
| 542 | TaiLeScript = 126, |
| 543 | TaiVietScript = 127, |
| 544 | TakriScript = 128, |
| 545 | TamilScript = 129, |
| 546 | TangutScript = 130, |
| 547 | TeluguScript = 131, |
| 548 | ThaanaScript = 132, |
| 549 | ThaiScript = 133, |
| 550 | TibetanScript = 134, |
| 551 | TifinaghScript = 135, |
| 552 | TirhutaScript = 136, |
| 553 | TraditionalHanScript = 137, |
| 554 | UgariticScript = 138, |
| 555 | VaiScript = 139, |
| 556 | VarangKshitiScript = 140, |
| 557 | YiScript = 141, |
| 558 | HanifiScript = 142, |
| 559 | |
| 560 | BengaliScript = BanglaScript, |
| 561 | MendeKikakuiScript = MendeScript, |
| 562 | OriyaScript = OdiaScript, |
| 563 | SimplifiedChineseScript = SimplifiedHanScript, |
| 564 | TraditionalChineseScript = TraditionalHanScript, |
| 565 | |
| 566 | LastScript = HanifiScript |
| 567 | }; |
| 568 | |
| 569 | // ### Qt 7: Rename to Territory |
| 570 | enum Country : ushort { |
| 571 | AnyTerritory = 0, |
| 572 | Afghanistan = 1, |
| 573 | AlandIslands = 2, |
| 574 | Albania = 3, |
| 575 | Algeria = 4, |
| 576 | AmericanSamoa = 5, |
| 577 | Andorra = 6, |
| 578 | Angola = 7, |
| 579 | Anguilla = 8, |
| 580 | Antarctica = 9, |
| 581 | AntiguaAndBarbuda = 10, |
| 582 | Argentina = 11, |
| 583 | Armenia = 12, |
| 584 | Aruba = 13, |
| 585 | AscensionIsland = 14, |
| 586 | Australia = 15, |
| 587 | Austria = 16, |
| 588 | Azerbaijan = 17, |
| 589 | Bahamas = 18, |
| 590 | Bahrain = 19, |
| 591 | Bangladesh = 20, |
| 592 | Barbados = 21, |
| 593 | Belarus = 22, |
| 594 | Belgium = 23, |
| 595 | Belize = 24, |
| 596 | Benin = 25, |
| 597 | Bermuda = 26, |
| 598 | Bhutan = 27, |
| 599 | Bolivia = 28, |
| 600 | BosniaAndHerzegovina = 29, |
| 601 | Botswana = 30, |
| 602 | BouvetIsland = 31, |
| 603 | Brazil = 32, |
| 604 | BritishIndianOceanTerritory = 33, |
| 605 | BritishVirginIslands = 34, |
| 606 | Brunei = 35, |
| 607 | Bulgaria = 36, |
| 608 | BurkinaFaso = 37, |
| 609 | Burundi = 38, |
| 610 | Cambodia = 39, |
| 611 | Cameroon = 40, |
| 612 | Canada = 41, |
| 613 | CanaryIslands = 42, |
| 614 | CapeVerde = 43, |
| 615 | CaribbeanNetherlands = 44, |
| 616 | CaymanIslands = 45, |
| 617 | CentralAfricanRepublic = 46, |
| 618 | CeutaAndMelilla = 47, |
| 619 | Chad = 48, |
| 620 | Chile = 49, |
| 621 | China = 50, |
| 622 | ChristmasIsland = 51, |
| 623 | ClippertonIsland = 52, |
| 624 | CocosIslands = 53, |
| 625 | Colombia = 54, |
| 626 | Comoros = 55, |
| 627 | CongoBrazzaville = 56, |
| 628 | CongoKinshasa = 57, |
| 629 | CookIslands = 58, |
| 630 | CostaRica = 59, |
| 631 | Croatia = 60, |
| 632 | Cuba = 61, |
| 633 | Curacao = 62, |
| 634 | Cyprus = 63, |
| 635 | Czechia = 64, |
| 636 | Denmark = 65, |
| 637 | DiegoGarcia = 66, |
| 638 | Djibouti = 67, |
| 639 | Dominica = 68, |
| 640 | DominicanRepublic = 69, |
| 641 | Ecuador = 70, |
| 642 | Egypt = 71, |
| 643 | ElSalvador = 72, |
| 644 | EquatorialGuinea = 73, |
| 645 | Eritrea = 74, |
| 646 | Estonia = 75, |
| 647 | Eswatini = 76, |
| 648 | Ethiopia = 77, |
| 649 | Europe = 78, |
| 650 | EuropeanUnion = 79, |
| 651 | FalklandIslands = 80, |
| 652 | FaroeIslands = 81, |
| 653 | Fiji = 82, |
| 654 | Finland = 83, |
| 655 | France = 84, |
| 656 | FrenchGuiana = 85, |
| 657 | FrenchPolynesia = 86, |
| 658 | FrenchSouthernTerritories = 87, |
| 659 | Gabon = 88, |
| 660 | Gambia = 89, |
| 661 | Georgia = 90, |
| 662 | Germany = 91, |
| 663 | Ghana = 92, |
| 664 | Gibraltar = 93, |
| 665 | Greece = 94, |
| 666 | Greenland = 95, |
| 667 | Grenada = 96, |
| 668 | Guadeloupe = 97, |
| 669 | Guam = 98, |
| 670 | Guatemala = 99, |
| 671 | Guernsey = 100, |
| 672 | GuineaBissau = 101, |
| 673 | Guinea = 102, |
| 674 | Guyana = 103, |
| 675 | Haiti = 104, |
| 676 | HeardAndMcDonaldIslands = 105, |
| 677 | Honduras = 106, |
| 678 | HongKong = 107, |
| 679 | Hungary = 108, |
| 680 | Iceland = 109, |
| 681 | India = 110, |
| 682 | Indonesia = 111, |
| 683 | Iran = 112, |
| 684 | Iraq = 113, |
| 685 | Ireland = 114, |
| 686 | IsleOfMan = 115, |
| 687 | Israel = 116, |
| 688 | Italy = 117, |
| 689 | IvoryCoast = 118, |
| 690 | Jamaica = 119, |
| 691 | Japan = 120, |
| 692 | Jersey = 121, |
| 693 | Jordan = 122, |
| 694 | Kazakhstan = 123, |
| 695 | Kenya = 124, |
| 696 | Kiribati = 125, |
| 697 | Kosovo = 126, |
| 698 | Kuwait = 127, |
| 699 | Kyrgyzstan = 128, |
| 700 | Laos = 129, |
| 701 | LatinAmerica = 130, |
| 702 | Latvia = 131, |
| 703 | Lebanon = 132, |
| 704 | Lesotho = 133, |
| 705 | Liberia = 134, |
| 706 | Libya = 135, |
| 707 | Liechtenstein = 136, |
| 708 | Lithuania = 137, |
| 709 | Luxembourg = 138, |
| 710 | Macao = 139, |
| 711 | Macedonia = 140, |
| 712 | Madagascar = 141, |
| 713 | Malawi = 142, |
| 714 | Malaysia = 143, |
| 715 | Maldives = 144, |
| 716 | Mali = 145, |
| 717 | Malta = 146, |
| 718 | MarshallIslands = 147, |
| 719 | Martinique = 148, |
| 720 | Mauritania = 149, |
| 721 | Mauritius = 150, |
| 722 | Mayotte = 151, |
| 723 | Mexico = 152, |
| 724 | Micronesia = 153, |
| 725 | Moldova = 154, |
| 726 | Monaco = 155, |
| 727 | Mongolia = 156, |
| 728 | Montenegro = 157, |
| 729 | Montserrat = 158, |
| 730 | Morocco = 159, |
| 731 | Mozambique = 160, |
| 732 | Myanmar = 161, |
| 733 | Namibia = 162, |
| 734 | NauruTerritory = 163, |
| 735 | Nepal = 164, |
| 736 | Netherlands = 165, |
| 737 | NewCaledonia = 166, |
| 738 | NewZealand = 167, |
| 739 | Nicaragua = 168, |
| 740 | Nigeria = 169, |
| 741 | Niger = 170, |
| 742 | Niue = 171, |
| 743 | NorfolkIsland = 172, |
| 744 | NorthernMarianaIslands = 173, |
| 745 | NorthKorea = 174, |
| 746 | Norway = 175, |
| 747 | Oman = 176, |
| 748 | OutlyingOceania = 177, |
| 749 | Pakistan = 178, |
| 750 | Palau = 179, |
| 751 | PalestinianTerritories = 180, |
| 752 | Panama = 181, |
| 753 | PapuaNewGuinea = 182, |
| 754 | Paraguay = 183, |
| 755 | Peru = 184, |
| 756 | Philippines = 185, |
| 757 | Pitcairn = 186, |
| 758 | Poland = 187, |
| 759 | Portugal = 188, |
| 760 | PuertoRico = 189, |
| 761 | Qatar = 190, |
| 762 | Reunion = 191, |
| 763 | Romania = 192, |
| 764 | Russia = 193, |
| 765 | Rwanda = 194, |
| 766 | SaintBarthelemy = 195, |
| 767 | SaintHelena = 196, |
| 768 | SaintKittsAndNevis = 197, |
| 769 | SaintLucia = 198, |
| 770 | SaintMartin = 199, |
| 771 | SaintPierreAndMiquelon = 200, |
| 772 | SaintVincentAndGrenadines = 201, |
| 773 | Samoa = 202, |
| 774 | SanMarino = 203, |
| 775 | SaoTomeAndPrincipe = 204, |
| 776 | SaudiArabia = 205, |
| 777 | Senegal = 206, |
| 778 | Serbia = 207, |
| 779 | Seychelles = 208, |
| 780 | SierraLeone = 209, |
| 781 | Singapore = 210, |
| 782 | SintMaarten = 211, |
| 783 | Slovakia = 212, |
| 784 | Slovenia = 213, |
| 785 | SolomonIslands = 214, |
| 786 | Somalia = 215, |
| 787 | SouthAfrica = 216, |
| 788 | SouthGeorgiaAndSouthSandwichIslands = 217, |
| 789 | SouthKorea = 218, |
| 790 | SouthSudan = 219, |
| 791 | Spain = 220, |
| 792 | SriLanka = 221, |
| 793 | Sudan = 222, |
| 794 | Suriname = 223, |
| 795 | SvalbardAndJanMayen = 224, |
| 796 | Sweden = 225, |
| 797 | Switzerland = 226, |
| 798 | Syria = 227, |
| 799 | Taiwan = 228, |
| 800 | Tajikistan = 229, |
| 801 | Tanzania = 230, |
| 802 | Thailand = 231, |
| 803 | TimorLeste = 232, |
| 804 | Togo = 233, |
| 805 | TokelauTerritory = 234, |
| 806 | Tonga = 235, |
| 807 | TrinidadAndTobago = 236, |
| 808 | TristanDaCunha = 237, |
| 809 | Tunisia = 238, |
| 810 | Turkey = 239, |
| 811 | Turkmenistan = 240, |
| 812 | TurksAndCaicosIslands = 241, |
| 813 | TuvaluTerritory = 242, |
| 814 | Uganda = 243, |
| 815 | Ukraine = 244, |
| 816 | UnitedArabEmirates = 245, |
| 817 | UnitedKingdom = 246, |
| 818 | UnitedStatesOutlyingIslands = 247, |
| 819 | UnitedStates = 248, |
| 820 | UnitedStatesVirginIslands = 249, |
| 821 | Uruguay = 250, |
| 822 | Uzbekistan = 251, |
| 823 | Vanuatu = 252, |
| 824 | VaticanCity = 253, |
| 825 | Venezuela = 254, |
| 826 | Vietnam = 255, |
| 827 | WallisAndFutuna = 256, |
| 828 | WesternSahara = 257, |
| 829 | World = 258, |
| 830 | Yemen = 259, |
| 831 | Zambia = 260, |
| 832 | Zimbabwe = 261, |
| 833 | |
| 834 | AnyCountry = AnyTerritory, |
| 835 | Bonaire = CaribbeanNetherlands, |
| 836 | BosniaAndHerzegowina = BosniaAndHerzegovina, |
| 837 | CuraSao = Curacao, |
| 838 | CzechRepublic = Czechia, |
| 839 | DemocraticRepublicOfCongo = CongoKinshasa, |
| 840 | DemocraticRepublicOfKorea = NorthKorea, |
| 841 | EastTimor = TimorLeste, |
| 842 | LatinAmericaAndTheCaribbean = LatinAmerica, |
| 843 | Macau = Macao, |
| 844 | NauruCountry = NauruTerritory, |
| 845 | PeoplesRepublicOfCongo = CongoBrazzaville, |
| 846 | RepublicOfKorea = SouthKorea, |
| 847 | RussianFederation = Russia, |
| 848 | SaintVincentAndTheGrenadines = SaintVincentAndGrenadines, |
| 849 | SouthGeorgiaAndTheSouthSandwichIslands = SouthGeorgiaAndSouthSandwichIslands, |
| 850 | SvalbardAndJanMayenIslands = SvalbardAndJanMayen, |
| 851 | Swaziland = Eswatini, |
| 852 | SyrianArabRepublic = Syria, |
| 853 | TokelauCountry = TokelauTerritory, |
| 854 | TuvaluCountry = TuvaluTerritory, |
| 855 | UnitedStatesMinorOutlyingIslands = UnitedStatesOutlyingIslands, |
| 856 | VaticanCityState = VaticanCity, |
| 857 | WallisAndFutunaIslands = WallisAndFutuna, |
| 858 | |
| 859 | LastTerritory = Zimbabwe, |
| 860 | LastCountry = LastTerritory |
| 861 | }; |
| 862 | // GENERATED PART ENDS HERE |
| 863 | |
| 864 | using Territory = Country; // ### Qt 7: reverse |
| 865 | |
| 866 | Q_ENUM(Language) |
| 867 | Q_ENUM(Country) |
| 868 | Q_ENUM(Script) |
| 869 | |
| 870 | enum MeasurementSystem { |
| 871 | MetricSystem, |
| 872 | ImperialUSSystem, |
| 873 | ImperialUKSystem, |
| 874 | ImperialSystem = ImperialUSSystem // Qt 4 compatibility |
| 875 | }; |
| 876 | Q_ENUM(MeasurementSystem) |
| 877 | |
| 878 | enum FormatType { LongFormat, ShortFormat, NarrowFormat }; |
| 879 | Q_ENUM(FormatType) |
| 880 | enum NumberOption { |
| 881 | DefaultNumberOptions = 0x0, |
| 882 | OmitGroupSeparator = 0x01, |
| 883 | RejectGroupSeparator = 0x02, |
| 884 | OmitLeadingZeroInExponent = 0x04, |
| 885 | RejectLeadingZeroInExponent = 0x08, |
| 886 | IncludeTrailingZeroesAfterDot = 0x10, |
| 887 | RejectTrailingZeroesAfterDot = 0x20 |
| 888 | }; |
| 889 | Q_DECLARE_FLAGS(NumberOptions, NumberOption) |
| 890 | Q_FLAG(NumberOptions) |
| 891 | |
| 892 | enum FloatingPointPrecisionOption { |
| 893 | FloatingPointShortest = -128 |
| 894 | }; |
| 895 | |
| 896 | enum class TagSeparator : char { Dash = '-', Underscore = '_' }; |
| 897 | Q_ENUM(TagSeparator) |
| 898 | |
| 899 | enum CurrencySymbolFormat { |
| 900 | CurrencyIsoCode, |
| 901 | CurrencySymbol, |
| 902 | CurrencyDisplayName |
| 903 | }; |
| 904 | Q_ENUM(CurrencySymbolFormat) |
| 905 | |
| 906 | enum DataSizeFormat { |
| 907 | // Single-bit values, for internal use. |
| 908 | DataSizeBase1000 = 1, // use factors of 1000 instead of IEC's 1024; |
| 909 | DataSizeSIQuantifiers = 2, // use SI quantifiers instead of IEC ones. |
| 910 | |
| 911 | // Flags values for use in API: |
| 912 | DataSizeIecFormat = 0, // base 1024, KiB, MiB, GiB, ... |
| 913 | DataSizeTraditionalFormat = DataSizeSIQuantifiers, // base 1024, kB, MB, GB, ... |
| 914 | DataSizeSIFormat = DataSizeBase1000 | DataSizeSIQuantifiers // base 1000, kB, MB, GB, ... |
| 915 | }; |
| 916 | Q_DECLARE_FLAGS(DataSizeFormats, DataSizeFormat) |
| 917 | Q_FLAG(DataSizeFormats) |
| 918 | |
| 919 | QLocale(); |
| 920 | QT_CORE_INLINE_SINCE(6, 4) |
| 921 | explicit QLocale(const QString &name); |
| 922 | explicit QLocale(QStringView name); |
| 923 | QLocale(Language language, Territory territory); |
| 924 | QLocale(Language language, Script script = AnyScript, Territory territory = AnyTerritory); |
| 925 | QLocale(const QLocale &other) noexcept; |
| 926 | QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QLocale) |
| 927 | QLocale &operator=(const QLocale &other) noexcept; |
| 928 | ~QLocale(); |
| 929 | |
| 930 | void swap(QLocale &other) noexcept { d.swap(other&: other.d); } |
| 931 | |
| 932 | Language language() const; |
| 933 | Script script() const; |
| 934 | Territory territory() const; |
| 935 | #if QT_DEPRECATED_SINCE(6, 6) |
| 936 | QT_DEPRECATED_VERSION_X_6_6("Use territory() instead" ) |
| 937 | Country country() const; |
| 938 | #endif |
| 939 | |
| 940 | #if QT_CORE_REMOVED_SINCE(6, 7) |
| 941 | QString name() const; |
| 942 | QString bcp47Name() const; |
| 943 | #endif |
| 944 | QString name(TagSeparator separator = TagSeparator::Underscore) const; |
| 945 | QString bcp47Name(TagSeparator separator = TagSeparator::Dash) const; |
| 946 | |
| 947 | QString nativeLanguageName() const; |
| 948 | QString nativeTerritoryName() const; |
| 949 | #if QT_DEPRECATED_SINCE(6, 6) |
| 950 | QT_DEPRECATED_VERSION_X_6_6("Use nativeTerritoryName() instead" ) |
| 951 | QString nativeCountryName() const; |
| 952 | #endif |
| 953 | |
| 954 | short toShort(const QString &s, bool *ok = nullptr) const |
| 955 | { return toShort(s: qToStringViewIgnoringNull(s), ok); } |
| 956 | ushort toUShort(const QString &s, bool *ok = nullptr) const |
| 957 | { return toUShort(s: qToStringViewIgnoringNull(s), ok); } |
| 958 | int toInt(const QString &s, bool *ok = nullptr) const |
| 959 | { return toInt(s: qToStringViewIgnoringNull(s), ok); } |
| 960 | uint toUInt(const QString &s, bool *ok = nullptr) const |
| 961 | { return toUInt(s: qToStringViewIgnoringNull(s), ok); } |
| 962 | long toLong(const QString &s, bool *ok = nullptr) const |
| 963 | { return toLong(s: qToStringViewIgnoringNull(s), ok); } |
| 964 | ulong toULong(const QString &s, bool *ok = nullptr) const |
| 965 | { return toULong(s: qToStringViewIgnoringNull(s), ok); } |
| 966 | qlonglong toLongLong(const QString &s, bool *ok = nullptr) const |
| 967 | { return toLongLong(s: qToStringViewIgnoringNull(s), ok); } |
| 968 | qulonglong toULongLong(const QString &s, bool *ok = nullptr) const |
| 969 | { return toULongLong(s: qToStringViewIgnoringNull(s), ok); } |
| 970 | float toFloat(const QString &s, bool *ok = nullptr) const |
| 971 | { return toFloat(s: qToStringViewIgnoringNull(s), ok); } |
| 972 | double toDouble(const QString &s, bool *ok = nullptr) const |
| 973 | { return toDouble(s: qToStringViewIgnoringNull(s), ok); } |
| 974 | |
| 975 | short toShort(QStringView s, bool *ok = nullptr) const; |
| 976 | ushort toUShort(QStringView s, bool *ok = nullptr) const; |
| 977 | int toInt(QStringView s, bool *ok = nullptr) const; |
| 978 | uint toUInt(QStringView s, bool *ok = nullptr) const; |
| 979 | long toLong(QStringView s, bool *ok = nullptr) const; |
| 980 | ulong toULong(QStringView s, bool *ok = nullptr) const; |
| 981 | qlonglong toLongLong(QStringView s, bool *ok = nullptr) const; |
| 982 | qulonglong toULongLong(QStringView s, bool *ok = nullptr) const; |
| 983 | float toFloat(QStringView s, bool *ok = nullptr) const; |
| 984 | double toDouble(QStringView s, bool *ok = nullptr) const; |
| 985 | |
| 986 | QString toString(qlonglong i) const; |
| 987 | QString toString(qulonglong i) const; |
| 988 | QString toString(long i) const { return toString(i: qlonglong(i)); } |
| 989 | QString toString(ulong i) const { return toString(i: qulonglong(i)); } |
| 990 | QString toString(short i) const { return toString(i: qlonglong(i)); } |
| 991 | QString toString(ushort i) const { return toString(i: qulonglong(i)); } |
| 992 | QString toString(int i) const { return toString(i: qlonglong(i)); } |
| 993 | QString toString(uint i) const { return toString(i: qulonglong(i)); } |
| 994 | QString toString(double f, char format = 'g', int precision = 6) const; |
| 995 | QString toString(float f, char format = 'g', int precision = 6) const |
| 996 | { return toString(f: double(f), format, precision); } |
| 997 | |
| 998 | // (Can't inline first two: passing by value doesn't work when only forward-declared.) |
| 999 | QString toString(QDate date, const QString &format) const; |
| 1000 | QString toString(QTime time, const QString &format) const; |
| 1001 | QString toString(const QDateTime &dateTime, const QString &format) const |
| 1002 | { return toString(dateTime, format: qToStringViewIgnoringNull(s: format)); } |
| 1003 | QString toString(QDate date, QStringView format) const; |
| 1004 | QString toString(QTime time, QStringView format) const; |
| 1005 | QString toString(const QDateTime &dateTime, QStringView format) const; |
| 1006 | QString toString(QDate date, FormatType format = LongFormat) const; |
| 1007 | QString toString(QTime time, FormatType format = LongFormat) const; |
| 1008 | QString toString(const QDateTime &dateTime, FormatType format = LongFormat) const; |
| 1009 | /* We can't pass a default for QCalendar (its declaration mentions |
| 1010 | * QLocale::FormatType, so it has to #include this header, which thus can't |
| 1011 | * #include its, so we can't instantiate QCalendar() as default). This |
| 1012 | * precludes any default for format, too. |
| 1013 | */ |
| 1014 | QString toString(QDate date, QStringView format, QCalendar cal) const; |
| 1015 | QString toString(QDate date, FormatType format, QCalendar cal) const; |
| 1016 | QString toString(const QDateTime &dateTime, FormatType format, QCalendar cal) const; |
| 1017 | QString toString(const QDateTime &dateTime, QStringView format, QCalendar cal) const; |
| 1018 | |
| 1019 | QString dateFormat(FormatType format = LongFormat) const; |
| 1020 | QString timeFormat(FormatType format = LongFormat) const; |
| 1021 | QString dateTimeFormat(FormatType format = LongFormat) const; |
| 1022 | // QCalendar's header has to #include QLocale's, preventing the reverse, so |
| 1023 | // QCalendar parameters can't have defaults here. |
| 1024 | #if QT_CONFIG(datestring) |
| 1025 | QTime toTime(const QString &string, FormatType = LongFormat) const; |
| 1026 | QTime toTime(const QString &string, const QString &format) const; |
| 1027 | # if QT_CORE_REMOVED_SINCE(6, 7) |
| 1028 | QDate toDate(const QString &string, FormatType = LongFormat) const; |
| 1029 | QDate toDate(const QString &string, const QString &format) const; |
| 1030 | QDateTime toDateTime(const QString &string, FormatType format = LongFormat) const; |
| 1031 | QDateTime toDateTime(const QString &string, const QString &format) const; |
| 1032 | // Calendar-aware API |
| 1033 | QDate toDate(const QString &string, FormatType format, QCalendar cal) const; |
| 1034 | QDate toDate(const QString &string, const QString &format, QCalendar cal) const; |
| 1035 | QDateTime toDateTime(const QString &string, FormatType format, QCalendar cal) const; |
| 1036 | QDateTime toDateTime(const QString &string, const QString &format, QCalendar cal) const; |
| 1037 | # endif |
| 1038 | QDate toDate(const QString &string, FormatType = LongFormat, |
| 1039 | int baseYear = DefaultTwoDigitBaseYear) const; |
| 1040 | QDate toDate(const QString &string, const QString &format, |
| 1041 | int baseYear = DefaultTwoDigitBaseYear) const; |
| 1042 | QDateTime toDateTime(const QString &string, FormatType format = LongFormat, |
| 1043 | int baseYear = DefaultTwoDigitBaseYear) const; |
| 1044 | QDateTime toDateTime(const QString &string, const QString &format, |
| 1045 | int baseYear = DefaultTwoDigitBaseYear) const; |
| 1046 | // Calendar-aware API |
| 1047 | QDate toDate(const QString &string, FormatType format, QCalendar cal, |
| 1048 | int baseYear = DefaultTwoDigitBaseYear) const; |
| 1049 | QDate toDate(const QString &string, const QString &format, QCalendar cal, |
| 1050 | int baseYear = DefaultTwoDigitBaseYear) const; |
| 1051 | QDateTime toDateTime(const QString &string, FormatType format, QCalendar cal, |
| 1052 | int baseYear = DefaultTwoDigitBaseYear) const; |
| 1053 | QDateTime toDateTime(const QString &string, const QString &format, QCalendar cal, |
| 1054 | int baseYear = DefaultTwoDigitBaseYear) const; |
| 1055 | #endif |
| 1056 | |
| 1057 | QString decimalPoint() const; |
| 1058 | QString groupSeparator() const; |
| 1059 | QString percent() const; |
| 1060 | QString zeroDigit() const; |
| 1061 | QString negativeSign() const; |
| 1062 | QString positiveSign() const; |
| 1063 | QString exponential() const; |
| 1064 | |
| 1065 | QString monthName(int, FormatType format = LongFormat) const; |
| 1066 | QString standaloneMonthName(int, FormatType format = LongFormat) const; |
| 1067 | QString dayName(int, FormatType format = LongFormat) const; |
| 1068 | QString standaloneDayName(int, FormatType format = LongFormat) const; |
| 1069 | |
| 1070 | Qt::DayOfWeek firstDayOfWeek() const; |
| 1071 | QList<Qt::DayOfWeek> weekdays() const; |
| 1072 | |
| 1073 | QString amText() const; |
| 1074 | QString pmText() const; |
| 1075 | |
| 1076 | MeasurementSystem measurementSystem() const; |
| 1077 | QLocale collation() const; |
| 1078 | Qt::LayoutDirection textDirection() const; |
| 1079 | |
| 1080 | QString toUpper(const QString &str) const; |
| 1081 | QString toLower(const QString &str) const; |
| 1082 | |
| 1083 | QString currencySymbol(CurrencySymbolFormat = CurrencySymbol) const; |
| 1084 | QString toCurrencyString(qlonglong, const QString &symbol = QString()) const; |
| 1085 | QString toCurrencyString(qulonglong, const QString &symbol = QString()) const; |
| 1086 | QString toCurrencyString(short i, const QString &symbol = QString()) const |
| 1087 | { return toCurrencyString(qlonglong(i), symbol); } |
| 1088 | QString toCurrencyString(ushort i, const QString &symbol = QString()) const |
| 1089 | { return toCurrencyString(qulonglong(i), symbol); } |
| 1090 | QString toCurrencyString(int i, const QString &symbol = QString()) const |
| 1091 | { return toCurrencyString(qlonglong(i), symbol); } |
| 1092 | QString toCurrencyString(uint i, const QString &symbol = QString()) const |
| 1093 | { return toCurrencyString(qulonglong(i), symbol); } |
| 1094 | QString toCurrencyString(double, const QString &symbol = QString(), int precision = -1) const; |
| 1095 | QString toCurrencyString(float i, const QString &symbol = QString(), int precision = -1) const |
| 1096 | { return toCurrencyString(double(i), symbol, precision); } |
| 1097 | |
| 1098 | QString formattedDataSize(qint64 bytes, int precision = 2, DataSizeFormats format = DataSizeIecFormat) const; |
| 1099 | |
| 1100 | #if QT_CORE_REMOVED_SINCE(6, 7) |
| 1101 | QStringList uiLanguages() const; |
| 1102 | #endif |
| 1103 | QStringList uiLanguages(TagSeparator separator = TagSeparator::Dash) const; |
| 1104 | |
| 1105 | enum LanguageCodeType { |
| 1106 | ISO639Part1 = 1 << 0, |
| 1107 | ISO639Part2B = 1 << 1, |
| 1108 | ISO639Part2T = 1 << 2, |
| 1109 | ISO639Part3 = 1 << 3, |
| 1110 | LegacyLanguageCode = 1 << 15, |
| 1111 | |
| 1112 | ISO639Part2 = ISO639Part2B | ISO639Part2T, |
| 1113 | ISO639Alpha2 = ISO639Part1, |
| 1114 | ISO639Alpha3 = ISO639Part2 | ISO639Part3, |
| 1115 | ISO639 = ISO639Alpha2 | ISO639Alpha3, |
| 1116 | |
| 1117 | AnyLanguageCode = -1 |
| 1118 | }; |
| 1119 | Q_DECLARE_FLAGS(LanguageCodeTypes, LanguageCodeType) |
| 1120 | Q_FLAG(LanguageCodeTypes) |
| 1121 | |
| 1122 | #if QT_CORE_REMOVED_SINCE(6, 3) |
| 1123 | static QString languageToCode(Language language); |
| 1124 | static Language codeToLanguage(QStringView languageCode) noexcept; |
| 1125 | #endif |
| 1126 | static QString languageToCode(Language language, LanguageCodeTypes codeTypes = AnyLanguageCode); |
| 1127 | static Language codeToLanguage(QStringView languageCode, |
| 1128 | LanguageCodeTypes codeTypes = AnyLanguageCode) noexcept; |
| 1129 | static QString territoryToCode(Territory territory); |
| 1130 | static Territory codeToTerritory(QStringView territoryCode) noexcept; |
| 1131 | #if QT_DEPRECATED_SINCE(6, 6) |
| 1132 | QT_DEPRECATED_VERSION_X_6_6("Use territoryToCode(Territory) instead" ) |
| 1133 | static QString countryToCode(Country country); |
| 1134 | QT_DEPRECATED_VERSION_X_6_6("Use codeToTerritory(QStringView) instead" ) |
| 1135 | static Country codeToCountry(QStringView countryCode) noexcept; |
| 1136 | #endif |
| 1137 | static QString scriptToCode(Script script); |
| 1138 | static Script codeToScript(QStringView scriptCode) noexcept; |
| 1139 | |
| 1140 | static QString languageToString(Language language); |
| 1141 | static QString territoryToString(Territory territory); |
| 1142 | #if QT_DEPRECATED_SINCE(6, 6) |
| 1143 | QT_DEPRECATED_VERSION_X_6_6("Use territoryToString(Territory) instead" ) |
| 1144 | static QString countryToString(Country country); |
| 1145 | #endif |
| 1146 | static QString scriptToString(Script script); |
| 1147 | static void setDefault(const QLocale &locale); |
| 1148 | |
| 1149 | static QLocale c() { return QLocale(C); } |
| 1150 | static QLocale system(); |
| 1151 | |
| 1152 | static QList<QLocale> matchingLocales(QLocale::Language language, QLocale::Script script, |
| 1153 | QLocale::Territory territory); |
| 1154 | #if QT_DEPRECATED_SINCE(6, 6) |
| 1155 | QT_DEPRECATED_VERSION_X_6_6("Query territory() on each entry from matchingLocales() instead" ) |
| 1156 | static QList<Country> countriesForLanguage(Language lang); |
| 1157 | #endif |
| 1158 | |
| 1159 | void setNumberOptions(NumberOptions options); |
| 1160 | NumberOptions numberOptions() const; |
| 1161 | |
| 1162 | enum QuotationStyle { StandardQuotation, AlternateQuotation }; |
| 1163 | Q_ENUM(QuotationStyle) |
| 1164 | QString quoteString(const QString &str, QuotationStyle style = StandardQuotation) const |
| 1165 | { return quoteString(str: QStringView(str), style); } |
| 1166 | QString quoteString(QStringView str, QuotationStyle style = StandardQuotation) const; |
| 1167 | |
| 1168 | QString createSeparatedList(const QStringList &strl) const; |
| 1169 | |
| 1170 | private: |
| 1171 | QLocale(QLocalePrivate &dd); |
| 1172 | bool equals(const QLocale &other) const noexcept; |
| 1173 | friend class QLocalePrivate; |
| 1174 | friend class QSystemLocale; |
| 1175 | friend class QCalendarBackend; |
| 1176 | friend class QRomanCalendar; |
| 1177 | friend Q_CORE_EXPORT size_t qHash(const QLocale &key, size_t seed) noexcept; |
| 1178 | |
| 1179 | friend bool comparesEqual(const QLocale &lhs, const QLocale &rhs) noexcept |
| 1180 | { |
| 1181 | return lhs.equals(other: rhs); |
| 1182 | } |
| 1183 | Q_DECLARE_EQUALITY_COMPARABLE(QLocale) |
| 1184 | |
| 1185 | friend Q_CORE_EXPORT bool comparesEqual(const QLocale &lhs, Language rhs); |
| 1186 | Q_DECLARE_EQUALITY_COMPARABLE_NON_NOEXCEPT(QLocale, Language) |
| 1187 | |
| 1188 | QSharedDataPointer<QLocalePrivate> d; |
| 1189 | }; |
| 1190 | Q_DECLARE_SHARED(QLocale) |
| 1191 | Q_DECLARE_OPERATORS_FOR_FLAGS(QLocale::NumberOptions) |
| 1192 | Q_DECLARE_OPERATORS_FOR_FLAGS(QLocale::LanguageCodeTypes) |
| 1193 | |
| 1194 | #if QT_CORE_INLINE_IMPL_SINCE(6, 4) |
| 1195 | QLocale::QLocale(const QString &name) |
| 1196 | : QLocale(qToStringViewIgnoringNull(s: name)) {} |
| 1197 | #endif |
| 1198 | |
| 1199 | #ifndef QT_NO_DATASTREAM |
| 1200 | Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QLocale &); |
| 1201 | Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QLocale &); |
| 1202 | #endif |
| 1203 | |
| 1204 | #ifndef QT_NO_DEBUG_STREAM |
| 1205 | Q_CORE_EXPORT QDebug operator<<(QDebug, const QLocale &); |
| 1206 | #endif |
| 1207 | |
| 1208 | QT_END_NAMESPACE |
| 1209 | |
| 1210 | #endif // QLOCALE_H |
| 1211 | |