├── .editorconfig ├── .github └── workflows │ └── main.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── binding.gyp ├── config.gypi ├── icuWrapper.cpp ├── index.js ├── package-lock.json ├── package.json ├── test ├── fixtures │ └── utf-8.txt └── index.js └── vendor └── icu ├── common ├── appendable.cpp ├── bmpset.cpp ├── bmpset.h ├── brkeng.cpp ├── brkeng.h ├── brkiter.cpp ├── bytesinkutil.cpp ├── bytesinkutil.h ├── bytestream.cpp ├── bytestrie.cpp ├── bytestriebuilder.cpp ├── bytestrieiterator.cpp ├── caniter.cpp ├── capi_helper.h ├── characterproperties.cpp ├── chariter.cpp ├── charstr.cpp ├── charstr.h ├── cmemory.cpp ├── cmemory.h ├── common.rc ├── cpputils.h ├── cstr.cpp ├── cstr.h ├── cstring.cpp ├── cstring.h ├── cwchar.cpp ├── cwchar.h ├── dictbe.cpp ├── dictbe.h ├── dictionarydata.cpp ├── dictionarydata.h ├── dtintrv.cpp ├── edits.cpp ├── errorcode.cpp ├── filteredbrk.cpp ├── filterednormalizer2.cpp ├── hash.h ├── icudataver.cpp ├── icuplug.cpp ├── icuplugimp.h ├── loadednormalizer2impl.cpp ├── localebuilder.cpp ├── localsvc.h ├── locavailable.cpp ├── locbased.cpp ├── locbased.h ├── locdispnames.cpp ├── locdspnm.cpp ├── locid.cpp ├── loclikely.cpp ├── locmap.cpp ├── locmap.h ├── locresdata.cpp ├── locutil.cpp ├── locutil.h ├── messageimpl.h ├── messagepattern.cpp ├── msvcres.h ├── mutex.h ├── norm2_nfc_data.h ├── norm2allmodes.h ├── normalizer2.cpp ├── normalizer2impl.cpp ├── normalizer2impl.h ├── normlzr.cpp ├── parsepos.cpp ├── patternprops.cpp ├── patternprops.h ├── pluralmap.cpp ├── pluralmap.h ├── propname.cpp ├── propname.h ├── propname_data.h ├── propsvec.cpp ├── propsvec.h ├── punycode.cpp ├── punycode.h ├── putil.cpp ├── putilimp.h ├── rbbi.cpp ├── rbbi_cache.cpp ├── rbbi_cache.h ├── rbbicst.pl ├── rbbidata.cpp ├── rbbidata.h ├── rbbinode.cpp ├── rbbinode.h ├── rbbirb.cpp ├── rbbirb.h ├── rbbirpt.h ├── rbbiscan.cpp ├── rbbiscan.h ├── rbbisetb.cpp ├── rbbisetb.h ├── rbbistbl.cpp ├── rbbitblb.cpp ├── rbbitblb.h ├── resbund.cpp ├── resbund_cnv.cpp ├── resource.cpp ├── resource.h ├── ruleiter.cpp ├── ruleiter.h ├── schriter.cpp ├── serv.cpp ├── serv.h ├── servlk.cpp ├── servlkf.cpp ├── servloc.h ├── servls.cpp ├── servnotf.cpp ├── servnotf.h ├── servrbf.cpp ├── servslkf.cpp ├── sharedobject.cpp ├── sharedobject.h ├── simpleformatter.cpp ├── sprpimpl.h ├── static_unicode_sets.cpp ├── static_unicode_sets.h ├── stringpiece.cpp ├── stringtriebuilder.cpp ├── uarrsort.cpp ├── uarrsort.h ├── uassert.h ├── ubidi.cpp ├── ubidi_props.cpp ├── ubidi_props.h ├── ubidi_props_data.h ├── ubidiimp.h ├── ubidiln.cpp ├── ubiditransform.cpp ├── ubidiwrt.cpp ├── ubrk.cpp ├── ubrkimpl.h ├── ucase.cpp ├── ucase.h ├── ucase_props_data.h ├── ucasemap.cpp ├── ucasemap_imp.h ├── ucasemap_titlecase_brkiter.cpp ├── ucat.cpp ├── uchar.cpp ├── uchar_props_data.h ├── ucharstrie.cpp ├── ucharstriebuilder.cpp ├── ucharstrieiterator.cpp ├── uchriter.cpp ├── ucln.h ├── ucln_cmn.cpp ├── ucln_cmn.h ├── ucln_imp.h ├── ucmndata.cpp ├── ucmndata.h ├── ucnv.cpp ├── ucnv2022.cpp ├── ucnv_bld.cpp ├── ucnv_bld.h ├── ucnv_cb.cpp ├── ucnv_cnv.cpp ├── ucnv_cnv.h ├── ucnv_ct.cpp ├── ucnv_err.cpp ├── ucnv_ext.cpp ├── ucnv_ext.h ├── ucnv_imp.h ├── ucnv_io.cpp ├── ucnv_io.h ├── ucnv_lmb.cpp ├── ucnv_set.cpp ├── ucnv_u16.cpp ├── ucnv_u32.cpp ├── ucnv_u7.cpp ├── ucnv_u8.cpp ├── ucnvbocu.cpp ├── ucnvdisp.cpp ├── ucnvhz.cpp ├── ucnvisci.cpp ├── ucnvlat1.cpp ├── ucnvmbcs.cpp ├── ucnvmbcs.h ├── ucnvscsu.cpp ├── ucnvsel.cpp ├── ucol_data.h ├── ucol_swp.cpp ├── ucol_swp.h ├── ucptrie.cpp ├── ucptrie_impl.h ├── ucurr.cpp ├── ucurrimp.h ├── udata.cpp ├── udatamem.cpp ├── udatamem.h ├── udataswp.cpp ├── udataswp.h ├── uelement.h ├── uenum.cpp ├── uenumimp.h ├── uhash.cpp ├── uhash.h ├── uhash_us.cpp ├── uidna.cpp ├── uinit.cpp ├── uinvchar.cpp ├── uinvchar.h ├── uiter.cpp ├── ulayout_props.h ├── ulist.cpp ├── ulist.h ├── uloc.cpp ├── uloc_keytype.cpp ├── uloc_tag.cpp ├── ulocimp.h ├── umapfile.cpp ├── umapfile.h ├── umath.cpp ├── umutablecptrie.cpp ├── umutex.cpp ├── umutex.h ├── unames.cpp ├── unicode │ ├── appendable.h │ ├── brkiter.h │ ├── bytestream.h │ ├── bytestrie.h │ ├── bytestriebuilder.h │ ├── caniter.h │ ├── casemap.h │ ├── char16ptr.h │ ├── chariter.h │ ├── dbbi.h │ ├── docmain.h │ ├── dtintrv.h │ ├── edits.h │ ├── enumset.h │ ├── errorcode.h │ ├── filteredbrk.h │ ├── icudataver.h │ ├── icuplug.h │ ├── idna.h │ ├── localebuilder.h │ ├── localpointer.h │ ├── locdspnm.h │ ├── locid.h │ ├── messagepattern.h │ ├── normalizer2.h │ ├── normlzr.h │ ├── parseerr.h │ ├── parsepos.h │ ├── platform.h │ ├── ptypes.h │ ├── putil.h │ ├── rbbi.h │ ├── rep.h │ ├── resbund.h │ ├── schriter.h │ ├── simpleformatter.h │ ├── std_string.h │ ├── strenum.h │ ├── stringoptions.h │ ├── stringpiece.h │ ├── stringtriebuilder.h │ ├── symtable.h │ ├── ubidi.h │ ├── ubiditransform.h │ ├── ubrk.h │ ├── ucasemap.h │ ├── ucat.h │ ├── uchar.h │ ├── ucharstrie.h │ ├── ucharstriebuilder.h │ ├── uchriter.h │ ├── uclean.h │ ├── ucnv.h │ ├── ucnv_cb.h │ ├── ucnv_err.h │ ├── ucnvsel.h │ ├── uconfig.h │ ├── ucpmap.h │ ├── ucptrie.h │ ├── ucurr.h │ ├── udata.h │ ├── udisplaycontext.h │ ├── uenum.h │ ├── uidna.h │ ├── uiter.h │ ├── uldnames.h │ ├── uloc.h │ ├── umachine.h │ ├── umisc.h │ ├── umutablecptrie.h │ ├── unifilt.h │ ├── unifunct.h │ ├── unimatch.h │ ├── uniset.h │ ├── unistr.h │ ├── unorm.h │ ├── unorm2.h │ ├── uobject.h │ ├── urename.h │ ├── urep.h │ ├── ures.h │ ├── uscript.h │ ├── uset.h │ ├── usetiter.h │ ├── ushape.h │ ├── usprep.h │ ├── ustring.h │ ├── ustringtrie.h │ ├── utext.h │ ├── utf.h │ ├── utf16.h │ ├── utf32.h │ ├── utf8.h │ ├── utf_old.h │ ├── utrace.h │ ├── utypes.h │ ├── uvernum.h │ └── uversion.h ├── unifiedcache.cpp ├── unifiedcache.h ├── unifilt.cpp ├── unifunct.cpp ├── uniset.cpp ├── uniset_closure.cpp ├── uniset_props.cpp ├── unisetspan.cpp ├── unisetspan.h ├── unistr.cpp ├── unistr_case.cpp ├── unistr_case_locale.cpp ├── unistr_cnv.cpp ├── unistr_props.cpp ├── unistr_titlecase_brkiter.cpp ├── unistrappender.h ├── unorm.cpp ├── unormcmp.cpp ├── unormimp.h ├── uobject.cpp ├── uposixdefs.h ├── uprops.cpp ├── uprops.h ├── ures_cnv.cpp ├── uresbund.cpp ├── uresdata.cpp ├── uresdata.h ├── uresimp.h ├── ureslocs.h ├── usc_impl.cpp ├── usc_impl.h ├── uscript.cpp ├── uscript_props.cpp ├── uset.cpp ├── uset_imp.h ├── uset_props.cpp ├── usetiter.cpp ├── ushape.cpp ├── usprep.cpp ├── ustack.cpp ├── ustr_cnv.cpp ├── ustr_cnv.h ├── ustr_imp.h ├── ustr_titlecase_brkiter.cpp ├── ustr_wcs.cpp ├── ustrcase.cpp ├── ustrcase_locale.cpp ├── ustrenum.cpp ├── ustrenum.h ├── ustrfmt.cpp ├── ustrfmt.h ├── ustring.cpp ├── ustrtrns.cpp ├── utext.cpp ├── utf_impl.cpp ├── util.cpp ├── util.h ├── util_props.cpp ├── utrace.cpp ├── utracimp.h ├── utrie.cpp ├── utrie.h ├── utrie2.cpp ├── utrie2.h ├── utrie2_builder.cpp ├── utrie2_impl.h ├── utrie_swap.cpp ├── uts46.cpp ├── utypeinfo.h ├── utypes.cpp ├── uvector.cpp ├── uvector.h ├── uvectr32.cpp ├── uvectr32.h ├── uvectr64.cpp ├── uvectr64.h ├── wintz.cpp └── wintz.h ├── data └── in │ └── icudt64l.dat ├── i18n ├── alphaindex.cpp ├── anytrans.cpp ├── anytrans.h ├── astro.cpp ├── astro.h ├── basictz.cpp ├── bocsu.cpp ├── bocsu.h ├── brktrans.cpp ├── brktrans.h ├── buddhcal.cpp ├── buddhcal.h ├── calendar.cpp ├── casetrn.cpp ├── casetrn.h ├── cecal.cpp ├── cecal.h ├── chnsecal.cpp ├── chnsecal.h ├── choicfmt.cpp ├── coleitr.cpp ├── coll.cpp ├── collation.cpp ├── collation.h ├── collationbuilder.cpp ├── collationbuilder.h ├── collationcompare.cpp ├── collationcompare.h ├── collationdata.cpp ├── collationdata.h ├── collationdatabuilder.cpp ├── collationdatabuilder.h ├── collationdatareader.cpp ├── collationdatareader.h ├── collationdatawriter.cpp ├── collationdatawriter.h ├── collationfastlatin.cpp ├── collationfastlatin.h ├── collationfastlatinbuilder.cpp ├── collationfastlatinbuilder.h ├── collationfcd.cpp ├── collationfcd.h ├── collationiterator.cpp ├── collationiterator.h ├── collationkeys.cpp ├── collationkeys.h ├── collationroot.cpp ├── collationroot.h ├── collationrootelements.cpp ├── collationrootelements.h ├── collationruleparser.cpp ├── collationruleparser.h ├── collationsets.cpp ├── collationsets.h ├── collationsettings.cpp ├── collationsettings.h ├── collationtailoring.cpp ├── collationtailoring.h ├── collationweights.cpp ├── collationweights.h ├── collunsafe.h ├── compactdecimalformat.cpp ├── coptccal.cpp ├── coptccal.h ├── cpdtrans.cpp ├── cpdtrans.h ├── csdetect.cpp ├── csdetect.h ├── csmatch.cpp ├── csmatch.h ├── csr2022.cpp ├── csr2022.h ├── csrecog.cpp ├── csrecog.h ├── csrmbcs.cpp ├── csrmbcs.h ├── csrsbcs.cpp ├── csrsbcs.h ├── csrucode.cpp ├── csrucode.h ├── csrutf8.cpp ├── csrutf8.h ├── curramt.cpp ├── currfmt.cpp ├── currfmt.h ├── currpinf.cpp ├── currunit.cpp ├── dangical.cpp ├── dangical.h ├── datefmt.cpp ├── dayperiodrules.cpp ├── dayperiodrules.h ├── dcfmtsym.cpp ├── decContext.cpp ├── decContext.h ├── decNumber.cpp ├── decNumber.h ├── decNumberLocal.h ├── decimfmt.cpp ├── double-conversion-bignum-dtoa.cpp ├── double-conversion-bignum-dtoa.h ├── double-conversion-bignum.cpp ├── double-conversion-bignum.h ├── double-conversion-cached-powers.cpp ├── double-conversion-cached-powers.h ├── double-conversion-diy-fp.cpp ├── double-conversion-diy-fp.h ├── double-conversion-fast-dtoa.cpp ├── double-conversion-fast-dtoa.h ├── double-conversion-ieee.h ├── double-conversion-strtod.cpp ├── double-conversion-strtod.h ├── double-conversion-utils.h ├── double-conversion.cpp ├── double-conversion.h ├── dt_impl.h ├── dtfmtsym.cpp ├── dtitv_impl.h ├── dtitvfmt.cpp ├── dtitvinf.cpp ├── dtptngen.cpp ├── dtptngen_impl.h ├── dtrule.cpp ├── erarules.cpp ├── erarules.h ├── esctrn.cpp ├── esctrn.h ├── ethpccal.cpp ├── ethpccal.h ├── fmtable.cpp ├── fmtable_cnv.cpp ├── fmtableimp.h ├── format.cpp ├── formattedval_impl.h ├── formattedval_iterimpl.cpp ├── formattedval_sbimpl.cpp ├── formattedvalue.cpp ├── fphdlimp.cpp ├── fphdlimp.h ├── fpositer.cpp ├── funcrepl.cpp ├── funcrepl.h ├── gender.cpp ├── gregocal.cpp ├── gregoimp.cpp ├── gregoimp.h ├── hebrwcal.cpp ├── hebrwcal.h ├── i18n.rc ├── indiancal.cpp ├── indiancal.h ├── inputext.cpp ├── inputext.h ├── islamcal.cpp ├── islamcal.h ├── japancal.cpp ├── japancal.h ├── listformatter.cpp ├── measfmt.cpp ├── measunit.cpp ├── measure.cpp ├── msgfmt.cpp ├── msgfmt_impl.h ├── name2uni.cpp ├── name2uni.h ├── nfrlist.h ├── nfrs.cpp ├── nfrs.h ├── nfrule.cpp ├── nfrule.h ├── nfsubs.cpp ├── nfsubs.h ├── nortrans.cpp ├── nortrans.h ├── nounit.cpp ├── nultrans.cpp ├── nultrans.h ├── number_affixutils.cpp ├── number_affixutils.h ├── number_asformat.cpp ├── number_asformat.h ├── number_capi.cpp ├── number_compact.cpp ├── number_compact.h ├── number_currencysymbols.cpp ├── number_currencysymbols.h ├── number_decimalquantity.cpp ├── number_decimalquantity.h ├── number_decimfmtprops.cpp ├── number_decimfmtprops.h ├── number_decnum.h ├── number_fluent.cpp ├── number_formatimpl.cpp ├── number_formatimpl.h ├── number_grouping.cpp ├── number_integerwidth.cpp ├── number_longnames.cpp ├── number_longnames.h ├── number_mapper.cpp ├── number_mapper.h ├── number_microprops.h ├── number_modifiers.cpp ├── number_modifiers.h ├── number_multiplier.cpp ├── number_multiplier.h ├── number_notation.cpp ├── number_output.cpp ├── number_padding.cpp ├── number_patternmodifier.cpp ├── number_patternmodifier.h ├── number_patternstring.cpp ├── number_patternstring.h ├── number_rounding.cpp ├── number_roundingutils.h ├── number_scientific.cpp ├── number_scientific.h ├── number_skeletons.cpp ├── number_skeletons.h ├── number_stringbuilder.cpp ├── number_stringbuilder.h ├── number_types.h ├── number_utils.cpp ├── number_utils.h ├── number_utypes.h ├── numfmt.cpp ├── numparse_affixes.cpp ├── numparse_affixes.h ├── numparse_compositions.cpp ├── numparse_compositions.h ├── numparse_currency.cpp ├── numparse_currency.h ├── numparse_decimal.cpp ├── numparse_decimal.h ├── numparse_impl.cpp ├── numparse_impl.h ├── numparse_parsednumber.cpp ├── numparse_scientific.cpp ├── numparse_scientific.h ├── numparse_stringsegment.cpp ├── numparse_stringsegment.h ├── numparse_symbols.cpp ├── numparse_symbols.h ├── numparse_types.h ├── numparse_utils.h ├── numparse_validators.cpp ├── numparse_validators.h ├── numrange_fluent.cpp ├── numrange_impl.cpp ├── numrange_impl.h ├── numsys.cpp ├── numsys_impl.h ├── olsontz.cpp ├── olsontz.h ├── persncal.cpp ├── persncal.h ├── plurfmt.cpp ├── plurrule.cpp ├── plurrule_impl.h ├── quant.cpp ├── quant.h ├── quantityformatter.cpp ├── quantityformatter.h ├── rbnf.cpp ├── rbt.cpp ├── rbt.h ├── rbt_data.cpp ├── rbt_data.h ├── rbt_pars.cpp ├── rbt_pars.h ├── rbt_rule.cpp ├── rbt_rule.h ├── rbt_set.cpp ├── rbt_set.h ├── rbtz.cpp ├── regexcmp.cpp ├── regexcmp.h ├── regexcst.h ├── regexcst.pl ├── regeximp.cpp ├── regeximp.h ├── regexst.cpp ├── regexst.h ├── regextxt.cpp ├── regextxt.h ├── region.cpp ├── region_impl.h ├── reldatefmt.cpp ├── reldtfmt.cpp ├── reldtfmt.h ├── rematch.cpp ├── remtrans.cpp ├── remtrans.h ├── repattrn.cpp ├── rulebasedcollator.cpp ├── scientificnumberformatter.cpp ├── scriptset.cpp ├── scriptset.h ├── search.cpp ├── selfmt.cpp ├── selfmtimpl.h ├── sharedbreakiterator.cpp ├── sharedbreakiterator.h ├── sharedcalendar.h ├── shareddateformatsymbols.h ├── sharednumberformat.h ├── sharedpluralrules.h ├── simpletz.cpp ├── smpdtfmt.cpp ├── smpdtfst.cpp ├── smpdtfst.h ├── sortkey.cpp ├── standardplural.cpp ├── standardplural.h ├── strmatch.cpp ├── strmatch.h ├── strrepl.cpp ├── strrepl.h ├── stsearch.cpp ├── taiwncal.cpp ├── taiwncal.h ├── timezone.cpp ├── titletrn.cpp ├── titletrn.h ├── tmunit.cpp ├── tmutamt.cpp ├── tmutfmt.cpp ├── tolowtrn.cpp ├── tolowtrn.h ├── toupptrn.cpp ├── toupptrn.h ├── translit.cpp ├── transreg.cpp ├── transreg.h ├── tridpars.cpp ├── tridpars.h ├── tzfmt.cpp ├── tzgnames.cpp ├── tzgnames.h ├── tznames.cpp ├── tznames_impl.cpp ├── tznames_impl.h ├── tzrule.cpp ├── tztrans.cpp ├── ucal.cpp ├── ucln_in.cpp ├── ucln_in.h ├── ucol.cpp ├── ucol_imp.h ├── ucol_res.cpp ├── ucol_sit.cpp ├── ucoleitr.cpp ├── ucsdet.cpp ├── udat.cpp ├── udateintervalformat.cpp ├── udatpg.cpp ├── ufieldpositer.cpp ├── uitercollationiterator.cpp ├── uitercollationiterator.h ├── ulistformatter.cpp ├── ulocdata.cpp ├── umsg.cpp ├── umsg_imp.h ├── unesctrn.cpp ├── unesctrn.h ├── uni2name.cpp ├── uni2name.h ├── unicode │ ├── alphaindex.h │ ├── basictz.h │ ├── calendar.h │ ├── choicfmt.h │ ├── coleitr.h │ ├── coll.h │ ├── compactdecimalformat.h │ ├── curramt.h │ ├── currpinf.h │ ├── currunit.h │ ├── datefmt.h │ ├── dcfmtsym.h │ ├── decimfmt.h │ ├── dtfmtsym.h │ ├── dtitvfmt.h │ ├── dtitvinf.h │ ├── dtptngen.h │ ├── dtrule.h │ ├── fieldpos.h │ ├── fmtable.h │ ├── format.h │ ├── formattedvalue.h │ ├── fpositer.h │ ├── gender.h │ ├── gregocal.h │ ├── listformatter.h │ ├── measfmt.h │ ├── measunit.h │ ├── measure.h │ ├── msgfmt.h │ ├── nounit.h │ ├── numberformatter.h │ ├── numberrangeformatter.h │ ├── numfmt.h │ ├── numsys.h │ ├── plurfmt.h │ ├── plurrule.h │ ├── rbnf.h │ ├── rbtz.h │ ├── regex.h │ ├── region.h │ ├── reldatefmt.h │ ├── scientificnumberformatter.h │ ├── search.h │ ├── selfmt.h │ ├── simpletz.h │ ├── smpdtfmt.h │ ├── sortkey.h │ ├── stsearch.h │ ├── tblcoll.h │ ├── timezone.h │ ├── tmunit.h │ ├── tmutamt.h │ ├── tmutfmt.h │ ├── translit.h │ ├── tzfmt.h │ ├── tznames.h │ ├── tzrule.h │ ├── tztrans.h │ ├── ucal.h │ ├── ucol.h │ ├── ucoleitr.h │ ├── ucsdet.h │ ├── udat.h │ ├── udateintervalformat.h │ ├── udatpg.h │ ├── ufieldpositer.h │ ├── uformattable.h │ ├── uformattedvalue.h │ ├── ugender.h │ ├── ulistformatter.h │ ├── ulocdata.h │ ├── umsg.h │ ├── unirepl.h │ ├── unum.h │ ├── unumberformatter.h │ ├── unumsys.h │ ├── upluralrules.h │ ├── uregex.h │ ├── uregion.h │ ├── ureldatefmt.h │ ├── usearch.h │ ├── uspoof.h │ ├── utmscale.h │ ├── utrans.h │ └── vtzone.h ├── unum.cpp ├── unumsys.cpp ├── upluralrules.cpp ├── uregex.cpp ├── uregexc.cpp ├── uregion.cpp ├── usearch.cpp ├── uspoof.cpp ├── uspoof_build.cpp ├── uspoof_conf.cpp ├── uspoof_conf.h ├── uspoof_impl.cpp ├── uspoof_impl.h ├── usrchimp.h ├── utf16collationiterator.cpp ├── utf16collationiterator.h ├── utf8collationiterator.cpp ├── utf8collationiterator.h ├── utmscale.cpp ├── utrans.cpp ├── vtzone.cpp ├── vzone.cpp ├── vzone.h ├── windtfmt.cpp ├── windtfmt.h ├── winnmfmt.cpp ├── winnmfmt.h ├── wintzimpl.cpp ├── wintzimpl.h ├── zonemeta.cpp ├── zonemeta.h ├── zrule.cpp ├── zrule.h ├── ztrans.cpp └── ztrans.h ├── icu.gyp ├── icu_config.gypi ├── icu_small.json ├── stubdata └── stubdata.cpp └── tools ├── escapesrc ├── cptbl.h ├── escapesrc.cpp ├── expect-simple.cpp ├── tblgen.cpp ├── test-nochange.cpp └── test-simple.cpp ├── genccode └── genccode.c ├── gencmn └── gencmn.c ├── genrb ├── derb.cpp ├── errmsg.c ├── errmsg.h ├── filterrb.cpp ├── filterrb.h ├── genrb.cpp ├── genrb.h ├── parse.cpp ├── parse.h ├── prscmnts.cpp ├── prscmnts.h ├── rbutil.c ├── rbutil.h ├── read.c ├── read.h ├── reslist.cpp ├── reslist.h ├── rle.c ├── rle.h ├── ustr.c ├── ustr.h ├── wrtjava.cpp └── wrtxml.cpp ├── icupkg └── icupkg.cpp ├── pkgdata ├── pkgdata.cpp ├── pkgtypes.c └── pkgtypes.h └── toolutil ├── collationinfo.cpp ├── collationinfo.h ├── dbgutil.cpp ├── dbgutil.h ├── denseranges.cpp ├── denseranges.h ├── filestrm.cpp ├── filestrm.h ├── filetools.cpp ├── filetools.h ├── flagparser.cpp ├── flagparser.h ├── package.cpp ├── package.h ├── pkg_genc.cpp ├── pkg_genc.h ├── pkg_gencmn.cpp ├── pkg_gencmn.h ├── pkg_icu.cpp ├── pkg_icu.h ├── pkg_imp.h ├── pkgitems.cpp ├── ppucd.cpp ├── ppucd.h ├── swapimpl.cpp ├── swapimpl.h ├── toolutil.cpp ├── toolutil.h ├── ucbuf.cpp ├── ucbuf.h ├── ucln_tu.cpp ├── ucm.cpp ├── ucm.h ├── ucmstate.cpp ├── udbgutil.cpp ├── udbgutil.h ├── unewdata.cpp ├── unewdata.h ├── uoptions.cpp ├── uoptions.h ├── uparse.cpp ├── uparse.h ├── writesrc.cpp ├── writesrc.h ├── xmlparser.cpp └── xmlparser.h /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | end_of_line = lf 6 | insert_final_newline = true 7 | 8 | [*.{js,h,c,cpp}] 9 | indent_style = tab 10 | 11 | [*.{md,yml}] 12 | indent_style = space 13 | indent_size = 2 14 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | - push 4 | - pull_request 5 | jobs: 6 | test: 7 | name: ${{ matrix.container }}, Node.js ${{ matrix.node-version }} 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v4 11 | - uses: actions/setup-node@v4 12 | with: 13 | node-version: ${{ matrix.node-version }} 14 | - run: apt-get update && apt-get --yes install build-essential python3 15 | - run: npm ci 16 | - run: npm test 17 | strategy: 18 | matrix: 19 | container: 20 | - debian:12 21 | - debian:11 22 | - debian:10 23 | - ubuntu:22.04 24 | - ubuntu:20.04 25 | node-version: 26 | - 20 27 | - 18 28 | fail-fast: false 29 | container: ${{ matrix.container }} 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | node_modules 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # detect-character-encoding 2 | 3 | > Detect character encoding using [ICU](http://site.icu-project.org) 4 | 5 | **Tip:** If you don’t need ICU in particular, consider using [ced](https://github.com/sonicdoe/ced), which is based on Google’s lighter [compact_enc_det](https://github.com/google/compact_enc_det) library. 6 | 7 | ## Installation 8 | 9 | ```console 10 | $ npm install detect-character-encoding 11 | ``` 12 | 13 | detect-character-encoding is a C++ addon. Therefore, you may need to install various build tools. Check [node-gyp’s readme](https://github.com/nodejs/node-gyp#installation) for more information. 14 | 15 | ## Usage 16 | 17 | ```js 18 | const fs = require('fs'); 19 | const detectCharacterEncoding = require('detect-character-encoding'); 20 | 21 | const fileBuffer = fs.readFileSync('file.txt'); 22 | const charsetMatch = detectCharacterEncoding(fileBuffer); 23 | 24 | console.log(charsetMatch); 25 | // { 26 | // encoding: 'UTF-8', 27 | // confidence: 60 28 | // } 29 | ``` 30 | 31 | detect-character-encoding may return `null` if no charset matches. 32 | 33 | ## Supported operating systems 34 | 35 | - macOS Sonoma 36 | - Ubuntu 22.04 and 20.04 37 | - Debian 12, 11, and 10 38 | 39 | detect-character-encoding does not support 32-bit operating systems. 40 | 41 | ## Supported character sets 42 | 43 | As listed in [ICU’s user guide](http://userguide.icu-project.org/conversion/detection#TOC-Detected-Encodings): 44 | 45 | - UTF-8 46 | - UTF-16BE 47 | - UTF-16LE 48 | - UTF-32BE 49 | - UTF-32LE 50 | - Shift_JIS 51 | - ISO-2022-JP 52 | - ISO-2022-CN 53 | - ISO-2022-KR 54 | - GB18030 55 | - Big5 56 | - EUC-JP 57 | - EUC-KR 58 | - ISO-8859-1 59 | - ISO-8859-2 60 | - ISO-8859-5 61 | - ISO-8859-6 62 | - ISO-8859-7 63 | - ISO-8859-8 64 | - ISO-8859-9 65 | - windows-1250 66 | - windows-1251 67 | - windows-1252 68 | - windows-1253 69 | - windows-1254 70 | - windows-1255 71 | - windows-1256 72 | - KOI8-R 73 | - IBM420 74 | - IBM424 75 | 76 | ## License 77 | 78 | detect-character-encoding is licensed under the BSD 2-clause license but includes third-party software under different licenses. See [`LICENSE.md`](./LICENSE.md) for the full license text. 79 | -------------------------------------------------------------------------------- /binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [ 3 | { 4 | "target_name": "icuWrapper", 5 | "sources": ["icuWrapper.cpp"], 6 | "include_dirs": [ 7 | " 2 | #include 3 | 4 | #include 5 | 6 | NAN_METHOD(DetectCharacterEncoding) { 7 | Nan::HandleScope scope; 8 | 9 | v8::Local inputBuffer = 10 | Nan::To(info[0]).ToLocalChecked(); 11 | 12 | UCharsetDetector *charsetDetector; 13 | const UCharsetMatch *charsetMatch; 14 | UErrorCode errorCode = U_ZERO_ERROR; 15 | 16 | charsetDetector = ucsdet_open(&errorCode); 17 | 18 | if (U_FAILURE(errorCode)) { 19 | Nan::ThrowError("Failed to open ICU charset detector."); 20 | return; 21 | } 22 | 23 | ucsdet_setText(charsetDetector, node::Buffer::Data(inputBuffer), 24 | node::Buffer::Length(inputBuffer), &errorCode); 25 | 26 | if (U_FAILURE(errorCode)) { 27 | Nan::ThrowError("Failed to set ICU charset detector’s text."); 28 | ucsdet_close(charsetDetector); 29 | return; 30 | } 31 | 32 | charsetMatch = ucsdet_detect(charsetDetector, &errorCode); 33 | 34 | if (U_FAILURE(errorCode)) { 35 | Nan::ThrowError("Failed to detect charset."); 36 | ucsdet_close(charsetDetector); 37 | return; 38 | } 39 | 40 | if (charsetMatch == NULL) { 41 | info.GetReturnValue().Set(Nan::Null()); 42 | ucsdet_close(charsetDetector); 43 | return; 44 | } 45 | 46 | const char *charsetName = ucsdet_getName(charsetMatch, &errorCode); 47 | 48 | if (U_FAILURE(errorCode)) { 49 | Nan::ThrowError("Failed to get name from charset match."); 50 | ucsdet_close(charsetDetector); 51 | return; 52 | } 53 | 54 | int32_t confidence = ucsdet_getConfidence(charsetMatch, &errorCode); 55 | 56 | if (U_FAILURE(errorCode)) { 57 | Nan::ThrowError("Failed to get confidence from charset match."); 58 | ucsdet_close(charsetDetector); 59 | return; 60 | } 61 | 62 | v8::Local obj = Nan::New(); 63 | Nan::Set(obj, Nan::New("encoding").ToLocalChecked(), 64 | Nan::New(charsetName).ToLocalChecked()); 65 | Nan::Set(obj, Nan::New("confidence").ToLocalChecked(), 66 | Nan::New(confidence)); 67 | 68 | info.GetReturnValue().Set(obj); 69 | ucsdet_close(charsetDetector); 70 | } 71 | 72 | void Init(v8::Local exports, v8::Local module) { 73 | Nan::SetMethod(module, "exports", DetectCharacterEncoding); 74 | } 75 | 76 | NODE_MODULE(icuWrapper, Init); 77 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const bindings = require('bindings')('icuWrapper.node'); 4 | 5 | module.exports = buf => { 6 | if (!Buffer.isBuffer(buf)) { 7 | throw new TypeError('Argument to detect-character-encoding must be a buffer.'); 8 | } 9 | 10 | return bindings(buf); 11 | }; 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "detect-character-encoding", 3 | "version": "0.9.0", 4 | "author": "Jakob Krigovsky ", 5 | "description": "Detect character encoding using ICU", 6 | "repository": "sonicdoe/detect-character-encoding", 7 | "keywords": [ 8 | "detect", 9 | "character", 10 | "encoding", 11 | "charset", 12 | "icu" 13 | ], 14 | "license": "BSD-2-Clause", 15 | "files": [ 16 | "binding.gyp", 17 | "config.gypi", 18 | "icuWrapper.cpp", 19 | "index.js", 20 | "vendor/icu" 21 | ], 22 | "scripts": { 23 | "test": "clang-format --Wclang-format-violations --Werror --dry-run icuWrapper.cpp && xo && mocha" 24 | }, 25 | "dependencies": { 26 | "bindings": "^1.3.0", 27 | "nan": "^2.18.0" 28 | }, 29 | "devDependencies": { 30 | "clang-format": "^1.8.0", 31 | "mocha": "^10.2.0", 32 | "xo": "^0.28.0" 33 | }, 34 | "engines": { 35 | "node": ">=18" 36 | }, 37 | "xo": { 38 | "envs": [ 39 | "mocha" 40 | ] 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /test/fixtures/utf-8.txt: -------------------------------------------------------------------------------- 1 | ♠ ♥ ♦ ♣ 2 | -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const assert = require('assert'); 4 | const fs = require('fs'); 5 | const path = require('path'); 6 | 7 | const detectCharacterEncoding = require('..'); 8 | 9 | function getFixture(fixture) { 10 | return fs.readFileSync(path.join(__dirname, 'fixtures', fixture)); 11 | } 12 | 13 | it('should return the encoding', () => { 14 | assert.strictEqual(detectCharacterEncoding(getFixture('utf-8.txt')).encoding, 'UTF-8'); 15 | }); 16 | 17 | it('should return a confidence value', () => { 18 | assert(typeof detectCharacterEncoding(getFixture('utf-8.txt')).confidence === 'number'); 19 | }); 20 | 21 | it('should return null if no charset matches', () => { 22 | assert.strictEqual(detectCharacterEncoding(Buffer.from([0xAB])), null); 23 | }); 24 | 25 | it('should throw a TypeError if argument is not a buffer', () => { 26 | assert.throws(() => { 27 | detectCharacterEncoding('string'); 28 | }, TypeError); 29 | }); 30 | -------------------------------------------------------------------------------- /vendor/icu/common/appendable.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2011-2012, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ******************************************************************************* 8 | * file name: appendable.cpp 9 | * encoding: UTF-8 10 | * tab size: 8 (not used) 11 | * indentation:4 12 | * 13 | * created on: 2010dec07 14 | * created by: Markus W. Scherer 15 | */ 16 | 17 | #include "unicode/utypes.h" 18 | #include "unicode/appendable.h" 19 | #include "unicode/utf16.h" 20 | 21 | U_NAMESPACE_BEGIN 22 | 23 | Appendable::~Appendable() {} 24 | 25 | UBool 26 | Appendable::appendCodePoint(UChar32 c) { 27 | if(c<=0xffff) { 28 | return appendCodeUnit((UChar)c); 29 | } else { 30 | return appendCodeUnit(U16_LEAD(c)) && appendCodeUnit(U16_TRAIL(c)); 31 | } 32 | } 33 | 34 | UBool 35 | Appendable::appendString(const UChar *s, int32_t length) { 36 | if(length<0) { 37 | UChar c; 38 | while((c=*s++)!=0) { 39 | if(!appendCodeUnit(c)) { 40 | return FALSE; 41 | } 42 | } 43 | } else if(length>0) { 44 | const UChar *limit=s+length; 45 | do { 46 | if(!appendCodeUnit(*s++)) { 47 | return FALSE; 48 | } 49 | } while(s(NULL), static_cast(0)); 25 | int32_t resultCapacity = 0; 26 | char *buf = s.getAppendBuffer(length, length, resultCapacity, status); 27 | if (U_SUCCESS(status)) { 28 | in.extract(0, in.length(), buf, resultCapacity); 29 | s.append(buf, length, status); 30 | } 31 | #else 32 | // No conversion available. Convert any invariant characters; substitute '?' for the rest. 33 | // Note: can't just call u_UCharsToChars() or CharString.appendInvariantChars() on the 34 | // whole string because they require that the entire input be invariant. 35 | char buf[2]; 36 | for (int i=0; i 27 | #include 28 | #include "unicode/utypes.h" 29 | 30 | /* Do this after utypes.h so that we have U_HAVE_WCHAR_H . */ 31 | #if U_HAVE_WCHAR_H 32 | # include 33 | #endif 34 | 35 | /*===========================================================================*/ 36 | /* Wide-character functions */ 37 | /*===========================================================================*/ 38 | 39 | /* The following are not available on all systems, defined in wchar.h or string.h. */ 40 | #if U_HAVE_WCSCPY 41 | # define uprv_wcscpy wcscpy 42 | # define uprv_wcscat wcscat 43 | # define uprv_wcslen wcslen 44 | #else 45 | U_CAPI wchar_t* U_EXPORT2 46 | uprv_wcscpy(wchar_t *dst, const wchar_t *src); 47 | U_CAPI wchar_t* U_EXPORT2 48 | uprv_wcscat(wchar_t *dst, const wchar_t *src); 49 | U_CAPI size_t U_EXPORT2 50 | uprv_wcslen(const wchar_t *src); 51 | #endif 52 | 53 | /* The following are part of the ANSI C standard, defined in stdlib.h . */ 54 | #define uprv_wcstombs(mbstr, wcstr, count) U_STANDARD_CPP_NAMESPACE wcstombs(mbstr, wcstr, count) 55 | #define uprv_mbstowcs(wcstr, mbstr, count) U_STANDARD_CPP_NAMESPACE mbstowcs(wcstr, mbstr, count) 56 | 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /vendor/icu/common/dtintrv.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /******************************************************************************* 4 | * Copyright (C) 2008, International Business Machines Corporation and 5 | * others. All Rights Reserved. 6 | ******************************************************************************* 7 | * 8 | * File DTINTRV.CPP 9 | * 10 | ******************************************************************************* 11 | */ 12 | 13 | 14 | 15 | #include "unicode/dtintrv.h" 16 | 17 | 18 | U_NAMESPACE_BEGIN 19 | 20 | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(DateInterval) 21 | 22 | //DateInterval::DateInterval(){} 23 | 24 | 25 | DateInterval::DateInterval(UDate from, UDate to) 26 | : fromDate(from), 27 | toDate(to) 28 | {} 29 | 30 | 31 | DateInterval::~DateInterval(){} 32 | 33 | 34 | DateInterval::DateInterval(const DateInterval& other) 35 | : UObject(other) { 36 | *this = other; 37 | } 38 | 39 | 40 | DateInterval& 41 | DateInterval::operator=(const DateInterval& other) { 42 | if ( this != &other ) { 43 | fromDate = other.fromDate; 44 | toDate = other.toDate; 45 | } 46 | return *this; 47 | } 48 | 49 | 50 | DateInterval* 51 | DateInterval::clone() const { 52 | return new DateInterval(*this); 53 | } 54 | 55 | 56 | UBool 57 | DateInterval::operator==(const DateInterval& other) const { 58 | return ( fromDate == other.fromDate && toDate == other.toDate ); 59 | } 60 | 61 | 62 | U_NAMESPACE_END 63 | -------------------------------------------------------------------------------- /vendor/icu/common/errorcode.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 2009-2011, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * file name: errorcode.cpp 11 | * encoding: UTF-8 12 | * tab size: 8 (not used) 13 | * indentation:4 14 | * 15 | * created on: 2009mar10 16 | * created by: Markus W. Scherer 17 | */ 18 | 19 | #include "unicode/utypes.h" 20 | #include "unicode/errorcode.h" 21 | 22 | U_NAMESPACE_BEGIN 23 | 24 | ErrorCode::~ErrorCode() {} 25 | 26 | UErrorCode ErrorCode::reset() { 27 | UErrorCode code = errorCode; 28 | errorCode = U_ZERO_ERROR; 29 | return code; 30 | } 31 | 32 | void ErrorCode::assertSuccess() const { 33 | if(isFailure()) { 34 | handleFailure(); 35 | } 36 | } 37 | 38 | const char* ErrorCode::errorName() const { 39 | return u_errorName(errorCode); 40 | } 41 | 42 | U_NAMESPACE_END 43 | -------------------------------------------------------------------------------- /vendor/icu/common/icudataver.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * 6 | * Copyright (C) 2009-2011, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ****************************************************************************** 10 | */ 11 | 12 | #include "unicode/utypes.h" 13 | #include "unicode/icudataver.h" 14 | #include "unicode/ures.h" 15 | #include "uresimp.h" /* for ures_getVersionByKey */ 16 | 17 | U_CAPI void U_EXPORT2 u_getDataVersion(UVersionInfo dataVersionFillin, UErrorCode *status) { 18 | UResourceBundle *icudatares = NULL; 19 | 20 | if (U_FAILURE(*status)) { 21 | return; 22 | } 23 | 24 | if (dataVersionFillin != NULL) { 25 | icudatares = ures_openDirect(NULL, U_ICU_VERSION_BUNDLE , status); 26 | if (U_SUCCESS(*status)) { 27 | ures_getVersionByKey(icudatares, U_ICU_DATA_KEY, dataVersionFillin, status); 28 | } 29 | ures_close(icudatares); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/icu/common/icuplugimp.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * 6 | * Copyright (C) 2009-2015, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ****************************************************************************** 10 | * 11 | * FILE NAME : icuplugimp.h 12 | * 13 | * Internal functions for the ICU plugin system 14 | * 15 | * Date Name Description 16 | * 10/29/2009 sl New. 17 | ****************************************************************************** 18 | */ 19 | 20 | 21 | #ifndef ICUPLUGIMP_H 22 | #define ICUPLUGIMP_H 23 | 24 | #include "unicode/icuplug.h" 25 | 26 | #if UCONFIG_ENABLE_PLUGINS 27 | 28 | /*========================*/ 29 | /** @{ Library Manipulation 30 | */ 31 | 32 | /** 33 | * Open a library, adding a reference count if needed. 34 | * @param libName library name to load 35 | * @param status error code 36 | * @return the library pointer, or NULL 37 | * @internal internal use only 38 | */ 39 | U_INTERNAL void * U_EXPORT2 40 | uplug_openLibrary(const char *libName, UErrorCode *status); 41 | 42 | /** 43 | * Close a library, if its reference count is 0 44 | * @param lib the library to close 45 | * @param status error code 46 | * @internal internal use only 47 | */ 48 | U_INTERNAL void U_EXPORT2 49 | uplug_closeLibrary(void *lib, UErrorCode *status); 50 | 51 | /** 52 | * Get a library's name, or NULL if not found. 53 | * @param lib the library's name 54 | * @param status error code 55 | * @return the library name, or NULL if not found. 56 | * @internal internal use only 57 | */ 58 | U_INTERNAL char * U_EXPORT2 59 | uplug_findLibrary(void *lib, UErrorCode *status); 60 | 61 | /** @} */ 62 | 63 | /*========================*/ 64 | /** {@ ICU Plugin internal interfaces 65 | */ 66 | 67 | /** 68 | * Initialize the plugins 69 | * @param status error result 70 | * @internal - Internal use only. 71 | */ 72 | U_INTERNAL void U_EXPORT2 73 | uplug_init(UErrorCode *status); 74 | 75 | /** 76 | * Get raw plug N 77 | * @internal - Internal use only 78 | */ 79 | U_INTERNAL UPlugData* U_EXPORT2 80 | uplug_getPlugInternal(int32_t n); 81 | 82 | /** 83 | * Get the name of the plugin file. 84 | * @internal - Internal use only. 85 | */ 86 | U_INTERNAL const char* U_EXPORT2 87 | uplug_getPluginFile(void); 88 | 89 | /** @} */ 90 | 91 | #endif 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /vendor/icu/common/localsvc.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | *************************************************************************** 5 | * Copyright (C) 2006 International Business Machines Corporation * 6 | * and others. All rights reserved. * 7 | *************************************************************************** 8 | */ 9 | 10 | #ifndef LOCALSVC_H 11 | #define LOCALSVC_H 12 | 13 | #include "unicode/utypes.h" 14 | 15 | #if defined(U_LOCAL_SERVICE_HOOK) && U_LOCAL_SERVICE_HOOK 16 | /** 17 | * Prototype for user-supplied service hook. This function is expected to return 18 | * a type of factory object specific to the requested service. 19 | * 20 | * @param what service-specific string identifying the specific user hook 21 | * @param status error status 22 | * @return a service-specific hook, or NULL on failure. 23 | */ 24 | U_CAPI void* uprv_svc_hook(const char *what, UErrorCode *status); 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /vendor/icu/common/locbased.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (c) 2004-2014, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * Author: Alan Liu 9 | * Created: January 16 2004 10 | * Since: ICU 2.8 11 | ********************************************************************** 12 | */ 13 | #include "locbased.h" 14 | #include "cstring.h" 15 | 16 | U_NAMESPACE_BEGIN 17 | 18 | Locale LocaleBased::getLocale(ULocDataLocaleType type, UErrorCode& status) const { 19 | const char* id = getLocaleID(type, status); 20 | return Locale((id != 0) ? id : ""); 21 | } 22 | 23 | const char* LocaleBased::getLocaleID(ULocDataLocaleType type, UErrorCode& status) const { 24 | if (U_FAILURE(status)) { 25 | return NULL; 26 | } 27 | 28 | switch(type) { 29 | case ULOC_VALID_LOCALE: 30 | return valid; 31 | case ULOC_ACTUAL_LOCALE: 32 | return actual; 33 | default: 34 | status = U_ILLEGAL_ARGUMENT_ERROR; 35 | return NULL; 36 | } 37 | } 38 | 39 | void LocaleBased::setLocaleIDs(const char* validID, const char* actualID) { 40 | if (validID != 0) { 41 | uprv_strncpy(valid, validID, ULOC_FULLNAME_CAPACITY); 42 | valid[ULOC_FULLNAME_CAPACITY-1] = 0; // always terminate 43 | } 44 | if (actualID != 0) { 45 | uprv_strncpy(actual, actualID, ULOC_FULLNAME_CAPACITY); 46 | actual[ULOC_FULLNAME_CAPACITY-1] = 0; // always terminate 47 | } 48 | } 49 | 50 | void LocaleBased::setLocaleIDs(const Locale& validID, const Locale& actualID) { 51 | uprv_strcpy(valid, validID.getName()); 52 | uprv_strcpy(actual, actualID.getName()); 53 | } 54 | 55 | U_NAMESPACE_END 56 | -------------------------------------------------------------------------------- /vendor/icu/common/locmap.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * 6 | * Copyright (C) 1996-2013, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ****************************************************************************** 10 | * 11 | * File locmap.h : Locale Mapping Classes 12 | * 13 | * 14 | * Created by: Helena Shih 15 | * 16 | * Modification History: 17 | * 18 | * Date Name Description 19 | * 3/11/97 aliu Added setId(). 20 | * 4/20/99 Madhu Added T_convertToPosix() 21 | * 09/18/00 george Removed the memory leaks. 22 | * 08/23/01 george Convert to C 23 | *============================================================================ 24 | */ 25 | 26 | #ifndef LOCMAP_H 27 | #define LOCMAP_H 28 | 29 | #include "unicode/utypes.h" 30 | 31 | #define LANGUAGE_LCID(hostID) (uint16_t)(0x03FF & hostID) 32 | 33 | U_CAPI int32_t uprv_convertToPosix(uint32_t hostid, char* posixID, int32_t posixIDCapacity, UErrorCode* status); 34 | 35 | /* Don't call these functions directly. Use uloc_getLCID instead. */ 36 | U_CAPI uint32_t uprv_convertToLCIDPlatform(const char* localeID, UErrorCode* status); // Leverage platform conversion if possible 37 | U_CAPI uint32_t uprv_convertToLCID(const char* langID, const char* posixID, UErrorCode* status); 38 | 39 | #endif /* LOCMAP_H */ 40 | -------------------------------------------------------------------------------- /vendor/icu/common/locutil.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /** 4 | ******************************************************************************* 5 | * Copyright (C) 2002-2005, International Business Machines Corporation and * 6 | * others. All Rights Reserved. * 7 | ******************************************************************************* 8 | * 9 | ******************************************************************************* 10 | */ 11 | #ifndef LOCUTIL_H 12 | #define LOCUTIL_H 13 | 14 | #include "unicode/utypes.h" 15 | #include "hash.h" 16 | 17 | #if !UCONFIG_NO_SERVICE || !UCONFIG_NO_TRANSLITERATION 18 | 19 | 20 | U_NAMESPACE_BEGIN 21 | 22 | // temporary utility functions, till I know where to find them 23 | // in header so tests can also access them 24 | 25 | class U_COMMON_API LocaleUtility { 26 | public: 27 | static UnicodeString& canonicalLocaleString(const UnicodeString* id, UnicodeString& result); 28 | static Locale& initLocaleFromName(const UnicodeString& id, Locale& result); 29 | static UnicodeString& initNameFromLocale(const Locale& locale, UnicodeString& result); 30 | static const Hashtable* getAvailableLocaleNames(const UnicodeString& bundleID); 31 | static UBool isFallbackOf(const UnicodeString& root, const UnicodeString& child); 32 | }; 33 | 34 | U_NAMESPACE_END 35 | 36 | 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /vendor/icu/common/messageimpl.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2011, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ******************************************************************************* 8 | * file name: messageimpl.h 9 | * encoding: UTF-8 10 | * tab size: 8 (not used) 11 | * indentation:4 12 | * 13 | * created on: 2011apr04 14 | * created by: Markus W. Scherer 15 | */ 16 | 17 | #ifndef __MESSAGEIMPL_H__ 18 | #define __MESSAGEIMPL_H__ 19 | 20 | #include "unicode/utypes.h" 21 | 22 | #if !UCONFIG_NO_FORMATTING 23 | 24 | #include "unicode/messagepattern.h" 25 | 26 | U_NAMESPACE_BEGIN 27 | 28 | /** 29 | * Helper functions for use of MessagePattern. 30 | * In Java, these are package-private methods in MessagePattern itself. 31 | * In C++, they are declared here and implemented in messagepattern.cpp. 32 | */ 33 | class U_COMMON_API MessageImpl { 34 | public: 35 | /** 36 | * @return TRUE if getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED 37 | */ 38 | static UBool jdkAposMode(const MessagePattern &msgPattern) { 39 | return msgPattern.getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED; 40 | } 41 | 42 | /** 43 | * Appends the s[start, limit[ substring to sb, but with only half of the apostrophes 44 | * according to JDK pattern behavior. 45 | */ 46 | static void appendReducedApostrophes(const UnicodeString &s, int32_t start, int32_t limit, 47 | UnicodeString &sb); 48 | 49 | /** 50 | * Appends the sub-message to the result string. 51 | * Omits SKIP_SYNTAX and appends whole arguments using appendReducedApostrophes(). 52 | */ 53 | static UnicodeString &appendSubMessageWithoutSkipSyntax(const MessagePattern &msgPattern, 54 | int32_t msgStart, 55 | UnicodeString &result); 56 | 57 | private: 58 | MessageImpl(); // no constructor: all static methods 59 | }; 60 | 61 | U_NAMESPACE_END 62 | 63 | #endif // !UCONFIG_NO_FORMATTING 64 | 65 | #endif // __MESSAGEIMPL_H__ 66 | -------------------------------------------------------------------------------- /vendor/icu/common/msvcres.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | //{{NO_DEPENDENCIES}} 4 | // Copyright (c) 2003-2010 International Business Machines 5 | // Corporation and others. All Rights Reserved. 6 | // 7 | // Used by common.rc and other .rc files. 8 | //Do not edit with Microsoft Developer Studio because it will modify this 9 | //header the wrong way. This is here to prevent Visual Studio .NET from 10 | //unnessarily building the resource files when it's not needed. 11 | // 12 | 13 | /* 14 | These are defined before unicode/uversion.h in order to prevent 15 | STLPort's broken stddef.h from being used when rc.exe parses this file. 16 | */ 17 | #define _STLP_OUTERMOST_HEADER_ID 0 18 | #define _STLP_WINCE 1 19 | 20 | #include "unicode/uversion.h" 21 | 22 | #define ICU_WEBSITE "http://icu-project.org" 23 | #define ICU_COMPANY "The ICU Project" 24 | #define ICU_PRODUCT_PREFIX "ICU" 25 | #define ICU_PRODUCT "International Components for Unicode" 26 | -------------------------------------------------------------------------------- /vendor/icu/common/mutex.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * 6 | * Copyright (C) 1997-2013, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ****************************************************************************** 10 | */ 11 | //---------------------------------------------------------------------------- 12 | // File: mutex.h 13 | // 14 | // Lightweight C++ wrapper for umtx_ C mutex functions 15 | // 16 | // Author: Alan Liu 1/31/97 17 | // History: 18 | // 06/04/97 helena Updated setImplementation as per feedback from 5/21 drop. 19 | // 04/07/1999 srl refocused as a thin wrapper 20 | // 21 | //---------------------------------------------------------------------------- 22 | #ifndef MUTEX_H 23 | #define MUTEX_H 24 | 25 | #include "unicode/utypes.h" 26 | #include "unicode/uobject.h" 27 | #include "umutex.h" 28 | 29 | U_NAMESPACE_BEGIN 30 | 31 | //---------------------------------------------------------------------------- 32 | // Code within that accesses shared static or global data should 33 | // should instantiate a Mutex object while doing so. You should make your own 34 | // private mutex where possible. 35 | 36 | // For example: 37 | // 38 | // UMutex myMutex = U_MUTEX_INITIALIZER; 39 | // 40 | // void Function(int arg1, int arg2) 41 | // { 42 | // static Object* foo; // Shared read-write object 43 | // Mutex mutex(&myMutex); // or no args for the global lock 44 | // foo->Method(); 45 | // // When 'mutex' goes out of scope and gets destroyed here, the lock is released 46 | // } 47 | // 48 | // Note: Do NOT use the form 'Mutex mutex();' as that merely forward-declares a function 49 | // returning a Mutex. This is a common mistake which silently slips through the 50 | // compiler!! 51 | // 52 | 53 | class U_COMMON_API Mutex : public UMemory { 54 | public: 55 | inline Mutex(UMutex *mutex = NULL); 56 | inline ~Mutex(); 57 | 58 | private: 59 | UMutex *fMutex; 60 | 61 | Mutex(const Mutex &other); // forbid copying of this class 62 | Mutex &operator=(const Mutex &other); // forbid copying of this class 63 | }; 64 | 65 | inline Mutex::Mutex(UMutex *mutex) 66 | : fMutex(mutex) 67 | { 68 | umtx_lock(fMutex); 69 | } 70 | 71 | inline Mutex::~Mutex() 72 | { 73 | umtx_unlock(fMutex); 74 | } 75 | 76 | U_NAMESPACE_END 77 | 78 | #endif //_MUTEX_ 79 | //eof 80 | -------------------------------------------------------------------------------- /vendor/icu/common/parsepos.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2003-2003, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | */ 9 | 10 | #include "unicode/parsepos.h" 11 | 12 | U_NAMESPACE_BEGIN 13 | 14 | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ParsePosition) 15 | 16 | ParsePosition::~ParsePosition() {} 17 | 18 | ParsePosition * 19 | ParsePosition::clone() const { 20 | return new ParsePosition(*this); 21 | } 22 | 23 | U_NAMESPACE_END 24 | -------------------------------------------------------------------------------- /vendor/icu/common/pluralmap.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | * Copyright (C) 2015, International Business Machines Corporation and 5 | * others. All Rights Reserved. 6 | */ 7 | 8 | #include "unicode/unistr.h" 9 | #include "charstr.h" 10 | #include "cstring.h" 11 | #include "pluralmap.h" 12 | 13 | U_NAMESPACE_BEGIN 14 | 15 | static const char * const gPluralForms[] = { 16 | "other", "zero", "one", "two", "few", "many"}; 17 | 18 | PluralMapBase::Category 19 | PluralMapBase::toCategory(const char *pluralForm) { 20 | for (int32_t i = 0; i < UPRV_LENGTHOF(gPluralForms); ++i) { 21 | if (uprv_strcmp(pluralForm, gPluralForms[i]) == 0) { 22 | return static_cast(i); 23 | } 24 | } 25 | return NONE; 26 | } 27 | 28 | PluralMapBase::Category 29 | PluralMapBase::toCategory(const UnicodeString &pluralForm) { 30 | CharString cCategory; 31 | UErrorCode status = U_ZERO_ERROR; 32 | cCategory.appendInvariantChars(pluralForm, status); 33 | return U_FAILURE(status) ? NONE : toCategory(cCategory.data()); 34 | } 35 | 36 | const char *PluralMapBase::getCategoryName(Category c) { 37 | int32_t index = c; 38 | return (index < 0 || index >= UPRV_LENGTHOF(gPluralForms)) ? 39 | NULL : gPluralForms[index]; 40 | } 41 | 42 | 43 | U_NAMESPACE_END 44 | -------------------------------------------------------------------------------- /vendor/icu/common/resbund_cnv.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 1997-2006, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * file name: resbund_cnv.cpp 11 | * encoding: UTF-8 12 | * tab size: 8 (not used) 13 | * indentation:4 14 | * 15 | * created on: 2004aug25 16 | * created by: Markus W. Scherer 17 | * 18 | * Character conversion functions moved here from resbund.cpp 19 | */ 20 | 21 | #include "unicode/utypes.h" 22 | #include "unicode/resbund.h" 23 | #include "uinvchar.h" 24 | 25 | U_NAMESPACE_BEGIN 26 | 27 | ResourceBundle::ResourceBundle( const UnicodeString& path, 28 | const Locale& locale, 29 | UErrorCode& error) 30 | :UObject(), fLocale(NULL) 31 | { 32 | constructForLocale(path, locale, error); 33 | } 34 | 35 | ResourceBundle::ResourceBundle( const UnicodeString& path, 36 | UErrorCode& error) 37 | :UObject(), fLocale(NULL) 38 | { 39 | constructForLocale(path, Locale::getDefault(), error); 40 | } 41 | 42 | void 43 | ResourceBundle::constructForLocale(const UnicodeString& path, 44 | const Locale& locale, 45 | UErrorCode& error) 46 | { 47 | if (path.isEmpty()) { 48 | fResource = ures_open(NULL, locale.getName(), &error); 49 | } 50 | else { 51 | UnicodeString nullTerminatedPath(path); 52 | nullTerminatedPath.append((UChar)0); 53 | fResource = ures_openU(nullTerminatedPath.getBuffer(), locale.getName(), &error); 54 | } 55 | } 56 | 57 | U_NAMESPACE_END 58 | -------------------------------------------------------------------------------- /vendor/icu/common/resource.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2015-2016, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ******************************************************************************* 8 | * resource.cpp 9 | * 10 | * created on: 2015nov04 11 | * created by: Markus W. Scherer 12 | */ 13 | 14 | #include "resource.h" 15 | 16 | U_NAMESPACE_BEGIN 17 | 18 | ResourceValue::~ResourceValue() {} 19 | 20 | ResourceSink::~ResourceSink() {} 21 | 22 | U_NAMESPACE_END 23 | -------------------------------------------------------------------------------- /vendor/icu/common/sharedobject.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * Copyright (C) 2015, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ****************************************************************************** 8 | * sharedobject.cpp 9 | */ 10 | #include "sharedobject.h" 11 | #include "mutex.h" 12 | #include "uassert.h" 13 | #include "umutex.h" 14 | #include "unifiedcache.h" 15 | 16 | U_NAMESPACE_BEGIN 17 | 18 | SharedObject::~SharedObject() {} 19 | 20 | UnifiedCacheBase::~UnifiedCacheBase() {} 21 | 22 | void 23 | SharedObject::addRef() const { 24 | umtx_atomic_inc(&hardRefCount); 25 | } 26 | 27 | // removeRef Decrement the reference count and delete if it is zero. 28 | // Note that SharedObjects with a non-null cachePtr are owned by the 29 | // unified cache, and the cache will be responsible for the actual deletion. 30 | // The deletion could be as soon as immediately following the 31 | // update to the reference count, if another thread is running 32 | // a cache eviction cycle concurrently. 33 | // NO ACCESS TO *this PERMITTED AFTER REFERENCE COUNT == 0 for cached objects. 34 | // THE OBJECT MAY ALREADY BE GONE. 35 | void 36 | SharedObject::removeRef() const { 37 | const UnifiedCacheBase *cache = this->cachePtr; 38 | int32_t updatedRefCount = umtx_atomic_dec(&hardRefCount); 39 | U_ASSERT(updatedRefCount >= 0); 40 | if (updatedRefCount == 0) { 41 | if (cache) { 42 | cache->handleUnreferencedObject(); 43 | } else { 44 | delete this; 45 | } 46 | } 47 | } 48 | 49 | 50 | int32_t 51 | SharedObject::getRefCount() const { 52 | return umtx_loadAcquire(hardRefCount); 53 | } 54 | 55 | void 56 | SharedObject::deleteIfZeroRefCount() const { 57 | if (this->cachePtr == nullptr && getRefCount() == 0) { 58 | delete this; 59 | } 60 | } 61 | 62 | U_NAMESPACE_END 63 | -------------------------------------------------------------------------------- /vendor/icu/common/stringpiece.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | // Copyright (C) 2009-2013, International Business Machines 4 | // Corporation and others. All Rights Reserved. 5 | // 6 | // Copyright 2004 and onwards Google Inc. 7 | // 8 | // Author: wilsonh@google.com (Wilson Hsieh) 9 | // 10 | 11 | #include "unicode/utypes.h" 12 | #include "unicode/stringpiece.h" 13 | #include "cstring.h" 14 | #include "cmemory.h" 15 | 16 | U_NAMESPACE_BEGIN 17 | 18 | StringPiece::StringPiece(const char* str) 19 | : ptr_(str), length_((str == NULL) ? 0 : static_cast(uprv_strlen(str))) { } 20 | 21 | StringPiece::StringPiece(const StringPiece& x, int32_t pos) { 22 | if (pos < 0) { 23 | pos = 0; 24 | } else if (pos > x.length_) { 25 | pos = x.length_; 26 | } 27 | ptr_ = x.ptr_ + pos; 28 | length_ = x.length_ - pos; 29 | } 30 | 31 | StringPiece::StringPiece(const StringPiece& x, int32_t pos, int32_t len) { 32 | if (pos < 0) { 33 | pos = 0; 34 | } else if (pos > x.length_) { 35 | pos = x.length_; 36 | } 37 | if (len < 0) { 38 | len = 0; 39 | } else if (len > x.length_ - pos) { 40 | len = x.length_ - pos; 41 | } 42 | ptr_ = x.ptr_ + pos; 43 | length_ = len; 44 | } 45 | 46 | void StringPiece::set(const char* str) { 47 | ptr_ = str; 48 | if (str != NULL) 49 | length_ = static_cast(uprv_strlen(str)); 50 | else 51 | length_ = 0; 52 | } 53 | 54 | U_EXPORT UBool U_EXPORT2 55 | operator==(const StringPiece& x, const StringPiece& y) { 56 | int32_t len = x.size(); 57 | if (len != y.size()) { 58 | return false; 59 | } 60 | if (len == 0) { 61 | return true; 62 | } 63 | const char* p = x.data(); 64 | const char* p2 = y.data(); 65 | // Test last byte in case strings share large common prefix 66 | --len; 67 | if (p[len] != p2[len]) return false; 68 | // At this point we can, but don't have to, ignore the last byte. 69 | return uprv_memcmp(p, p2, len) == 0; 70 | } 71 | 72 | 73 | const int32_t StringPiece::npos = 0x7fffffff; 74 | 75 | U_NAMESPACE_END 76 | -------------------------------------------------------------------------------- /vendor/icu/common/uassert.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * 6 | * Copyright (C) 2002-2011, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ****************************************************************************** 10 | * 11 | * File uassert.h 12 | * 13 | * Contains the U_ASSERT and UPRV_UNREACHABLE macros 14 | * 15 | ****************************************************************************** 16 | */ 17 | #ifndef U_ASSERT_H 18 | #define U_ASSERT_H 19 | 20 | /* utypes.h is included to get the proper define for uint8_t */ 21 | #include "unicode/utypes.h" 22 | /* for abort */ 23 | #include 24 | 25 | /** 26 | * \def U_ASSERT 27 | * By default, U_ASSERT just wraps the C library assert macro. 28 | * By changing the definition here, the assert behavior for ICU can be changed 29 | * without affecting other non - ICU uses of the C library assert(). 30 | */ 31 | #if U_DEBUG 32 | # include 33 | # define U_ASSERT(exp) assert(exp) 34 | #else 35 | # define U_ASSERT(exp) 36 | #endif 37 | 38 | /** 39 | * \def UPRV_UNREACHABLE 40 | * This macro is used to unconditionally abort if unreachable code is ever executed. 41 | * @internal 42 | */ 43 | #if defined(UPRV_UNREACHABLE) 44 | // Use the predefined value. 45 | #else 46 | # define UPRV_UNREACHABLE abort() 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /vendor/icu/common/ubrkimpl.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2006, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | */ 9 | 10 | #ifndef UBRKIMPL_H 11 | #define UBRKIMPL_H 12 | 13 | #define U_ICUDATA_BRKITR U_ICUDATA_NAME U_TREE_SEPARATOR_STRING "brkitr" 14 | 15 | #endif /*UBRKIMPL_H*/ 16 | -------------------------------------------------------------------------------- /vendor/icu/common/ucat.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (c) 2003, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * Author: Alan Liu 9 | * Created: March 19 2003 10 | * Since: ICU 2.6 11 | ********************************************************************** 12 | */ 13 | #include "unicode/ucat.h" 14 | #include "unicode/ustring.h" 15 | #include "cstring.h" 16 | #include "uassert.h" 17 | 18 | /* Separator between set_num and msg_num */ 19 | static const char SEPARATOR = '%'; 20 | 21 | /* Maximum length of a set_num/msg_num key, incl. terminating zero. 22 | * Longest possible key is "-2147483648%-2147483648" */ 23 | #define MAX_KEY_LEN (24) 24 | 25 | /** 26 | * Fill in buffer with a set_num/msg_num key string, given the numeric 27 | * values. Numeric values must be >= 0. Buffer must be of length 28 | * MAX_KEY_LEN or more. 29 | */ 30 | static char* 31 | _catkey(char* buffer, int32_t set_num, int32_t msg_num) { 32 | int32_t i = 0; 33 | i = T_CString_integerToString(buffer, set_num, 10); 34 | buffer[i++] = SEPARATOR; 35 | T_CString_integerToString(buffer+i, msg_num, 10); 36 | return buffer; 37 | } 38 | 39 | U_CAPI u_nl_catd U_EXPORT2 40 | u_catopen(const char* name, const char* locale, UErrorCode* ec) { 41 | return (u_nl_catd) ures_open(name, locale, ec); 42 | } 43 | 44 | U_CAPI void U_EXPORT2 45 | u_catclose(u_nl_catd catd) { 46 | ures_close((UResourceBundle*) catd); /* may be NULL */ 47 | } 48 | 49 | U_CAPI const UChar* U_EXPORT2 50 | u_catgets(u_nl_catd catd, int32_t set_num, int32_t msg_num, 51 | const UChar* s, 52 | int32_t* len, UErrorCode* ec) { 53 | 54 | char key[MAX_KEY_LEN]; 55 | const UChar* result; 56 | 57 | if (ec == NULL || U_FAILURE(*ec)) { 58 | goto ERROR; 59 | } 60 | 61 | result = ures_getStringByKey((const UResourceBundle*) catd, 62 | _catkey(key, set_num, msg_num), 63 | len, ec); 64 | if (U_FAILURE(*ec)) { 65 | goto ERROR; 66 | } 67 | 68 | return result; 69 | 70 | ERROR: 71 | /* In case of any failure, return s */ 72 | if (len != NULL) { 73 | *len = u_strlen(s); 74 | } 75 | return s; 76 | } 77 | 78 | /*eof*/ 79 | -------------------------------------------------------------------------------- /vendor/icu/common/ucnv_set.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 2003-2007, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * file name: ucnv_set.c 11 | * encoding: UTF-8 12 | * tab size: 8 (not used) 13 | * indentation:4 14 | * 15 | * created on: 2004sep07 16 | * created by: Markus W. Scherer 17 | * 18 | * Conversion API functions using USet (ucnv_getUnicodeSet()) 19 | * moved here from ucnv.c for removing the dependency of other ucnv_ 20 | * implementation functions on the USet implementation. 21 | */ 22 | 23 | #include "unicode/utypes.h" 24 | #include "unicode/uset.h" 25 | #include "unicode/ucnv.h" 26 | #include "ucnv_bld.h" 27 | #include "uset_imp.h" 28 | 29 | #if !UCONFIG_NO_CONVERSION 30 | 31 | U_CAPI void U_EXPORT2 32 | ucnv_getUnicodeSet(const UConverter *cnv, 33 | USet *setFillIn, 34 | UConverterUnicodeSet whichSet, 35 | UErrorCode *pErrorCode) { 36 | /* argument checking */ 37 | if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) { 38 | return; 39 | } 40 | if(cnv==NULL || setFillIn==NULL || whichSetsharedData->impl->getUnicodeSet==NULL) { 47 | *pErrorCode=U_UNSUPPORTED_ERROR; 48 | return; 49 | } 50 | 51 | { 52 | USetAdder sa={ 53 | NULL, 54 | uset_add, 55 | uset_addRange, 56 | uset_addString, 57 | uset_remove, 58 | uset_removeRange 59 | }; 60 | sa.set=setFillIn; 61 | 62 | /* empty the set */ 63 | uset_clear(setFillIn); 64 | 65 | /* call the converter to add the code points it supports */ 66 | cnv->sharedData->impl->getUnicodeSet(cnv, &sa, whichSet, pErrorCode); 67 | } 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /vendor/icu/common/ucol_swp.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 2003-2014, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * file name: ucol_swp.h 11 | * encoding: UTF-8 12 | * tab size: 8 (not used) 13 | * indentation:4 14 | * 15 | * created on: 2003sep10 16 | * created by: Markus W. Scherer 17 | * 18 | * Swap collation binaries. 19 | */ 20 | 21 | #ifndef __UCOL_SWP_H__ 22 | #define __UCOL_SWP_H__ 23 | 24 | #include "unicode/utypes.h" 25 | 26 | #if !UCONFIG_NO_COLLATION 27 | 28 | #include "udataswp.h" 29 | 30 | /* 31 | * Does the data look like a collation binary? 32 | * @internal 33 | */ 34 | U_INTERNAL UBool U_EXPORT2 35 | ucol_looksLikeCollationBinary(const UDataSwapper *ds, 36 | const void *inData, int32_t length); 37 | 38 | /** 39 | * Swap ICU collation data like ucadata.icu. See udataswp.h. 40 | * @internal 41 | */ 42 | U_CAPI int32_t U_EXPORT2 43 | ucol_swap(const UDataSwapper *ds, 44 | const void *inData, int32_t length, void *outData, 45 | UErrorCode *pErrorCode); 46 | 47 | /** 48 | * Swap inverse UCA collation data (invuca.icu). See udataswp.h. 49 | * @internal 50 | */ 51 | U_CAPI int32_t U_EXPORT2 52 | ucol_swapInverseUCA(const UDataSwapper *ds, 53 | const void *inData, int32_t length, void *outData, 54 | UErrorCode *pErrorCode); 55 | 56 | #endif /* #if !UCONFIG_NO_COLLATION */ 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /vendor/icu/common/uhash_us.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * Copyright (C) 1997-2011, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ****************************************************************************** 8 | * Date Name Description 9 | * 03/22/00 aliu Creation. 10 | * 07/06/01 aliu Modified to support int32_t keys on 11 | * platforms with sizeof(void*) < 32. 12 | ****************************************************************************** 13 | */ 14 | 15 | #include "hash.h" 16 | 17 | /** 18 | * Deleter for Hashtable objects. 19 | */ 20 | U_CAPI void U_EXPORT2 21 | uhash_deleteHashtable(void *obj) { 22 | U_NAMESPACE_USE 23 | delete (Hashtable*) obj; 24 | } 25 | 26 | //eof 27 | -------------------------------------------------------------------------------- /vendor/icu/common/uinit.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * Copyright (C) 2001-2015, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ****************************************************************************** 8 | * file name: uinit.cpp 9 | * encoding: UTF-8 10 | * tab size: 8 (not used) 11 | * indentation:4 12 | * 13 | * created on: 2001July05 14 | * created by: George Rhoten 15 | */ 16 | 17 | #include "unicode/utypes.h" 18 | #include "unicode/icuplug.h" 19 | #include "unicode/uclean.h" 20 | #include "cmemory.h" 21 | #include "icuplugimp.h" 22 | #include "ucln_cmn.h" 23 | #include "ucnv_io.h" 24 | #include "umutex.h" 25 | #include "utracimp.h" 26 | 27 | U_NAMESPACE_BEGIN 28 | 29 | static UInitOnce gICUInitOnce = U_INITONCE_INITIALIZER; 30 | 31 | static UBool U_CALLCONV uinit_cleanup() { 32 | gICUInitOnce.reset(); 33 | return TRUE; 34 | } 35 | 36 | static void U_CALLCONV 37 | initData(UErrorCode &status) 38 | { 39 | #if UCONFIG_ENABLE_PLUGINS 40 | /* initialize plugins */ 41 | uplug_init(&status); 42 | #endif 43 | 44 | #if !UCONFIG_NO_CONVERSION 45 | /* 46 | * 2005-may-02 47 | * 48 | * ICU4C 3.4 (jitterbug 4497) hardcodes the data for Unicode character 49 | * properties for APIs that want to be fast. 50 | * Therefore, we need not load them here nor check for errors. 51 | * Instead, we load the converter alias table to see if any ICU data 52 | * is available. 53 | * Users should really open the service objects they need and check 54 | * for errors there, to make sure that the actual items they need are 55 | * available. 56 | */ 57 | ucnv_io_countKnownConverters(&status); 58 | #endif 59 | ucln_common_registerCleanup(UCLN_COMMON_UINIT, uinit_cleanup); 60 | } 61 | 62 | U_NAMESPACE_END 63 | 64 | U_NAMESPACE_USE 65 | 66 | /* 67 | * ICU Initialization Function. Need not be called. 68 | */ 69 | U_CAPI void U_EXPORT2 70 | u_init(UErrorCode *status) { 71 | UTRACE_ENTRY_OC(UTRACE_U_INIT); 72 | umtx_initOnce(gICUInitOnce, &initData, *status); 73 | UTRACE_EXIT_STATUS(*status); 74 | } 75 | -------------------------------------------------------------------------------- /vendor/icu/common/ulayout_props.h: -------------------------------------------------------------------------------- 1 | // © 2019 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | // ulayout_props.h 5 | // created: 2019feb12 Markus W. Scherer 6 | 7 | #ifndef __ULAYOUT_PROPS_H__ 8 | #define __ULAYOUT_PROPS_H__ 9 | 10 | #include "unicode/utypes.h" 11 | 12 | // file definitions ------------------------------------------------------------ 13 | 14 | #define ULAYOUT_DATA_NAME "ulayout" 15 | #define ULAYOUT_DATA_TYPE "icu" 16 | 17 | // data format "Layo" 18 | #define ULAYOUT_FMT_0 0x4c 19 | #define ULAYOUT_FMT_1 0x61 20 | #define ULAYOUT_FMT_2 0x79 21 | #define ULAYOUT_FMT_3 0x6f 22 | 23 | // indexes into indexes[] 24 | enum { 25 | // Element 0 stores the length of the indexes[] array. 26 | ULAYOUT_IX_INDEXES_LENGTH, 27 | // Elements 1..7 store the tops of consecutive code point tries. 28 | // No trie is stored if the difference between two of these is less than 16. 29 | ULAYOUT_IX_INPC_TRIE_TOP, 30 | ULAYOUT_IX_INSC_TRIE_TOP, 31 | ULAYOUT_IX_VO_TRIE_TOP, 32 | ULAYOUT_IX_RESERVED_TOP, 33 | 34 | ULAYOUT_IX_TRIES_TOP = 7, 35 | 36 | ULAYOUT_IX_MAX_VALUES = 9, 37 | 38 | // Length of indexes[]. Multiple of 4 to 16-align the tries. 39 | ULAYOUT_IX_COUNT = 12 40 | }; 41 | 42 | constexpr int32_t ULAYOUT_MAX_INPC_SHIFT = 24; 43 | constexpr int32_t ULAYOUT_MAX_INSC_SHIFT = 16; 44 | constexpr int32_t ULAYOUT_MAX_VO_SHIFT = 8; 45 | 46 | #endif // __ULAYOUT_PROPS_H__ 47 | -------------------------------------------------------------------------------- /vendor/icu/common/ulist.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * Copyright (C) 2009-2016, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef ULIST_H 11 | #define ULIST_H 12 | 13 | #include "unicode/utypes.h" 14 | #include "unicode/uenum.h" 15 | 16 | struct UList; 17 | typedef struct UList UList; 18 | 19 | U_CAPI UList * U_EXPORT2 ulist_createEmptyList(UErrorCode *status); 20 | 21 | U_CAPI void U_EXPORT2 ulist_addItemEndList(UList *list, const void *data, UBool forceDelete, UErrorCode *status); 22 | 23 | U_CAPI void U_EXPORT2 ulist_addItemBeginList(UList *list, const void *data, UBool forceDelete, UErrorCode *status); 24 | 25 | U_CAPI UBool U_EXPORT2 ulist_containsString(const UList *list, const char *data, int32_t length); 26 | 27 | U_CAPI UBool U_EXPORT2 ulist_removeString(UList *list, const char *data); 28 | 29 | U_CAPI void *U_EXPORT2 ulist_getNext(UList *list); 30 | 31 | U_CAPI int32_t U_EXPORT2 ulist_getListSize(const UList *list); 32 | 33 | U_CAPI void U_EXPORT2 ulist_resetList(UList *list); 34 | 35 | U_CAPI void U_EXPORT2 ulist_deleteList(UList *list); 36 | 37 | /* 38 | * The following are for use when creating UEnumeration object backed by UList. 39 | */ 40 | U_CAPI void U_EXPORT2 ulist_close_keyword_values_iterator(UEnumeration *en); 41 | 42 | U_CAPI int32_t U_EXPORT2 ulist_count_keyword_values(UEnumeration *en, UErrorCode *status); 43 | 44 | U_CAPI const char * U_EXPORT2 ulist_next_keyword_value(UEnumeration* en, int32_t *resultLength, UErrorCode* status); 45 | 46 | U_CAPI void U_EXPORT2 ulist_reset_keyword_values_iterator(UEnumeration* en, UErrorCode* status); 47 | 48 | U_CAPI UList * U_EXPORT2 ulist_getListFromEnum(UEnumeration *en); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /vendor/icu/common/umapfile.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * 6 | * Copyright (C) 1999-2011, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************/ 10 | 11 | /*---------------------------------------------------------------------------------- 12 | * 13 | * Memory mapped file wrappers for use by the ICU Data Implementation 14 | * 15 | * Porting note: The implementation of these functions is very platform specific. 16 | * Not all platforms can do real memory mapping. Those that can't 17 | * still must implement these functions, getting the data into memory using 18 | * whatever means are available. 19 | * 20 | * These functions are part of the ICU internal implementation, and 21 | * are not inteded to be used directly by applications. 22 | * 23 | *----------------------------------------------------------------------------------*/ 24 | 25 | #ifndef __UMAPFILE_H__ 26 | #define __UMAPFILE_H__ 27 | 28 | #include "unicode/putil.h" 29 | #include "unicode/udata.h" 30 | #include "putilimp.h" 31 | 32 | U_CFUNC UBool uprv_mapFile(UDataMemory *pdm, const char *path, UErrorCode *status); 33 | U_CFUNC void uprv_unmapFile(UDataMemory *pData); 34 | 35 | /* MAP_NONE: no memory mapping, no file access at all */ 36 | #define MAP_NONE 0 37 | #define MAP_WIN32 1 38 | #define MAP_POSIX 2 39 | #define MAP_STDIO 3 40 | #define MAP_390DLL 4 41 | 42 | #if UCONFIG_NO_FILE_IO 43 | # define MAP_IMPLEMENTATION MAP_NONE 44 | #elif U_PLATFORM_USES_ONLY_WIN32_API 45 | # define MAP_IMPLEMENTATION MAP_WIN32 46 | #elif U_HAVE_MMAP || U_PLATFORM == U_PF_OS390 47 | # if U_PLATFORM == U_PF_OS390 && defined (OS390_STUBDATA) 48 | /* No memory mapping for 390 batch mode. Fake it using dll loading. */ 49 | # define MAP_IMPLEMENTATION MAP_390DLL 50 | # else 51 | # define MAP_IMPLEMENTATION MAP_POSIX 52 | # endif 53 | #else /* unknown platform, no memory map implementation: use stdio.h and uprv_malloc() instead */ 54 | # define MAP_IMPLEMENTATION MAP_STDIO 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /vendor/icu/common/umath.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * 6 | * Copyright (C) 1997-2006, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ****************************************************************************** 10 | * This file contains platform independent math. 11 | */ 12 | 13 | #include "putilimp.h" 14 | 15 | U_CAPI int32_t U_EXPORT2 16 | uprv_max(int32_t x, int32_t y) 17 | { 18 | return (x > y ? x : y); 19 | } 20 | 21 | U_CAPI int32_t U_EXPORT2 22 | uprv_min(int32_t x, int32_t y) 23 | { 24 | return (x > y ? y : x); 25 | } 26 | -------------------------------------------------------------------------------- /vendor/icu/common/unicode/dbbi.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 1999-2006,2013 IBM Corp. All rights reserved. 6 | ********************************************************************** 7 | * Date Name Description 8 | * 12/1/99 rgillam Complete port from Java. 9 | * 01/13/2000 helena Added UErrorCode to ctors. 10 | ********************************************************************** 11 | */ 12 | 13 | #ifndef DBBI_H 14 | #define DBBI_H 15 | 16 | #include "unicode/rbbi.h" 17 | 18 | #if !UCONFIG_NO_BREAK_ITERATION 19 | 20 | /** 21 | * \file 22 | * \brief C++ API: Dictionary Based Break Iterator 23 | */ 24 | 25 | U_NAMESPACE_BEGIN 26 | 27 | #ifndef U_HIDE_DEPRECATED_API 28 | /** 29 | * An obsolete subclass of RuleBasedBreakIterator. Handling of dictionary- 30 | * based break iteration has been folded into the base class. This class 31 | * is deprecated as of ICU 3.6. 32 | * @deprecated ICU 3.6 33 | */ 34 | typedef RuleBasedBreakIterator DictionaryBasedBreakIterator; 35 | 36 | #endif /* U_HIDE_DEPRECATED_API */ 37 | 38 | U_NAMESPACE_END 39 | 40 | #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /vendor/icu/common/unicode/enumset.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * 6 | * Copyright (C) 2012,2014 International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ****************************************************************************** 10 | */ 11 | 12 | /** 13 | * \file 14 | * \brief C++: internal template EnumSet<> 15 | */ 16 | 17 | #ifndef ENUMSET_H 18 | #define ENUMSET_H 19 | 20 | #include "unicode/utypes.h" 21 | 22 | #if U_SHOW_CPLUSPLUS_API 23 | 24 | U_NAMESPACE_BEGIN 25 | 26 | /* Can't use #ifndef U_HIDE_INTERNAL_API for the entire EnumSet class, needed in .h file declarations */ 27 | /** 28 | * enum bitset for boolean fields. Similar to Java EnumSet<>. 29 | * Needs to range check. Used for private instance variables. 30 | * @internal 31 | * \cond 32 | */ 33 | template 34 | class EnumSet { 35 | public: 36 | inline EnumSet() : fBools(0) {} 37 | inline EnumSet(const EnumSet& other) : fBools(other.fBools) {} 38 | inline ~EnumSet() {} 39 | #ifndef U_HIDE_INTERNAL_API 40 | inline void clear() { fBools=0; } 41 | inline void add(T toAdd) { set(toAdd, 1); } 42 | inline void remove(T toRemove) { set(toRemove, 0); } 43 | inline int32_t contains(T toCheck) const { return get(toCheck); } 44 | inline void set(T toSet, int32_t v) { fBools=(fBools&(~flag(toSet)))|(v?(flag(toSet)):0); } 45 | inline int32_t get(T toCheck) const { return (fBools & flag(toCheck))?1:0; } 46 | inline UBool isValidEnum(T toCheck) const { return (toCheck>=minValue&&toCheck& operator=(const EnumSet& other) { 49 | fBools = other.fBools; 50 | return *this; 51 | } 52 | 53 | inline uint32_t getAll() const { 54 | return fBools; 55 | } 56 | #endif /* U_HIDE_INTERNAL_API */ 57 | 58 | private: 59 | inline uint32_t flag(T toCheck) const { return (1<<(toCheck-minValue)); } 60 | private: 61 | uint32_t fBools; 62 | }; 63 | 64 | /** \endcond */ 65 | 66 | U_NAMESPACE_END 67 | 68 | #endif /* U_SHOW_CPLUSPLUS_API */ 69 | #endif /* ENUMSET_H */ 70 | -------------------------------------------------------------------------------- /vendor/icu/common/unicode/icudataver.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * 6 | * Copyright (C) 2009-2013, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ****************************************************************************** 10 | */ 11 | 12 | 13 | /** 14 | * \file 15 | * \brief C API: access to ICU Data Version number 16 | */ 17 | 18 | #ifndef __ICU_DATA_VER_H__ 19 | #define __ICU_DATA_VER_H__ 20 | 21 | #include "unicode/utypes.h" 22 | 23 | /** 24 | * @stable ICU 49 25 | */ 26 | #define U_ICU_VERSION_BUNDLE "icuver" 27 | 28 | /** 29 | * @stable ICU 49 30 | */ 31 | #define U_ICU_DATA_KEY "DataVersion" 32 | 33 | /** 34 | * Retrieves the data version from icuver and stores it in dataVersionFillin. 35 | * 36 | * @param dataVersionFillin icuver data version information to be filled in if not-null 37 | * @param status stores the error code from the calls to resource bundle 38 | * 39 | * @stable ICU 49 40 | */ 41 | U_STABLE void U_EXPORT2 u_getDataVersion(UVersionInfo dataVersionFillin, UErrorCode *status); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /vendor/icu/common/unicode/std_string.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 2009-2014, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * file name: std_string.h 11 | * encoding: UTF-8 12 | * tab size: 8 (not used) 13 | * indentation:4 14 | * 15 | * created on: 2009feb19 16 | * created by: Markus W. Scherer 17 | */ 18 | 19 | #ifndef __STD_STRING_H__ 20 | #define __STD_STRING_H__ 21 | 22 | /** 23 | * \file 24 | * \brief C++ API: Central ICU header for including the C++ standard <string> 25 | * header and for related definitions. 26 | */ 27 | 28 | #include "unicode/utypes.h" 29 | 30 | // Workaround for a libstdc++ bug before libstdc++4.6 (2011). 31 | // https://bugs.llvm.org/show_bug.cgi?id=13364 32 | #if defined(__GLIBCXX__) 33 | namespace std { class type_info; } 34 | #endif 35 | #include 36 | 37 | #endif // __STD_STRING_H__ 38 | -------------------------------------------------------------------------------- /vendor/icu/common/unicode/umisc.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 1999-2006, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * file name: umisc.h 9 | * encoding: UTF-8 10 | * tab size: 8 (not used) 11 | * indentation:4 12 | * 13 | * created on: 1999oct15 14 | * created by: Markus W. Scherer 15 | */ 16 | 17 | #ifndef UMISC_H 18 | #define UMISC_H 19 | 20 | #include "unicode/utypes.h" 21 | 22 | /** 23 | * \file 24 | * \brief C API:misc definitions 25 | * 26 | * This file contains miscellaneous definitions for the C APIs. 27 | */ 28 | 29 | U_CDECL_BEGIN 30 | 31 | /** A struct representing a range of text containing a specific field 32 | * @stable ICU 2.0 33 | */ 34 | typedef struct UFieldPosition { 35 | /** 36 | * The field 37 | * @stable ICU 2.0 38 | */ 39 | int32_t field; 40 | /** 41 | * The start of the text range containing field 42 | * @stable ICU 2.0 43 | */ 44 | int32_t beginIndex; 45 | /** 46 | * The limit of the text range containing field 47 | * @stable ICU 2.0 48 | */ 49 | int32_t endIndex; 50 | } UFieldPosition; 51 | 52 | #if !UCONFIG_NO_SERVICE 53 | /** 54 | * Opaque type returned by registerInstance, registerFactory and unregister for service registration. 55 | * @stable ICU 2.6 56 | */ 57 | typedef const void* URegistryKey; 58 | #endif 59 | 60 | U_CDECL_END 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /vendor/icu/common/unicode/utf32.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 1999-2001, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * file name: utf32.h 11 | * encoding: UTF-8 12 | * tab size: 8 (not used) 13 | * indentation:4 14 | * 15 | * created on: 1999sep20 16 | * created by: Markus W. Scherer 17 | */ 18 | /** 19 | * \file 20 | * \brief C API: UTF-32 macros 21 | * 22 | * This file is obsolete and its contents moved to utf_old.h. 23 | * See utf_old.h and Jitterbug 2150 and its discussion on the ICU mailing list 24 | * in September 2002. 25 | */ 26 | -------------------------------------------------------------------------------- /vendor/icu/common/unifilt.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (c) 2001-2012, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * Date Name Description 9 | * 07/18/01 aliu Creation. 10 | ********************************************************************** 11 | */ 12 | 13 | #include "unicode/unifilt.h" 14 | #include "unicode/rep.h" 15 | #include "unicode/utf16.h" 16 | 17 | U_NAMESPACE_BEGIN 18 | UOBJECT_DEFINE_ABSTRACT_RTTI_IMPLEMENTATION(UnicodeFilter) 19 | 20 | 21 | /* Define this here due to the lack of another file. 22 | It can't be defined in the header */ 23 | UnicodeMatcher::~UnicodeMatcher() {} 24 | 25 | UnicodeFilter::~UnicodeFilter() {} 26 | 27 | /** 28 | * UnicodeFunctor API. 29 | * Note that UnicodeMatcher is a base class of UnicodeFilter. 30 | */ 31 | UnicodeMatcher* UnicodeFilter::toMatcher() const { 32 | return const_cast(this); 33 | } 34 | 35 | void UnicodeFilter::setData(const TransliterationRuleData*) {} 36 | 37 | /** 38 | * Default implementation of UnicodeMatcher::matches() for Unicode 39 | * filters. Matches a single code point at offset (either one or 40 | * two 16-bit code units). 41 | */ 42 | UMatchDegree UnicodeFilter::matches(const Replaceable& text, 43 | int32_t& offset, 44 | int32_t limit, 45 | UBool incremental) { 46 | UChar32 c; 47 | if (offset < limit && 48 | contains(c = text.char32At(offset))) { 49 | offset += U16_LENGTH(c); 50 | return U_MATCH; 51 | } 52 | if (offset > limit && 53 | contains(c = text.char32At(offset))) { 54 | // Backup offset by 1, unless the preceding character is a 55 | // surrogate pair -- then backup by 2 (keep offset pointing at 56 | // the lead surrogate). 57 | --offset; 58 | if (offset >= 0) { 59 | offset -= U16_LENGTH(text.char32At(offset)) - 1; 60 | } 61 | return U_MATCH; 62 | } 63 | if (incremental && offset == limit) { 64 | return U_PARTIAL_MATCH; 65 | } 66 | return U_MISMATCH; 67 | } 68 | 69 | U_NAMESPACE_END 70 | 71 | //eof 72 | -------------------------------------------------------------------------------- /vendor/icu/common/unifunct.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (c) 2002-2004, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | */ 9 | 10 | #include "unicode/unifunct.h" 11 | 12 | U_NAMESPACE_BEGIN 13 | 14 | UOBJECT_DEFINE_ABSTRACT_RTTI_IMPLEMENTATION(UnicodeFunctor) 15 | 16 | UnicodeFunctor::~UnicodeFunctor() {} 17 | 18 | UnicodeMatcher* UnicodeFunctor::toMatcher() const { 19 | return 0; 20 | } 21 | 22 | UnicodeReplacer* UnicodeFunctor::toReplacer() const { 23 | return 0; 24 | } 25 | 26 | U_NAMESPACE_END 27 | 28 | //eof 29 | -------------------------------------------------------------------------------- /vendor/icu/common/unistr_case_locale.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2011, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ******************************************************************************* 8 | * file name: unistr_case_locale.cpp 9 | * encoding: UTF-8 10 | * tab size: 8 (not used) 11 | * indentation:4 12 | * 13 | * created on: 2011may31 14 | * created by: Markus W. Scherer 15 | * 16 | * Locale-sensitive case mapping functions (ones that call uloc_getDefault()) 17 | * were moved here to break dependency cycles among parts of the common library. 18 | */ 19 | 20 | #include "unicode/utypes.h" 21 | #include "unicode/locid.h" 22 | #include "unicode/ucasemap.h" 23 | #include "unicode/unistr.h" 24 | #include "ucasemap_imp.h" 25 | 26 | U_NAMESPACE_BEGIN 27 | 28 | //======================================== 29 | // Write implementation 30 | //======================================== 31 | 32 | UnicodeString & 33 | UnicodeString::toLower() { 34 | return caseMap(ustrcase_getCaseLocale(NULL), 0, 35 | UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToLower); 36 | } 37 | 38 | UnicodeString & 39 | UnicodeString::toLower(const Locale &locale) { 40 | return caseMap(ustrcase_getCaseLocale(locale.getBaseName()), 0, 41 | UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToLower); 42 | } 43 | 44 | UnicodeString & 45 | UnicodeString::toUpper() { 46 | return caseMap(ustrcase_getCaseLocale(NULL), 0, 47 | UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToUpper); 48 | } 49 | 50 | UnicodeString & 51 | UnicodeString::toUpper(const Locale &locale) { 52 | return caseMap(ustrcase_getCaseLocale(locale.getBaseName()), 0, 53 | UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToUpper); 54 | } 55 | 56 | U_NAMESPACE_END 57 | -------------------------------------------------------------------------------- /vendor/icu/common/unistr_props.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 1999-2011, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * file name: unistr_props.cpp 11 | * encoding: UTF-8 12 | * tab size: 8 (not used) 13 | * indentation:2 14 | * 15 | * created on: 2004aug25 16 | * created by: Markus W. Scherer 17 | * 18 | * Character property dependent functions moved here from unistr.cpp 19 | */ 20 | 21 | #include "unicode/utypes.h" 22 | #include "unicode/uchar.h" 23 | #include "unicode/unistr.h" 24 | #include "unicode/utf16.h" 25 | 26 | U_NAMESPACE_BEGIN 27 | 28 | UnicodeString& 29 | UnicodeString::trim() 30 | { 31 | if(isBogus()) { 32 | return *this; 33 | } 34 | 35 | UChar *array = getArrayStart(); 36 | UChar32 c; 37 | int32_t oldLength = this->length(); 38 | int32_t i = oldLength, length; 39 | 40 | // first cut off trailing white space 41 | for(;;) { 42 | length = i; 43 | if(i <= 0) { 44 | break; 45 | } 46 | U16_PREV(array, 0, i, c); 47 | if(!(c == 0x20 || u_isWhitespace(c))) { 48 | break; 49 | } 50 | } 51 | if(length < oldLength) { 52 | setLength(length); 53 | } 54 | 55 | // find leading white space 56 | int32_t start; 57 | i = 0; 58 | for(;;) { 59 | start = i; 60 | if(i >= length) { 61 | break; 62 | } 63 | U16_NEXT(array, i, length, c); 64 | if(!(c == 0x20 || u_isWhitespace(c))) { 65 | break; 66 | } 67 | } 68 | 69 | // move string forward over leading white space 70 | if(start > 0) { 71 | doReplace(0, start, 0, 0, 0); 72 | } 73 | 74 | return *this; 75 | } 76 | 77 | U_NAMESPACE_END 78 | -------------------------------------------------------------------------------- /vendor/icu/common/unistr_titlecase_brkiter.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2011, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ******************************************************************************* 8 | * file name: unistr_titlecase_brkiter.cpp 9 | * encoding: UTF-8 10 | * tab size: 8 (not used) 11 | * indentation:2 12 | * 13 | * created on: 2011may30 14 | * created by: Markus W. Scherer 15 | * 16 | * Titlecasing functions that are based on BreakIterator 17 | * were moved here to break dependency cycles among parts of the common library. 18 | */ 19 | 20 | #include "unicode/utypes.h" 21 | 22 | #if !UCONFIG_NO_BREAK_ITERATION 23 | 24 | #include "unicode/brkiter.h" 25 | #include "unicode/locid.h" 26 | #include "unicode/ucasemap.h" 27 | #include "unicode/unistr.h" 28 | #include "ucasemap_imp.h" 29 | 30 | U_NAMESPACE_BEGIN 31 | 32 | UnicodeString & 33 | UnicodeString::toTitle(BreakIterator *iter) { 34 | return toTitle(iter, Locale::getDefault(), 0); 35 | } 36 | 37 | UnicodeString & 38 | UnicodeString::toTitle(BreakIterator *iter, const Locale &locale) { 39 | return toTitle(iter, locale, 0); 40 | } 41 | 42 | UnicodeString & 43 | UnicodeString::toTitle(BreakIterator *iter, const Locale &locale, uint32_t options) { 44 | LocalPointer ownedIter; 45 | UErrorCode errorCode = U_ZERO_ERROR; 46 | iter = ustrcase_getTitleBreakIterator(&locale, "", options, iter, ownedIter, errorCode); 47 | if (iter == nullptr) { 48 | setToBogus(); 49 | return *this; 50 | } 51 | caseMap(ustrcase_getCaseLocale(locale.getBaseName()), options, iter, ustrcase_internalToTitle); 52 | return *this; 53 | } 54 | 55 | U_NAMESPACE_END 56 | 57 | #endif // !UCONFIG_NO_BREAK_ITERATION 58 | -------------------------------------------------------------------------------- /vendor/icu/common/ureslocs.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2009-2014 International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | */ 9 | 10 | #ifndef __URESLOCS_H__ 11 | #define __URESLOCS_H__ 12 | 13 | #include "unicode/utypes.h" 14 | #include "unicode/udata.h" 15 | 16 | U_CDECL_BEGIN 17 | 18 | 19 | #define U_ICUDATA_LANG U_ICUDATA_NAME U_TREE_SEPARATOR_STRING "lang" 20 | #define U_ICUDATA_REGION U_ICUDATA_NAME U_TREE_SEPARATOR_STRING "region" 21 | #define U_ICUDATA_CURR U_ICUDATA_NAME U_TREE_SEPARATOR_STRING "curr" 22 | #define U_ICUDATA_ZONE U_ICUDATA_NAME U_TREE_SEPARATOR_STRING "zone" 23 | #define U_ICUDATA_UNIT U_ICUDATA_NAME U_TREE_SEPARATOR_STRING "unit" 24 | 25 | U_CDECL_END 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /vendor/icu/common/uset_imp.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 2004-2007, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * file name: uset_imp.h 11 | * encoding: UTF-8 12 | * tab size: 8 (not used) 13 | * indentation:4 14 | * 15 | * created on: 2004sep07 16 | * created by: Markus W. Scherer 17 | * 18 | * Internal USet definitions. 19 | */ 20 | 21 | #ifndef __USET_IMP_H__ 22 | #define __USET_IMP_H__ 23 | 24 | #include "unicode/utypes.h" 25 | #include "unicode/uset.h" 26 | 27 | U_CDECL_BEGIN 28 | 29 | typedef void U_CALLCONV 30 | USetAdd(USet *set, UChar32 c); 31 | 32 | typedef void U_CALLCONV 33 | USetAddRange(USet *set, UChar32 start, UChar32 end); 34 | 35 | typedef void U_CALLCONV 36 | USetAddString(USet *set, const UChar *str, int32_t length); 37 | 38 | typedef void U_CALLCONV 39 | USetRemove(USet *set, UChar32 c); 40 | 41 | typedef void U_CALLCONV 42 | USetRemoveRange(USet *set, UChar32 start, UChar32 end); 43 | 44 | /** 45 | * Interface for adding items to a USet, to keep low-level code from 46 | * statically depending on the USet implementation. 47 | * Calls will look like sa->add(sa->set, c); 48 | */ 49 | struct USetAdder { 50 | USet *set; 51 | USetAdd *add; 52 | USetAddRange *addRange; 53 | USetAddString *addString; 54 | USetRemove *remove; 55 | USetRemoveRange *removeRange; 56 | }; 57 | typedef struct USetAdder USetAdder; 58 | 59 | U_CDECL_END 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /vendor/icu/common/ustack.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2003-2011, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | */ 9 | 10 | #include "uvector.h" 11 | 12 | U_NAMESPACE_BEGIN 13 | 14 | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(UStack) 15 | 16 | UStack::UStack(UErrorCode &status) : 17 | UVector(status) 18 | { 19 | } 20 | 21 | UStack::UStack(int32_t initialCapacity, UErrorCode &status) : 22 | UVector(initialCapacity, status) 23 | { 24 | } 25 | 26 | UStack::UStack(UObjectDeleter *d, UElementsAreEqual *c, UErrorCode &status) : 27 | UVector(d, c, status) 28 | { 29 | } 30 | 31 | UStack::UStack(UObjectDeleter *d, UElementsAreEqual *c, int32_t initialCapacity, UErrorCode &status) : 32 | UVector(d, c, initialCapacity, status) 33 | { 34 | } 35 | 36 | UStack::~UStack() {} 37 | 38 | void* UStack::pop(void) { 39 | int32_t n = size() - 1; 40 | void* result = 0; 41 | if (n >= 0) { 42 | result = elementAt(n); 43 | removeElementAt(n); 44 | } 45 | return result; 46 | } 47 | 48 | int32_t UStack::popi(void) { 49 | int32_t n = size() - 1; 50 | int32_t result = 0; 51 | if (n >= 0) { 52 | result = elementAti(n); 53 | removeElementAt(n); 54 | } 55 | return result; 56 | } 57 | 58 | int32_t UStack::search(void* obj) const { 59 | int32_t i = indexOf(obj); 60 | return (i >= 0) ? size() - i : i; 61 | } 62 | 63 | U_NAMESPACE_END 64 | -------------------------------------------------------------------------------- /vendor/icu/common/ustr_cnv.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 1999-2010, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * file name: ustr_cnv.h 9 | * encoding: UTF-8 10 | * tab size: 8 (not used) 11 | * indentation:4 12 | * 13 | * created on: 2004Aug27 14 | * created by: George Rhoten 15 | */ 16 | 17 | #ifndef USTR_CNV_IMP_H 18 | #define USTR_CNV_IMP_H 19 | 20 | #include "unicode/utypes.h" 21 | #include "unicode/ucnv.h" 22 | 23 | #if !UCONFIG_NO_CONVERSION 24 | 25 | /** 26 | * Get the default converter. This is a commonly used converter 27 | * that is used for the ustring and UnicodeString API. 28 | * Remember to use the u_releaseDefaultConverter when you are done. 29 | * @internal 30 | */ 31 | U_CAPI UConverter* U_EXPORT2 32 | u_getDefaultConverter(UErrorCode *status); 33 | 34 | 35 | /** 36 | * Release the default converter to the converter cache. 37 | * @internal 38 | */ 39 | U_CAPI void U_EXPORT2 40 | u_releaseDefaultConverter(UConverter *converter); 41 | 42 | /** 43 | * Flush the default converter, if cached. 44 | * @internal 45 | */ 46 | U_CAPI void U_EXPORT2 47 | u_flushDefaultConverter(void); 48 | 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /vendor/icu/common/ustrfmt.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2001-2006, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | */ 9 | 10 | #include "cstring.h" 11 | #include "ustrfmt.h" 12 | 13 | 14 | /*** 15 | * Fills in a UChar* string with the radix-based representation of a 16 | * uint32_t number padded with zeroes to minwidth. The result 17 | * will be null terminated if there is room. 18 | * 19 | * @param buffer UChar buffer to receive result 20 | * @param capacity capacity of buffer 21 | * @param i the unsigned number to be formatted 22 | * @param radix the radix from 2..36 23 | * @param minwidth the minimum width. If the result is narrower than 24 | * this, '0's will be added on the left. Must be <= 25 | * capacity. 26 | * @return the length of the result, not including any terminating 27 | * null 28 | */ 29 | U_CAPI int32_t U_EXPORT2 30 | uprv_itou (UChar * buffer, int32_t capacity, 31 | uint32_t i, uint32_t radix, int32_t minwidth) 32 | { 33 | int32_t length = 0; 34 | int digit; 35 | int32_t j; 36 | UChar temp; 37 | 38 | do{ 39 | digit = (int)(i % radix); 40 | buffer[length++]=(UChar)(digit<=9?(0x0030+digit):(0x0030+digit+7)); 41 | i=i/radix; 42 | } while(i && length does not define 'exception' in 'std' namespace. 16 | // Therefore, a project using ICU cannot be compiled with _HAS_EXCEPTIONS 17 | // set to 0 on Windows with Visual Studio. To work around that, we have to 18 | // include explicitly and add using statement below. 19 | // Whenever 'typeid' is used, this header has to be included 20 | // instead of . 21 | // Visual Studio 10 emits warning 4275 with this change. If you compile 22 | // with exception disabled, you have to suppress warning 4275. 23 | #if defined(_MSC_VER) && _HAS_EXCEPTIONS == 0 24 | #include 25 | using std::exception; 26 | #endif 27 | #if defined(__GLIBCXX__) 28 | namespace std { class type_info; } // WORKAROUND: http://llvm.org/bugs/show_bug.cgi?id=13364 29 | #endif 30 | #include // for 'typeid' to work 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /vendor/icu/common/wintz.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************** 5 | * Copyright (C) 2005-2011, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ******************************************************************************** 8 | * 9 | * File WINTZ.H 10 | * 11 | ******************************************************************************** 12 | */ 13 | 14 | #ifndef __WINTZ 15 | #define __WINTZ 16 | 17 | #include "unicode/utypes.h" 18 | 19 | #if U_PLATFORM_USES_ONLY_WIN32_API 20 | 21 | /** 22 | * \file 23 | * \brief C API: Utilities for dealing w/ Windows time zones. 24 | */ 25 | 26 | U_CDECL_BEGIN 27 | /* Forward declarations for Windows types... */ 28 | typedef struct _TIME_ZONE_INFORMATION TIME_ZONE_INFORMATION; 29 | U_CDECL_END 30 | 31 | U_INTERNAL const char* U_EXPORT2 32 | uprv_detectWindowsTimeZone(); 33 | 34 | #endif /* U_PLATFORM_USES_ONLY_WIN32_API */ 35 | 36 | #endif /* __WINTZ */ 37 | -------------------------------------------------------------------------------- /vendor/icu/data/in/icudt64l.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonicdoe/detect-character-encoding/27d8f93f9e31032ad14e80632da501cbf9f96363/vendor/icu/data/in/icudt64l.dat -------------------------------------------------------------------------------- /vendor/icu/i18n/collationcompare.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 1996-2014, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ******************************************************************************* 8 | * collationcompare.h 9 | * 10 | * created on: 2012feb14 with new and old collation code 11 | * created by: Markus W. Scherer 12 | */ 13 | 14 | #ifndef __COLLATIONCOMPARE_H__ 15 | #define __COLLATIONCOMPARE_H__ 16 | 17 | #include "unicode/utypes.h" 18 | 19 | #if !UCONFIG_NO_COLLATION 20 | 21 | #include "unicode/ucol.h" 22 | 23 | U_NAMESPACE_BEGIN 24 | 25 | class CollationIterator; 26 | struct CollationSettings; 27 | 28 | class U_I18N_API CollationCompare /* not : public UObject because all methods are static */ { 29 | public: 30 | static UCollationResult compareUpToQuaternary(CollationIterator &left, CollationIterator &right, 31 | const CollationSettings &settings, 32 | UErrorCode &errorCode); 33 | }; 34 | 35 | U_NAMESPACE_END 36 | 37 | #endif // !UCONFIG_NO_COLLATION 38 | #endif // __COLLATIONCOMPARE_H__ 39 | -------------------------------------------------------------------------------- /vendor/icu/i18n/collationdatawriter.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2013-2014, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ******************************************************************************* 8 | * collationdatawriter.h 9 | * 10 | * created on: 2013aug06 11 | * created by: Markus W. Scherer 12 | */ 13 | 14 | #ifndef __COLLATIONDATAWRITER_H__ 15 | #define __COLLATIONDATAWRITER_H__ 16 | 17 | #include "unicode/utypes.h" 18 | 19 | #if !UCONFIG_NO_COLLATION 20 | 21 | U_NAMESPACE_BEGIN 22 | 23 | struct CollationData; 24 | struct CollationSettings; 25 | struct CollationTailoring; 26 | 27 | /** 28 | * Collation-related code for tools & demos. 29 | */ 30 | class U_I18N_API CollationDataWriter /* all static */ { 31 | public: 32 | static int32_t writeBase(const CollationData &data, const CollationSettings &settings, 33 | const void *rootElements, int32_t rootElementsLength, 34 | int32_t indexes[], uint8_t *dest, int32_t capacity, 35 | UErrorCode &errorCode); 36 | 37 | static int32_t writeTailoring(const CollationTailoring &t, const CollationSettings &settings, 38 | int32_t indexes[], uint8_t *dest, int32_t capacity, 39 | UErrorCode &errorCode); 40 | 41 | private: 42 | CollationDataWriter(); // no constructor 43 | 44 | static int32_t write(UBool isBase, const UVersionInfo dataVersion, 45 | const CollationData &data, const CollationSettings &settings, 46 | const void *rootElements, int32_t rootElementsLength, 47 | int32_t indexes[], uint8_t *dest, int32_t capacity, 48 | UErrorCode &errorCode); 49 | 50 | static void copyData(const int32_t indexes[], int32_t startIndex, 51 | const void *src, uint8_t *dest); 52 | }; 53 | 54 | U_NAMESPACE_END 55 | 56 | #endif // !UCONFIG_NO_COLLATION 57 | #endif // __COLLATIONDATAWRITER_H__ 58 | -------------------------------------------------------------------------------- /vendor/icu/i18n/collationroot.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2012-2014, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ******************************************************************************* 8 | * collationroot.h 9 | * 10 | * created on: 2012dec17 11 | * created by: Markus W. Scherer 12 | */ 13 | 14 | #ifndef __COLLATIONROOT_H__ 15 | #define __COLLATIONROOT_H__ 16 | 17 | #include "unicode/utypes.h" 18 | 19 | #if !UCONFIG_NO_COLLATION 20 | 21 | U_NAMESPACE_BEGIN 22 | 23 | struct CollationCacheEntry; 24 | struct CollationData; 25 | struct CollationSettings; 26 | struct CollationTailoring; 27 | 28 | /** 29 | * Collation root provider. 30 | */ 31 | class U_I18N_API CollationRoot { // purely static 32 | public: 33 | static const CollationCacheEntry *getRootCacheEntry(UErrorCode &errorCode); 34 | static const CollationTailoring *getRoot(UErrorCode &errorCode); 35 | static const CollationData *getData(UErrorCode &errorCode); 36 | static const CollationSettings *getSettings(UErrorCode &errorCode); 37 | 38 | private: 39 | static void U_CALLCONV load(UErrorCode &errorCode); 40 | }; 41 | 42 | U_NAMESPACE_END 43 | 44 | #endif // !UCONFIG_NO_COLLATION 45 | #endif // __COLLATIONROOT_H__ 46 | -------------------------------------------------------------------------------- /vendor/icu/i18n/csdetect.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2005-2016, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | */ 9 | 10 | #ifndef __CSDETECT_H 11 | #define __CSDETECT_H 12 | 13 | #include "unicode/uobject.h" 14 | 15 | #if !UCONFIG_NO_CONVERSION 16 | 17 | #include "unicode/uenum.h" 18 | 19 | U_NAMESPACE_BEGIN 20 | 21 | class InputText; 22 | class CharsetRecognizer; 23 | class CharsetMatch; 24 | 25 | class CharsetDetector : public UMemory 26 | { 27 | private: 28 | InputText *textIn; 29 | CharsetMatch **resultArray; 30 | int32_t resultCount; 31 | UBool fStripTags; // If true, setText() will strip tags from input text. 32 | UBool fFreshTextSet; 33 | static void setRecognizers(UErrorCode &status); 34 | 35 | UBool *fEnabledRecognizers; // If not null, active set of charset recognizers had 36 | // been changed from the default. The array index is 37 | // corresponding to fCSRecognizers. See setDetectableCharset(). 38 | 39 | public: 40 | CharsetDetector(UErrorCode &status); 41 | 42 | ~CharsetDetector(); 43 | 44 | void setText(const char *in, int32_t len); 45 | 46 | const CharsetMatch * const *detectAll(int32_t &maxMatchesFound, UErrorCode &status); 47 | 48 | const CharsetMatch *detect(UErrorCode& status); 49 | 50 | void setDeclaredEncoding(const char *encoding, int32_t len) const; 51 | 52 | UBool setStripTagsFlag(UBool flag); 53 | 54 | UBool getStripTagsFlag() const; 55 | 56 | // const char *getCharsetName(int32_t index, UErrorCode& status) const; 57 | 58 | static int32_t getDetectableCount(); 59 | 60 | 61 | static UEnumeration * getAllDetectableCharsets(UErrorCode &status); 62 | UEnumeration * getDetectableCharsets(UErrorCode &status) const; 63 | void setDetectableCharset(const char *encoding, UBool enabled, UErrorCode &status); 64 | }; 65 | 66 | U_NAMESPACE_END 67 | 68 | #endif 69 | #endif /* __CSDETECT_H */ 70 | -------------------------------------------------------------------------------- /vendor/icu/i18n/csmatch.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2005-2012, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | */ 9 | 10 | #include "unicode/utypes.h" 11 | 12 | #if !UCONFIG_NO_CONVERSION 13 | #include "unicode/unistr.h" 14 | #include "unicode/ucnv.h" 15 | 16 | #include "csmatch.h" 17 | 18 | #include "csrecog.h" 19 | #include "inputext.h" 20 | 21 | U_NAMESPACE_BEGIN 22 | 23 | CharsetMatch::CharsetMatch() 24 | : textIn(NULL), confidence(0), fCharsetName(NULL), fLang(NULL) 25 | { 26 | // nothing else to do. 27 | } 28 | 29 | void CharsetMatch::set(InputText *input, const CharsetRecognizer *cr, int32_t conf, 30 | const char *csName, const char *lang) 31 | { 32 | textIn = input; 33 | confidence = conf; 34 | fCharsetName = csName; 35 | fLang = lang; 36 | if (cr != NULL) { 37 | if (fCharsetName == NULL) { 38 | fCharsetName = cr->getName(); 39 | } 40 | if (fLang == NULL) { 41 | fLang = cr->getLanguage(); 42 | } 43 | } 44 | } 45 | 46 | const char* CharsetMatch::getName()const 47 | { 48 | return fCharsetName; 49 | } 50 | 51 | const char* CharsetMatch::getLanguage()const 52 | { 53 | return fLang; 54 | } 55 | 56 | int32_t CharsetMatch::getConfidence()const 57 | { 58 | return confidence; 59 | } 60 | 61 | int32_t CharsetMatch::getUChars(UChar *buf, int32_t cap, UErrorCode *status) const 62 | { 63 | UConverter *conv = ucnv_open(getName(), status); 64 | int32_t result = ucnv_toUChars(conv, buf, cap, (const char *) textIn->fRawInput, textIn->fRawLength, status); 65 | 66 | ucnv_close(conv); 67 | 68 | return result; 69 | } 70 | 71 | U_NAMESPACE_END 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /vendor/icu/i18n/csmatch.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2005-2012, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | */ 9 | 10 | #ifndef __CSMATCH_H 11 | #define __CSMATCH_H 12 | 13 | #include "unicode/uobject.h" 14 | 15 | #if !UCONFIG_NO_CONVERSION 16 | 17 | U_NAMESPACE_BEGIN 18 | 19 | class InputText; 20 | class CharsetRecognizer; 21 | 22 | /* 23 | * CharsetMatch represents the results produced by one Charset Recognizer for one input text 24 | * Any confidence > 0 indicates a possible match, meaning that the input bytes 25 | * are at least legal. 26 | * 27 | * The full results of a detect are represented by an array of these 28 | * CharsetMatch objects, each representing a possible matching charset. 29 | * 30 | * Note that a single charset recognizer may detect multiple closely related 31 | * charsets, and set different names depending on the exact input bytes seen. 32 | */ 33 | class CharsetMatch : public UMemory 34 | { 35 | private: 36 | InputText *textIn; 37 | int32_t confidence; 38 | const char *fCharsetName; 39 | const char *fLang; 40 | 41 | public: 42 | CharsetMatch(); 43 | 44 | /** 45 | * fully set the state of this CharsetMatch. 46 | * Called by the CharsetRecognizers to record match results. 47 | * Default (NULL) parameters for names will be filled by calling the 48 | * corresponding getters on the recognizer. 49 | */ 50 | void set(InputText *input, 51 | const CharsetRecognizer *cr, 52 | int32_t conf, 53 | const char *csName=NULL, 54 | const char *lang=NULL); 55 | 56 | /** 57 | * Return the name of the charset for this Match 58 | */ 59 | const char *getName() const; 60 | 61 | const char *getLanguage()const; 62 | 63 | int32_t getConfidence()const; 64 | 65 | int32_t getUChars(UChar *buf, int32_t cap, UErrorCode *status) const; 66 | }; 67 | 68 | U_NAMESPACE_END 69 | 70 | #endif 71 | #endif /* __CSMATCH_H */ 72 | -------------------------------------------------------------------------------- /vendor/icu/i18n/csrecog.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2005-2006, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | */ 9 | 10 | #include "unicode/utypes.h" 11 | 12 | #if !UCONFIG_NO_CONVERSION 13 | 14 | #include "csrecog.h" 15 | 16 | U_NAMESPACE_BEGIN 17 | 18 | CharsetRecognizer::~CharsetRecognizer() 19 | { 20 | // nothing to do. 21 | } 22 | 23 | const char *CharsetRecognizer::getLanguage() const 24 | { 25 | return ""; 26 | } 27 | 28 | U_NAMESPACE_END 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /vendor/icu/i18n/csrecog.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2005-2012, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | */ 9 | 10 | #ifndef __CSRECOG_H 11 | #define __CSRECOG_H 12 | 13 | #include "unicode/uobject.h" 14 | 15 | #if !UCONFIG_NO_CONVERSION 16 | 17 | #include "inputext.h" 18 | 19 | U_NAMESPACE_BEGIN 20 | 21 | class CharsetMatch; 22 | 23 | class CharsetRecognizer : public UMemory 24 | { 25 | public: 26 | /** 27 | * Get the IANA name of this charset. 28 | * Note that some recognizers can recognize more than one charset, but that this API 29 | * assumes just one name per recognizer. 30 | * TODO: need to account for multiple names in public API that enumerates over the 31 | * known detectable charsets. 32 | * @return the charset name. 33 | */ 34 | virtual const char *getName() const = 0; 35 | 36 | /** 37 | * Get the ISO language code for this charset. 38 | * @return the language code, or null if the language cannot be determined. 39 | */ 40 | virtual const char *getLanguage() const; 41 | 42 | /* 43 | * Try the given input text against this Charset, and fill in the results object 44 | * with the quality of the match plus other information related to the match. 45 | * 46 | * Return TRUE if the the input bytes are a potential match, and 47 | * FALSE if the input data is not compatible with, or illegal in this charset. 48 | */ 49 | virtual UBool match(InputText *textIn, CharsetMatch *results) const = 0; 50 | 51 | virtual ~CharsetRecognizer(); 52 | }; 53 | 54 | U_NAMESPACE_END 55 | 56 | #endif 57 | #endif /* __CSRECOG_H */ 58 | -------------------------------------------------------------------------------- /vendor/icu/i18n/csrutf8.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2005-2012, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | */ 9 | 10 | #ifndef __CSRUTF8_H 11 | #define __CSRUTF8_H 12 | 13 | #include "unicode/utypes.h" 14 | 15 | #if !UCONFIG_NO_CONVERSION 16 | 17 | #include "csrecog.h" 18 | 19 | U_NAMESPACE_BEGIN 20 | 21 | /** 22 | * Charset recognizer for UTF-8 23 | * 24 | * @internal 25 | */ 26 | class CharsetRecog_UTF8: public CharsetRecognizer { 27 | 28 | public: 29 | 30 | virtual ~CharsetRecog_UTF8(); 31 | 32 | const char *getName() const; 33 | 34 | /* (non-Javadoc) 35 | * @see com.ibm.icu.text.CharsetRecognizer#match(com.ibm.icu.text.CharsetDetector) 36 | */ 37 | UBool match(InputText *input, CharsetMatch *results) const; 38 | 39 | }; 40 | 41 | U_NAMESPACE_END 42 | 43 | #endif 44 | #endif /* __CSRUTF8_H */ 45 | -------------------------------------------------------------------------------- /vendor/icu/i18n/curramt.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (c) 2004, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * Author: Alan Liu 9 | * Created: April 26, 2004 10 | * Since: ICU 3.0 11 | ********************************************************************** 12 | */ 13 | #include "unicode/utypes.h" 14 | 15 | #if !UCONFIG_NO_FORMATTING 16 | 17 | #include "unicode/curramt.h" 18 | #include "unicode/currunit.h" 19 | 20 | U_NAMESPACE_BEGIN 21 | 22 | CurrencyAmount::CurrencyAmount(const Formattable& amount, ConstChar16Ptr isoCode, 23 | UErrorCode& ec) : 24 | Measure(amount, new CurrencyUnit(isoCode, ec), ec) { 25 | } 26 | 27 | CurrencyAmount::CurrencyAmount(double amount, ConstChar16Ptr isoCode, 28 | UErrorCode& ec) : 29 | Measure(Formattable(amount), new CurrencyUnit(isoCode, ec), ec) { 30 | } 31 | 32 | CurrencyAmount::CurrencyAmount(const CurrencyAmount& other) : 33 | Measure(other) { 34 | } 35 | 36 | CurrencyAmount& CurrencyAmount::operator=(const CurrencyAmount& other) { 37 | Measure::operator=(other); 38 | return *this; 39 | } 40 | 41 | UObject* CurrencyAmount::clone() const { 42 | return new CurrencyAmount(*this); 43 | } 44 | 45 | CurrencyAmount::~CurrencyAmount() { 46 | } 47 | 48 | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CurrencyAmount) 49 | 50 | U_NAMESPACE_END 51 | 52 | #endif // !UCONFIG_NO_FORMATTING 53 | -------------------------------------------------------------------------------- /vendor/icu/i18n/currfmt.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (c) 2004-2014 International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * Author: Alan Liu 9 | * Created: April 20, 2004 10 | * Since: ICU 3.0 11 | ********************************************************************** 12 | */ 13 | #include "unicode/utypes.h" 14 | 15 | #if !UCONFIG_NO_FORMATTING 16 | 17 | #include "currfmt.h" 18 | #include "unicode/numfmt.h" 19 | #include "unicode/curramt.h" 20 | 21 | U_NAMESPACE_BEGIN 22 | 23 | CurrencyFormat::CurrencyFormat(const Locale& locale, UErrorCode& ec) : 24 | MeasureFormat(locale, UMEASFMT_WIDTH_WIDE, ec) 25 | { 26 | } 27 | 28 | CurrencyFormat::CurrencyFormat(const CurrencyFormat& other) : 29 | MeasureFormat(other) 30 | { 31 | } 32 | 33 | CurrencyFormat::~CurrencyFormat() { 34 | } 35 | 36 | Format* CurrencyFormat::clone() const { 37 | return new CurrencyFormat(*this); 38 | } 39 | 40 | UnicodeString& CurrencyFormat::format(const Formattable& obj, 41 | UnicodeString& appendTo, 42 | FieldPosition& pos, 43 | UErrorCode& ec) const 44 | { 45 | return getCurrencyFormatInternal().format(obj, appendTo, pos, ec); 46 | } 47 | 48 | void CurrencyFormat::parseObject(const UnicodeString& source, 49 | Formattable& result, 50 | ParsePosition& pos) const 51 | { 52 | CurrencyAmount* currAmt = getCurrencyFormatInternal().parseCurrency(source, pos); 53 | if (currAmt != NULL) { 54 | result.adoptObject(currAmt); 55 | } 56 | } 57 | 58 | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CurrencyFormat) 59 | 60 | U_NAMESPACE_END 61 | 62 | #endif /* #if !UCONFIG_NO_FORMATTING */ 63 | -------------------------------------------------------------------------------- /vendor/icu/i18n/fmtable_cnv.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 1997-2010, International Business Machines Corporation and * 6 | * others. All Rights Reserved. * 7 | ******************************************************************************* 8 | * 9 | * File FMTABLE.CPP 10 | * 11 | * Modification History: 12 | * 13 | * Date Name Description 14 | * 03/25/97 clhuang Initial Implementation. 15 | ******************************************************************************** 16 | */ 17 | 18 | #include "unicode/utypes.h" 19 | 20 | #if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_CONVERSION 21 | 22 | #include "unicode/fmtable.h" 23 | 24 | // ***************************************************************************** 25 | // class Formattable 26 | // ***************************************************************************** 27 | 28 | U_NAMESPACE_BEGIN 29 | 30 | // ------------------------------------- 31 | // Creates a formattable object with a char* string. 32 | // This API is useless. The API that takes a UnicodeString is actually just as good. 33 | // This is just a grandfathered API. 34 | 35 | Formattable::Formattable(const char* stringToCopy) 36 | { 37 | init(); 38 | fType = kString; 39 | fValue.fString = new UnicodeString(stringToCopy); 40 | } 41 | 42 | U_NAMESPACE_END 43 | 44 | #endif /* #if !UCONFIG_NO_FORMATTING || !UCONFIG_NO_CONVERSION */ 45 | 46 | //eof 47 | -------------------------------------------------------------------------------- /vendor/icu/i18n/fmtableimp.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2010-2014, International Business Machines Corporation and * 6 | * others. All Rights Reserved. * 7 | ******************************************************************************* 8 | */ 9 | 10 | #ifndef FMTABLEIMP_H 11 | #define FMTABLEIMP_H 12 | 13 | #include "number_decimalquantity.h" 14 | 15 | #if !UCONFIG_NO_FORMATTING 16 | 17 | U_NAMESPACE_BEGIN 18 | 19 | /** 20 | * Maximum int64_t value that can be stored in a double without chancing losing precision. 21 | * IEEE doubles have 53 bits of mantissa, 10 bits exponent, 1 bit sign. 22 | * IBM Mainframes have 56 bits of mantissa, 7 bits of base 16 exponent, 1 bit sign. 23 | * Define this constant to the smallest value from those for supported platforms. 24 | * @internal 25 | */ 26 | static const int64_t MAX_INT64_IN_DOUBLE = 0x001FFFFFFFFFFFFFLL; 27 | 28 | U_NAMESPACE_END 29 | 30 | #endif // #if !UCONFIG_NO_FORMATTING 31 | #endif 32 | -------------------------------------------------------------------------------- /vendor/icu/i18n/formattedval_sbimpl.cpp: -------------------------------------------------------------------------------- 1 | // © 2018 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | #include "unicode/utypes.h" 5 | 6 | #if !UCONFIG_NO_FORMATTING 7 | 8 | // This file contains one implementation of FormattedValue. 9 | // Other independent implementations should go into their own cpp file for 10 | // better dependency modularization. 11 | 12 | #include "formattedval_impl.h" 13 | 14 | U_NAMESPACE_BEGIN 15 | 16 | 17 | FormattedValueNumberStringBuilderImpl::FormattedValueNumberStringBuilderImpl(number::impl::Field numericField) 18 | : fNumericField(numericField) { 19 | } 20 | 21 | FormattedValueNumberStringBuilderImpl::~FormattedValueNumberStringBuilderImpl() { 22 | } 23 | 24 | 25 | UnicodeString FormattedValueNumberStringBuilderImpl::toString(UErrorCode&) const { 26 | return fString.toUnicodeString(); 27 | } 28 | 29 | UnicodeString FormattedValueNumberStringBuilderImpl::toTempString(UErrorCode&) const { 30 | return fString.toTempUnicodeString(); 31 | } 32 | 33 | Appendable& FormattedValueNumberStringBuilderImpl::appendTo(Appendable& appendable, UErrorCode&) const { 34 | appendable.appendString(fString.chars(), fString.length()); 35 | return appendable; 36 | } 37 | 38 | UBool FormattedValueNumberStringBuilderImpl::nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const { 39 | // NOTE: MSVC sometimes complains when implicitly converting between bool and UBool 40 | return fString.nextPosition(cfpos, fNumericField, status) ? TRUE : FALSE; 41 | } 42 | 43 | 44 | U_NAMESPACE_END 45 | 46 | #endif /* #if !UCONFIG_NO_FORMATTING */ 47 | -------------------------------------------------------------------------------- /vendor/icu/i18n/inputext.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2005-2008, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | */ 9 | 10 | #ifndef __INPUTEXT_H 11 | #define __INPUTEXT_H 12 | 13 | /** 14 | * \file 15 | * \internal 16 | * 17 | * This is an internal header for the Character Set Detection code. The 18 | * name is probably too generic... 19 | */ 20 | 21 | 22 | #include "unicode/uobject.h" 23 | 24 | #if !UCONFIG_NO_CONVERSION 25 | 26 | U_NAMESPACE_BEGIN 27 | 28 | class InputText : public UMemory 29 | { 30 | // Prevent copying 31 | InputText(const InputText &); 32 | public: 33 | InputText(UErrorCode &status); 34 | ~InputText(); 35 | 36 | void setText(const char *in, int32_t len); 37 | void setDeclaredEncoding(const char *encoding, int32_t len); 38 | UBool isSet() const; 39 | void MungeInput(UBool fStripTags); 40 | 41 | // The text to be checked. Markup will have been 42 | // removed if appropriate. 43 | uint8_t *fInputBytes; 44 | int32_t fInputLen; // Length of the byte data in fInputBytes. 45 | // byte frequency statistics for the input text. 46 | // Value is percent, not absolute. 47 | // Value is rounded up, so zero really means zero occurences. 48 | int16_t *fByteStats; 49 | UBool fC1Bytes; // True if any bytes in the range 0x80 - 0x9F are in the input;false by default 50 | char *fDeclaredEncoding; 51 | 52 | const uint8_t *fRawInput; // Original, untouched input bytes. 53 | // If user gave us a byte array, this is it. 54 | // If user gave us a stream, it's read to a 55 | // buffer here. 56 | int32_t fRawLength; // Length of data in fRawInput array. 57 | 58 | }; 59 | 60 | U_NAMESPACE_END 61 | 62 | #endif 63 | #endif /* __INPUTEXT_H */ 64 | -------------------------------------------------------------------------------- /vendor/icu/i18n/measure.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (c) 2004-2014, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * Author: Alan Liu 9 | * Created: April 26, 2004 10 | * Since: ICU 3.0 11 | ********************************************************************** 12 | */ 13 | #include "utypeinfo.h" // for 'typeid' to work 14 | 15 | #include "unicode/utypes.h" 16 | 17 | #if !UCONFIG_NO_FORMATTING 18 | 19 | #include "unicode/measure.h" 20 | #include "unicode/measunit.h" 21 | 22 | U_NAMESPACE_BEGIN 23 | 24 | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(Measure) 25 | 26 | Measure::Measure() {} 27 | 28 | Measure::Measure(const Formattable& _number, MeasureUnit* adoptedUnit, 29 | UErrorCode& ec) : 30 | number(_number), unit(adoptedUnit) { 31 | if (U_SUCCESS(ec) && 32 | (!number.isNumeric() || adoptedUnit == 0)) { 33 | ec = U_ILLEGAL_ARGUMENT_ERROR; 34 | } 35 | } 36 | 37 | Measure::Measure(const Measure& other) : 38 | UObject(other), unit(0) { 39 | *this = other; 40 | } 41 | 42 | Measure& Measure::operator=(const Measure& other) { 43 | if (this != &other) { 44 | delete unit; 45 | number = other.number; 46 | unit = (MeasureUnit*) other.unit->clone(); 47 | } 48 | return *this; 49 | } 50 | 51 | UObject *Measure::clone() const { 52 | return new Measure(*this); 53 | } 54 | 55 | Measure::~Measure() { 56 | delete unit; 57 | } 58 | 59 | UBool Measure::operator==(const UObject& other) const { 60 | if (this == &other) { // Same object, equal 61 | return TRUE; 62 | } 63 | if (typeid(*this) != typeid(other)) { // Different types, not equal 64 | return FALSE; 65 | } 66 | const Measure &m = static_cast(other); 67 | return number == m.number && 68 | ((unit == NULL) == (m.unit == NULL)) && 69 | (unit == NULL || *unit == *m.unit); 70 | } 71 | 72 | U_NAMESPACE_END 73 | 74 | #endif // !UCONFIG_NO_FORMATTING 75 | -------------------------------------------------------------------------------- /vendor/icu/i18n/msgfmt_impl.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2007-2008, International Business Machines Corporation and 6 | * others. All Rights Reserved. * 7 | ******************************************************************************* 8 | * 9 | * File MSGFMT.H 10 | * 11 | ******************************************************************************* 12 | */ 13 | 14 | #ifndef __MSGFMT_IMPL_H__ 15 | #define __MSGFMT_IMPL_H__ 16 | 17 | #include "unicode/utypes.h" 18 | 19 | #if !UCONFIG_NO_FORMATTING 20 | 21 | #include "unicode/msgfmt.h" 22 | #include "uvector.h" 23 | #include "unicode/strenum.h" 24 | 25 | U_NAMESPACE_BEGIN 26 | 27 | class FormatNameEnumeration : public StringEnumeration { 28 | public: 29 | FormatNameEnumeration(UVector *fFormatNames, UErrorCode& status); 30 | virtual ~FormatNameEnumeration(); 31 | static UClassID U_EXPORT2 getStaticClassID(void); 32 | virtual UClassID getDynamicClassID(void) const; 33 | virtual const UnicodeString* snext(UErrorCode& status); 34 | virtual void reset(UErrorCode& status); 35 | virtual int32_t count(UErrorCode& status) const; 36 | private: 37 | int32_t pos; 38 | UVector *fFormatNames; 39 | }; 40 | 41 | U_NAMESPACE_END 42 | 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /vendor/icu/i18n/nounit.cpp: -------------------------------------------------------------------------------- 1 | // © 2017 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | #include "unicode/nounit.h" 5 | #include "uassert.h" 6 | 7 | #if !UCONFIG_NO_FORMATTING 8 | 9 | U_NAMESPACE_BEGIN 10 | 11 | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(NoUnit) 12 | 13 | NoUnit U_EXPORT2 NoUnit::base() { 14 | return NoUnit("base"); 15 | } 16 | 17 | NoUnit U_EXPORT2 NoUnit::percent() { 18 | return NoUnit("percent"); 19 | } 20 | 21 | NoUnit U_EXPORT2 NoUnit::permille() { 22 | return NoUnit("permille"); 23 | } 24 | 25 | NoUnit::NoUnit(const char* subtype) { 26 | initNoUnit(subtype); 27 | } 28 | 29 | NoUnit::NoUnit(const NoUnit& other) : MeasureUnit(other) { 30 | } 31 | 32 | UObject* NoUnit::clone() const { 33 | return new NoUnit(*this); 34 | } 35 | 36 | NoUnit::~NoUnit() { 37 | } 38 | 39 | 40 | U_NAMESPACE_END 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /vendor/icu/i18n/nultrans.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (c) 2000-2005, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * Date Name Description 9 | * 01/11/2000 aliu Creation. 10 | ********************************************************************** 11 | */ 12 | 13 | #include "unicode/utypes.h" 14 | 15 | #if !UCONFIG_NO_TRANSLITERATION 16 | 17 | #include "nultrans.h" 18 | 19 | U_NAMESPACE_BEGIN 20 | 21 | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(NullTransliterator) 22 | 23 | NullTransliterator::NullTransliterator() : Transliterator(UNICODE_STRING_SIMPLE("Any-Null"), 0) {} 24 | 25 | NullTransliterator::~NullTransliterator() {} 26 | 27 | Transliterator* NullTransliterator::clone(void) const { 28 | return new NullTransliterator(); 29 | } 30 | 31 | void NullTransliterator::handleTransliterate(Replaceable& /*text*/, UTransPosition& offsets, 32 | UBool /*isIncremental*/) const { 33 | offsets.start = offsets.limit; 34 | } 35 | 36 | U_NAMESPACE_END 37 | 38 | #endif /* #if !UCONFIG_NO_TRANSLITERATION */ 39 | -------------------------------------------------------------------------------- /vendor/icu/i18n/nultrans.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (c) 2000-2007, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * Date Name Description 9 | * 01/11/2000 aliu Creation. 10 | ********************************************************************** 11 | */ 12 | #ifndef NULTRANS_H 13 | #define NULTRANS_H 14 | 15 | #include "unicode/utypes.h" 16 | 17 | #if !UCONFIG_NO_TRANSLITERATION 18 | 19 | #include "unicode/translit.h" 20 | 21 | U_NAMESPACE_BEGIN 22 | 23 | /** 24 | * A transliterator that leaves text unchanged. 25 | * @author Alan Liu 26 | * @internal Use transliterator factory methods instead since this class will be removed in that release. 27 | */ 28 | class NullTransliterator : public Transliterator { 29 | 30 | public: 31 | 32 | /** 33 | * Constructs a transliterator. 34 | * @internal Use transliterator factory methods instead since this class will be removed in that release. 35 | */ 36 | NullTransliterator(); 37 | 38 | /** 39 | * Destructor. 40 | * @internal Use transliterator factory methods instead since this class will be removed in that release. 41 | */ 42 | virtual ~NullTransliterator(); 43 | 44 | /** 45 | * Transliterator API. 46 | * @internal Use transliterator factory methods instead since this class will be removed in that release. 47 | */ 48 | virtual Transliterator* clone(void) const; 49 | 50 | /** 51 | * Implements {@link Transliterator#handleTransliterate}. 52 | * @internal Use transliterator factory methods instead since this class will be removed in that release. 53 | */ 54 | virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, 55 | UBool isIncremental) const; 56 | 57 | /** 58 | * ICU "poor man's RTTI", returns a UClassID for the actual class. 59 | */ 60 | virtual UClassID getDynamicClassID() const; 61 | 62 | /** 63 | * ICU "poor man's RTTI", returns a UClassID for this class. 64 | */ 65 | U_I18N_API static UClassID U_EXPORT2 getStaticClassID(); 66 | 67 | }; 68 | 69 | U_NAMESPACE_END 70 | 71 | #endif /* #if !UCONFIG_NO_TRANSLITERATION */ 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /vendor/icu/i18n/number_currencysymbols.h: -------------------------------------------------------------------------------- 1 | // © 2018 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | #include "unicode/utypes.h" 5 | 6 | #if !UCONFIG_NO_FORMATTING 7 | #ifndef __SOURCE_NUMBER_CURRENCYSYMBOLS_H__ 8 | #define __SOURCE_NUMBER_CURRENCYSYMBOLS_H__ 9 | 10 | #include "numparse_types.h" 11 | #include "charstr.h" 12 | #include "number_decimfmtprops.h" 13 | 14 | U_NAMESPACE_BEGIN namespace number { 15 | namespace impl { 16 | 17 | 18 | // Exported as U_I18N_API for tests 19 | class U_I18N_API CurrencySymbols : public UMemory { 20 | public: 21 | CurrencySymbols() = default; // default constructor: leaves class in valid but undefined state 22 | 23 | /** Creates an instance in which all symbols are loaded from data. */ 24 | CurrencySymbols(CurrencyUnit currency, const Locale& locale, UErrorCode& status); 25 | 26 | /** Creates an instance in which some symbols might be pre-populated. */ 27 | CurrencySymbols(CurrencyUnit currency, const Locale& locale, const DecimalFormatSymbols& symbols, 28 | UErrorCode& status); 29 | 30 | const char16_t* getIsoCode() const; 31 | 32 | UnicodeString getNarrowCurrencySymbol(UErrorCode& status) const; 33 | 34 | UnicodeString getCurrencySymbol(UErrorCode& status) const; 35 | 36 | UnicodeString getIntlCurrencySymbol(UErrorCode& status) const; 37 | 38 | UnicodeString getPluralName(StandardPlural::Form plural, UErrorCode& status) const; 39 | 40 | protected: 41 | // Required fields: 42 | CurrencyUnit fCurrency; 43 | CharString fLocaleName; 44 | 45 | // Optional fields: 46 | UnicodeString fCurrencySymbol; 47 | UnicodeString fIntlCurrencySymbol; 48 | 49 | UnicodeString loadSymbol(UCurrNameStyle selector, UErrorCode& status) const; 50 | }; 51 | 52 | 53 | /** 54 | * Resolves the effective currency from the property bag. 55 | */ 56 | CurrencyUnit 57 | resolveCurrency(const DecimalFormatProperties& properties, const Locale& locale, UErrorCode& status); 58 | 59 | 60 | } // namespace impl 61 | } // namespace numparse 62 | U_NAMESPACE_END 63 | 64 | #endif //__SOURCE_NUMBER_CURRENCYSYMBOLS_H__ 65 | #endif /* #if !UCONFIG_NO_FORMATTING */ 66 | -------------------------------------------------------------------------------- /vendor/icu/i18n/number_multiplier.h: -------------------------------------------------------------------------------- 1 | // © 2018 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | #include "unicode/utypes.h" 5 | 6 | #if !UCONFIG_NO_FORMATTING 7 | #ifndef __SOURCE_NUMBER_MULTIPLIER_H__ 8 | #define __SOURCE_NUMBER_MULTIPLIER_H__ 9 | 10 | #include "numparse_types.h" 11 | #include "number_decimfmtprops.h" 12 | 13 | U_NAMESPACE_BEGIN namespace number { 14 | namespace impl { 15 | 16 | 17 | /** 18 | * Wraps a {@link Multiplier} for use in the number formatting pipeline. 19 | */ 20 | // Exported as U_I18N_API for tests 21 | class U_I18N_API MultiplierFormatHandler : public MicroPropsGenerator, public UMemory { 22 | public: 23 | MultiplierFormatHandler() = default; // WARNING: Leaves object in an unusable state; call setAndChain() 24 | 25 | void setAndChain(const Scale& multiplier, const MicroPropsGenerator* parent); 26 | 27 | void processQuantity(DecimalQuantity& quantity, MicroProps& micros, 28 | UErrorCode& status) const U_OVERRIDE; 29 | 30 | private: 31 | Scale fMultiplier; 32 | const MicroPropsGenerator *fParent; 33 | }; 34 | 35 | 36 | /** Gets a Scale from a DecimalFormatProperties. In Java, defined in RoundingUtils.java */ 37 | static inline Scale scaleFromProperties(const DecimalFormatProperties& properties) { 38 | int32_t magnitudeMultiplier = properties.magnitudeMultiplier + properties.multiplierScale; 39 | int32_t arbitraryMultiplier = properties.multiplier; 40 | if (magnitudeMultiplier != 0 && arbitraryMultiplier != 1) { 41 | return Scale::byDoubleAndPowerOfTen(arbitraryMultiplier, magnitudeMultiplier); 42 | } else if (magnitudeMultiplier != 0) { 43 | return Scale::powerOfTen(magnitudeMultiplier); 44 | } else if (arbitraryMultiplier != 1) { 45 | return Scale::byDouble(arbitraryMultiplier); 46 | } else { 47 | return Scale::none(); 48 | } 49 | } 50 | 51 | 52 | } // namespace impl 53 | } // namespace number 54 | U_NAMESPACE_END 55 | 56 | #endif //__SOURCE_NUMBER_MULTIPLIER_H__ 57 | #endif /* #if !UCONFIG_NO_FORMATTING */ 58 | -------------------------------------------------------------------------------- /vendor/icu/i18n/number_output.cpp: -------------------------------------------------------------------------------- 1 | // © 2019 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | #include "unicode/utypes.h" 5 | 6 | #if !UCONFIG_NO_FORMATTING 7 | 8 | #include "unicode/numberformatter.h" 9 | #include "number_utypes.h" 10 | #include "util.h" 11 | #include "number_decimalquantity.h" 12 | 13 | U_NAMESPACE_BEGIN 14 | namespace number { 15 | 16 | 17 | UPRV_FORMATTED_VALUE_SUBCLASS_AUTO_IMPL(FormattedNumber) 18 | 19 | #define UPRV_NOARG 20 | 21 | UBool FormattedNumber::nextFieldPosition(FieldPosition& fieldPosition, UErrorCode& status) const { 22 | UPRV_FORMATTED_VALUE_METHOD_GUARD(FALSE) 23 | // NOTE: MSVC sometimes complains when implicitly converting between bool and UBool 24 | return fData->getStringRef().nextFieldPosition(fieldPosition, status) ? TRUE : FALSE; 25 | } 26 | 27 | void FormattedNumber::getAllFieldPositions(FieldPositionIterator& iterator, UErrorCode& status) const { 28 | FieldPositionIteratorHandler fpih(&iterator, status); 29 | getAllFieldPositionsImpl(fpih, status); 30 | } 31 | 32 | void FormattedNumber::getAllFieldPositionsImpl(FieldPositionIteratorHandler& fpih, 33 | UErrorCode& status) const { 34 | UPRV_FORMATTED_VALUE_METHOD_GUARD(UPRV_NOARG) 35 | fData->getStringRef().getAllFieldPositions(fpih, status); 36 | } 37 | 38 | void FormattedNumber::getDecimalQuantity(impl::DecimalQuantity& output, UErrorCode& status) const { 39 | UPRV_FORMATTED_VALUE_METHOD_GUARD(UPRV_NOARG) 40 | output = fData->quantity; 41 | } 42 | 43 | 44 | impl::UFormattedNumberData::~UFormattedNumberData() = default; 45 | 46 | 47 | } // namespace number 48 | U_NAMESPACE_END 49 | 50 | #endif /* #if !UCONFIG_NO_FORMATTING */ 51 | -------------------------------------------------------------------------------- /vendor/icu/i18n/number_scientific.h: -------------------------------------------------------------------------------- 1 | // © 2017 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | #include "unicode/utypes.h" 5 | 6 | #if !UCONFIG_NO_FORMATTING 7 | #ifndef __NUMBER_SCIENTIFIC_H__ 8 | #define __NUMBER_SCIENTIFIC_H__ 9 | 10 | #include "number_types.h" 11 | 12 | U_NAMESPACE_BEGIN namespace number { 13 | namespace impl { 14 | 15 | // Forward-declare 16 | class ScientificHandler; 17 | 18 | class U_I18N_API ScientificModifier : public UMemory, public Modifier { 19 | public: 20 | ScientificModifier(); 21 | 22 | void set(int32_t exponent, const ScientificHandler *handler); 23 | 24 | int32_t apply(NumberStringBuilder &output, int32_t leftIndex, int32_t rightIndex, 25 | UErrorCode &status) const U_OVERRIDE; 26 | 27 | int32_t getPrefixLength() const U_OVERRIDE; 28 | 29 | int32_t getCodePointCount() const U_OVERRIDE; 30 | 31 | bool isStrong() const U_OVERRIDE; 32 | 33 | bool containsField(UNumberFormatFields field) const U_OVERRIDE; 34 | 35 | void getParameters(Parameters& output) const U_OVERRIDE; 36 | 37 | bool semanticallyEquivalent(const Modifier& other) const U_OVERRIDE; 38 | 39 | private: 40 | int32_t fExponent; 41 | const ScientificHandler *fHandler; 42 | }; 43 | 44 | class ScientificHandler : public UMemory, public MicroPropsGenerator, public MultiplierProducer { 45 | public: 46 | ScientificHandler(const Notation *notation, const DecimalFormatSymbols *symbols, 47 | const MicroPropsGenerator *parent); 48 | 49 | void 50 | processQuantity(DecimalQuantity &quantity, MicroProps µs, UErrorCode &status) const U_OVERRIDE; 51 | 52 | int32_t getMultiplier(int32_t magnitude) const U_OVERRIDE; 53 | 54 | private: 55 | const Notation::ScientificSettings& fSettings; 56 | const DecimalFormatSymbols *fSymbols; 57 | const MicroPropsGenerator *fParent; 58 | 59 | friend class ScientificModifier; 60 | }; 61 | 62 | } // namespace impl 63 | } // namespace number 64 | U_NAMESPACE_END 65 | 66 | #endif //__NUMBER_SCIENTIFIC_H__ 67 | 68 | #endif /* #if !UCONFIG_NO_FORMATTING */ 69 | -------------------------------------------------------------------------------- /vendor/icu/i18n/number_utypes.h: -------------------------------------------------------------------------------- 1 | // © 2018 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | #include "unicode/utypes.h" 5 | 6 | #if !UCONFIG_NO_FORMATTING 7 | #ifndef __SOURCE_NUMBER_UTYPES_H__ 8 | #define __SOURCE_NUMBER_UTYPES_H__ 9 | 10 | #include "unicode/numberformatter.h" 11 | #include "number_types.h" 12 | #include "number_decimalquantity.h" 13 | #include "number_stringbuilder.h" 14 | #include "formattedval_impl.h" 15 | 16 | U_NAMESPACE_BEGIN namespace number { 17 | namespace impl { 18 | 19 | 20 | /** Helper function used in upluralrules.cpp */ 21 | const DecimalQuantity* validateUFormattedNumberToDecimalQuantity( 22 | const UFormattedNumber* uresult, UErrorCode& status); 23 | 24 | 25 | /** 26 | * Struct for data used by FormattedNumber. 27 | * 28 | * This struct is held internally by the C++ version FormattedNumber since the member types are not 29 | * declared in the public header file. 30 | * 31 | * The DecimalQuantity is not currently being used by FormattedNumber, but at some point it could be used 32 | * to add a toDecNumber() or similar method. 33 | */ 34 | class UFormattedNumberData : public FormattedValueNumberStringBuilderImpl { 35 | public: 36 | UFormattedNumberData() : FormattedValueNumberStringBuilderImpl(0) {} 37 | virtual ~UFormattedNumberData(); 38 | 39 | DecimalQuantity quantity; 40 | }; 41 | 42 | 43 | } // namespace impl 44 | } // namespace number 45 | U_NAMESPACE_END 46 | 47 | #endif //__SOURCE_NUMBER_UTYPES_H__ 48 | #endif /* #if !UCONFIG_NO_FORMATTING */ 49 | -------------------------------------------------------------------------------- /vendor/icu/i18n/numparse_scientific.h: -------------------------------------------------------------------------------- 1 | // © 2018 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | #include "unicode/utypes.h" 5 | 6 | #if !UCONFIG_NO_FORMATTING 7 | #ifndef __NUMPARSE_SCIENTIFIC_H__ 8 | #define __NUMPARSE_SCIENTIFIC_H__ 9 | 10 | #include "numparse_types.h" 11 | #include "numparse_decimal.h" 12 | #include "unicode/numberformatter.h" 13 | 14 | using icu::number::impl::Grouper; 15 | 16 | U_NAMESPACE_BEGIN namespace numparse { 17 | namespace impl { 18 | 19 | 20 | class ScientificMatcher : public NumberParseMatcher, public UMemory { 21 | public: 22 | ScientificMatcher() = default; // WARNING: Leaves the object in an unusable state 23 | 24 | ScientificMatcher(const DecimalFormatSymbols& dfs, const Grouper& grouper); 25 | 26 | bool match(StringSegment& segment, ParsedNumber& result, UErrorCode& status) const override; 27 | 28 | bool smokeTest(const StringSegment& segment) const override; 29 | 30 | UnicodeString toString() const override; 31 | 32 | private: 33 | UnicodeString fExponentSeparatorString; 34 | DecimalMatcher fExponentMatcher; 35 | UnicodeString fCustomMinusSign; 36 | UnicodeString fCustomPlusSign; 37 | }; 38 | 39 | 40 | } // namespace impl 41 | } // namespace numparse 42 | U_NAMESPACE_END 43 | 44 | #endif //__NUMPARSE_SCIENTIFIC_H__ 45 | #endif /* #if !UCONFIG_NO_FORMATTING */ 46 | -------------------------------------------------------------------------------- /vendor/icu/i18n/numparse_stringsegment.h: -------------------------------------------------------------------------------- 1 | // © 2018 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | #include "unicode/utypes.h" 5 | 6 | #if !UCONFIG_NO_FORMATTING 7 | #ifndef __NUMPARSE_STRINGSEGMENT_H__ 8 | #define __NUMPARSE_STRINGSEGMENT_H__ 9 | 10 | #include "numparse_types.h" 11 | #include "number_types.h" 12 | #include "unicode/unistr.h" 13 | 14 | U_NAMESPACE_BEGIN 15 | namespace numparse { 16 | namespace impl { 17 | 18 | 19 | } // namespace impl 20 | } // namespace numparse 21 | U_NAMESPACE_END 22 | 23 | #endif //__NUMPARSE_STRINGSEGMENT_H__ 24 | #endif /* #if !UCONFIG_NO_FORMATTING */ 25 | -------------------------------------------------------------------------------- /vendor/icu/i18n/numparse_utils.h: -------------------------------------------------------------------------------- 1 | // © 2018 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | #include "unicode/utypes.h" 5 | 6 | #if !UCONFIG_NO_FORMATTING 7 | #ifndef __NUMPARSE_UTILS_H__ 8 | #define __NUMPARSE_UTILS_H__ 9 | 10 | #include "numparse_types.h" 11 | #include "unicode/uniset.h" 12 | 13 | U_NAMESPACE_BEGIN namespace numparse { 14 | namespace impl { 15 | namespace utils { 16 | 17 | 18 | inline static void putLeadCodePoints(const UnicodeSet* input, UnicodeSet* output) { 19 | for (int32_t i = 0; i < input->getRangeCount(); i++) { 20 | output->add(input->getRangeStart(i), input->getRangeEnd(i)); 21 | } 22 | // TODO: ANDY: How to iterate over the strings in ICU4C UnicodeSet? 23 | } 24 | 25 | inline static void putLeadCodePoint(const UnicodeString& input, UnicodeSet* output) { 26 | if (!input.isEmpty()) { 27 | output->add(input.char32At(0)); 28 | } 29 | } 30 | 31 | inline static void copyCurrencyCode(UChar* dest, const UChar* src) { 32 | uprv_memcpy(dest, src, sizeof(UChar) * 3); 33 | dest[3] = 0; 34 | } 35 | 36 | 37 | } // namespace utils 38 | } // namespace impl 39 | } // namespace numparse 40 | U_NAMESPACE_END 41 | 42 | #endif //__NUMPARSE_UTILS_H__ 43 | #endif /* #if !UCONFIG_NO_FORMATTING */ 44 | -------------------------------------------------------------------------------- /vendor/icu/i18n/numsys_impl.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2015, International Business Machines Corporation and 6 | * others. All Rights Reserved. * 7 | ******************************************************************************* 8 | * 9 | * File NUMSYS_IMPL.H 10 | * 11 | ******************************************************************************* 12 | */ 13 | 14 | #ifndef __NUMSYS_IMPL_H__ 15 | #define __NUMSYS_IMPL_H__ 16 | 17 | #include "unicode/utypes.h" 18 | 19 | #if !UCONFIG_NO_FORMATTING 20 | 21 | #include "unicode/numsys.h" 22 | #include "uvector.h" 23 | #include "unicode/strenum.h" 24 | 25 | U_NAMESPACE_BEGIN 26 | 27 | class NumsysNameEnumeration : public StringEnumeration { 28 | public: 29 | NumsysNameEnumeration(UErrorCode& status); 30 | 31 | virtual ~NumsysNameEnumeration(); 32 | static UClassID U_EXPORT2 getStaticClassID(void); 33 | virtual UClassID getDynamicClassID(void) const override; 34 | virtual const UnicodeString* snext(UErrorCode& status) override; 35 | virtual void reset(UErrorCode& status) override; 36 | virtual int32_t count(UErrorCode& status) const override; 37 | private: 38 | int32_t pos; 39 | }; 40 | 41 | U_NAMESPACE_END 42 | 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /vendor/icu/i18n/regexst.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | // 4 | // regexst.h 5 | // 6 | // Copyright (C) 2003-2010, International Business Machines Corporation and others. 7 | // All Rights Reserved. 8 | // 9 | // This file contains declarations for the class RegexStaticSets 10 | // 11 | // This class is internal to the regular expression implementation. 12 | // For the public Regular Expression API, see the file "unicode/regex.h" 13 | // 14 | // RegexStaticSets groups together the common UnicodeSets that are needed 15 | // for compiling or executing RegularExpressions. This grouping simplifies 16 | // the thread safe lazy creation and sharing of these sets across 17 | // all instances of regular expressions. 18 | // 19 | 20 | #ifndef REGEXST_H 21 | #define REGEXST_H 22 | 23 | #include "unicode/utypes.h" 24 | #include "unicode/utext.h" 25 | #if !UCONFIG_NO_REGULAR_EXPRESSIONS 26 | 27 | #include "regeximp.h" 28 | 29 | U_NAMESPACE_BEGIN 30 | 31 | class UnicodeSet; 32 | 33 | 34 | class RegexStaticSets : public UMemory { 35 | public: 36 | static RegexStaticSets *gStaticSets; // Ptr to all lazily initialized constant 37 | // shared sets. 38 | 39 | RegexStaticSets(UErrorCode *status); 40 | ~RegexStaticSets(); 41 | static void initGlobals(UErrorCode *status); 42 | static UBool cleanup(); 43 | 44 | UnicodeSet *fPropSets[URX_LAST_SET]; // The sets for common regex items, e.g. \s 45 | Regex8BitSet fPropSets8[URX_LAST_SET]; // Fast bitmap sets for latin-1 range for above. 46 | 47 | UnicodeSet fRuleSets[10]; // Sets used while parsing regexp patterns. 48 | UnicodeSet fUnescapeCharSet; // Set of chars handled by unescape when 49 | // encountered with a \ in a pattern. 50 | UnicodeSet *fRuleDigitsAlias; 51 | UText *fEmptyText; // An empty string, to be used when a matcher 52 | // is created with no input. 53 | 54 | }; 55 | 56 | 57 | U_NAMESPACE_END 58 | #endif // !UCONFIG_NO_REGULAR_EXPRESSIONS 59 | #endif // REGEXST_H 60 | -------------------------------------------------------------------------------- /vendor/icu/i18n/regextxt.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /******************************************************************** 4 | * COPYRIGHT: 5 | * Copyright (c) 2008-2011, International Business Machines Corporation and 6 | * others. All Rights Reserved. 7 | ********************************************************************/ 8 | // 9 | // file: regextxt.cpp 10 | // 11 | // This file contains utility code for supporting UText in the regular expression engine. 12 | // 13 | 14 | #include "unicode/utf.h" 15 | #include "regextxt.h" 16 | 17 | U_NAMESPACE_BEGIN 18 | 19 | U_CFUNC UChar U_CALLCONV 20 | uregex_utext_unescape_charAt(int32_t offset, void *ct) { 21 | struct URegexUTextUnescapeCharContext *context = (struct URegexUTextUnescapeCharContext *)ct; 22 | UChar32 c; 23 | if (offset == context->lastOffset + 1) { 24 | c = UTEXT_NEXT32(context->text); 25 | context->lastOffset++; 26 | } else if (offset == context->lastOffset) { 27 | c = UTEXT_PREVIOUS32(context->text); 28 | UTEXT_NEXT32(context->text); 29 | } else { 30 | utext_moveIndex32(context->text, offset - context->lastOffset - 1); 31 | c = UTEXT_NEXT32(context->text); 32 | context->lastOffset = offset; 33 | } 34 | 35 | // !!!: Doesn't handle characters outside BMP 36 | if (U_IS_BMP(c)) { 37 | return (UChar)c; 38 | } else { 39 | return 0; 40 | } 41 | } 42 | 43 | U_CFUNC UChar U_CALLCONV 44 | uregex_ucstr_unescape_charAt(int32_t offset, void *context) { 45 | return ((UChar *)context)[offset]; 46 | } 47 | 48 | U_NAMESPACE_END 49 | -------------------------------------------------------------------------------- /vendor/icu/i18n/regextxt.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /******************************************************************** 4 | * COPYRIGHT: 5 | * Copyright (c) 2008-2010, International Business Machines Corporation and 6 | * others. All Rights Reserved. 7 | ********************************************************************/ 8 | // 9 | // file: regextxt.h 10 | // 11 | // This file contains utility code for supporting UText in the regular expression engine. 12 | // 13 | // This class is internal to the regular expression implementation. 14 | // For the public Regular Expression API, see the file "unicode/regex.h" 15 | // 16 | 17 | #ifndef _REGEXTXT_H 18 | #define _REGEXTXT_H 19 | 20 | #include "unicode/utypes.h" 21 | #include "unicode/utext.h" 22 | 23 | U_NAMESPACE_BEGIN 24 | 25 | #define UTEXT_USES_U16(ut) (NULL==((ut)->pFuncs->mapNativeIndexToUTF16)) 26 | 27 | #if 0 28 | #define REGEX_DISABLE_CHUNK_MODE 1 29 | #endif 30 | 31 | #ifdef REGEX_DISABLE_CHUNK_MODE 32 | # define UTEXT_FULL_TEXT_IN_CHUNK(ut,len) (FALSE) 33 | #else 34 | # define UTEXT_FULL_TEXT_IN_CHUNK(ut,len) ((0==((ut)->chunkNativeStart))&&((len)==((ut)->chunkNativeLimit))&&((len)==((ut)->nativeIndexingLimit))) 35 | #endif 36 | 37 | struct URegexUTextUnescapeCharContext { 38 | UText *text; 39 | int32_t lastOffset; 40 | }; 41 | #define U_REGEX_UTEXT_UNESCAPE_CONTEXT(text) { (text), -1 } 42 | 43 | U_CFUNC UChar U_CALLCONV 44 | uregex_utext_unescape_charAt(int32_t offset, void * /* struct URegexUTextUnescapeCharContext* */ context); 45 | U_CFUNC UChar U_CALLCONV 46 | uregex_ucstr_unescape_charAt(int32_t offset, void * /* UChar* */ context); 47 | 48 | U_NAMESPACE_END 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /vendor/icu/i18n/region_impl.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2013, International Business Machines Corporation and * 6 | * others. All Rights Reserved. * 7 | ******************************************************************************* 8 | * 9 | * File REGION_IMPL.H 10 | * 11 | ******************************************************************************* 12 | */ 13 | 14 | #ifndef __REGION_IMPL_H__ 15 | #define __REGION_IMPL_H__ 16 | 17 | #include "unicode/utypes.h" 18 | 19 | #if !UCONFIG_NO_FORMATTING 20 | 21 | #include "uvector.h" 22 | #include "unicode/strenum.h" 23 | 24 | U_NAMESPACE_BEGIN 25 | 26 | 27 | class RegionNameEnumeration : public StringEnumeration { 28 | public: 29 | RegionNameEnumeration(UVector *fNameList, UErrorCode& status); 30 | virtual ~RegionNameEnumeration(); 31 | static UClassID U_EXPORT2 getStaticClassID(void); 32 | virtual UClassID getDynamicClassID(void) const; 33 | virtual const UnicodeString* snext(UErrorCode& status); 34 | virtual void reset(UErrorCode& status); 35 | virtual int32_t count(UErrorCode& status) const; 36 | private: 37 | int32_t pos; 38 | UVector *fRegionNames; 39 | }; 40 | 41 | U_NAMESPACE_END 42 | 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /vendor/icu/i18n/remtrans.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (c) 2001-2007, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * Date Name Description 9 | * 04/02/2001 aliu Creation. 10 | ********************************************************************** 11 | */ 12 | #ifndef REMTRANS_H 13 | #define REMTRANS_H 14 | 15 | #include "unicode/utypes.h" 16 | 17 | #if !UCONFIG_NO_TRANSLITERATION 18 | 19 | #include "unicode/translit.h" 20 | 21 | U_NAMESPACE_BEGIN 22 | 23 | /** 24 | * A transliterator that removes text. 25 | * @author Alan Liu 26 | */ 27 | class RemoveTransliterator : public Transliterator { 28 | 29 | public: 30 | 31 | /** 32 | * Constructs a transliterator. 33 | */ 34 | RemoveTransliterator(); 35 | 36 | /** 37 | * Destructor. 38 | */ 39 | virtual ~RemoveTransliterator(); 40 | 41 | /** 42 | * System registration hook. 43 | */ 44 | static void registerIDs(); 45 | 46 | /** 47 | * Transliterator API. 48 | * @return A copy of the object. 49 | */ 50 | virtual Transliterator* clone(void) const; 51 | 52 | /** 53 | * Implements {@link Transliterator#handleTransliterate}. 54 | * @param text the buffer holding transliterated and 55 | * untransliterated text 56 | * @param offset the start and limit of the text, the position 57 | * of the cursor, and the start and limit of transliteration. 58 | * @param incremental if true, assume more text may be coming after 59 | * pos.contextLimit. Otherwise, assume the text is complete. 60 | */ 61 | virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, 62 | UBool isIncremental) const; 63 | 64 | /** 65 | * ICU "poor man's RTTI", returns a UClassID for the actual class. 66 | */ 67 | virtual UClassID getDynamicClassID() const; 68 | 69 | /** 70 | * ICU "poor man's RTTI", returns a UClassID for this class. 71 | */ 72 | U_I18N_API static UClassID U_EXPORT2 getStaticClassID(); 73 | 74 | }; 75 | 76 | U_NAMESPACE_END 77 | 78 | #endif /* #if !UCONFIG_NO_TRANSLITERATION */ 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /vendor/icu/i18n/sharedbreakiterator.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2013-2014, International Business Machines Corporation and * 6 | * others. All Rights Reserved. * 7 | ******************************************************************************* 8 | * 9 | * File RELDATEFMTTEST.CPP 10 | * 11 | ******************************************************************************* 12 | */ 13 | #include "sharedbreakiterator.h" 14 | #include "unicode/brkiter.h" 15 | 16 | #if !UCONFIG_NO_BREAK_ITERATION 17 | 18 | U_NAMESPACE_BEGIN 19 | 20 | SharedBreakIterator::SharedBreakIterator( 21 | BreakIterator *biToAdopt) : ptr(biToAdopt) { } 22 | 23 | SharedBreakIterator::~SharedBreakIterator() { 24 | delete ptr; 25 | } 26 | 27 | U_NAMESPACE_END 28 | 29 | #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ 30 | -------------------------------------------------------------------------------- /vendor/icu/i18n/sharedbreakiterator.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * Copyright (C) 2014, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ****************************************************************************** 8 | * sharedbreakiterator.h 9 | */ 10 | 11 | #ifndef __SHARED_BREAKITERATOR_H__ 12 | #define __SHARED_BREAKITERATOR_H__ 13 | 14 | #include "unicode/utypes.h" 15 | #include "sharedobject.h" 16 | 17 | #if !UCONFIG_NO_BREAK_ITERATION 18 | 19 | U_NAMESPACE_BEGIN 20 | 21 | class BreakIterator; 22 | 23 | // SharedBreakIterator encapsulates a shared BreakIterator. Because 24 | // BreakIterator has mutable semantics, clients must ensure that all uses 25 | // of a particular shared BreakIterator is protected by the same mutex 26 | // ensuring that only one thread at a time gets access to that shared 27 | // BreakIterator. Clients can accomplish this by creating a mutex for all 28 | // uses of break iterator within a particular class. Then objects of that 29 | // class may then freely share break iterators among themselves. However, 30 | // these shared break iterators must never be exposed outside of that class. 31 | class U_I18N_API SharedBreakIterator : public SharedObject { 32 | public: 33 | SharedBreakIterator(BreakIterator *biToAdopt); 34 | virtual ~SharedBreakIterator(); 35 | 36 | BreakIterator *get() const { return ptr; } 37 | BreakIterator *operator->() const { return ptr; } 38 | BreakIterator &operator*() const { return *ptr; } 39 | private: 40 | BreakIterator *ptr; 41 | SharedBreakIterator(const SharedBreakIterator &); 42 | SharedBreakIterator &operator=(const SharedBreakIterator &); 43 | }; 44 | 45 | U_NAMESPACE_END 46 | 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /vendor/icu/i18n/sharedcalendar.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * Copyright (C) 2014, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ****************************************************************************** 8 | * sharedcalendar.h 9 | */ 10 | 11 | #ifndef __SHARED_CALENDAR_H__ 12 | #define __SHARED_CALENDAR_H__ 13 | 14 | #include "unicode/utypes.h" 15 | #include "sharedobject.h" 16 | 17 | U_NAMESPACE_BEGIN 18 | 19 | class Calendar; 20 | 21 | class U_I18N_API SharedCalendar : public SharedObject { 22 | public: 23 | SharedCalendar(Calendar *calToAdopt) : ptr(calToAdopt) { } 24 | virtual ~SharedCalendar(); 25 | const Calendar *get() const { return ptr; } 26 | const Calendar *operator->() const { return ptr; } 27 | const Calendar &operator*() const { return *ptr; } 28 | private: 29 | Calendar *ptr; 30 | SharedCalendar(const SharedCalendar &); 31 | SharedCalendar &operator=(const SharedCalendar &); 32 | }; 33 | 34 | U_NAMESPACE_END 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /vendor/icu/i18n/shareddateformatsymbols.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * Copyright (C) 2014, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ****************************************************************************** 8 | * shareddateformatsymbols.h 9 | */ 10 | 11 | #ifndef __SHARED_DATEFORMATSYMBOLS_H__ 12 | #define __SHARED_DATEFORMATSYMBOLS_H__ 13 | 14 | #include "unicode/utypes.h" 15 | 16 | #if !UCONFIG_NO_FORMATTING 17 | 18 | #include "sharedobject.h" 19 | #include "unicode/dtfmtsym.h" 20 | 21 | U_NAMESPACE_BEGIN 22 | 23 | 24 | class U_I18N_API SharedDateFormatSymbols : public SharedObject { 25 | public: 26 | SharedDateFormatSymbols( 27 | const Locale &loc, const char *type, UErrorCode &status) 28 | : dfs(loc, type, status) { } 29 | virtual ~SharedDateFormatSymbols(); 30 | const DateFormatSymbols &get() const { return dfs; } 31 | private: 32 | DateFormatSymbols dfs; 33 | SharedDateFormatSymbols(const SharedDateFormatSymbols &); 34 | SharedDateFormatSymbols &operator=(const SharedDateFormatSymbols &); 35 | }; 36 | 37 | U_NAMESPACE_END 38 | 39 | #endif /* !UCONFIG_NO_FORMATTING */ 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /vendor/icu/i18n/sharednumberformat.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * Copyright (C) 2014, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ****************************************************************************** 8 | * sharednumberformat.h 9 | */ 10 | 11 | #ifndef __SHARED_NUMBERFORMAT_H__ 12 | #define __SHARED_NUMBERFORMAT_H__ 13 | 14 | #include "unicode/utypes.h" 15 | #include "sharedobject.h" 16 | 17 | U_NAMESPACE_BEGIN 18 | 19 | class NumberFormat; 20 | 21 | class U_I18N_API SharedNumberFormat : public SharedObject { 22 | public: 23 | SharedNumberFormat(NumberFormat *nfToAdopt) : ptr(nfToAdopt) { } 24 | virtual ~SharedNumberFormat(); 25 | const NumberFormat *get() const { return ptr; } 26 | const NumberFormat *operator->() const { return ptr; } 27 | const NumberFormat &operator*() const { return *ptr; } 28 | private: 29 | NumberFormat *ptr; 30 | SharedNumberFormat(const SharedNumberFormat &); 31 | SharedNumberFormat &operator=(const SharedNumberFormat &); 32 | }; 33 | 34 | U_NAMESPACE_END 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /vendor/icu/i18n/sharedpluralrules.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * Copyright (C) 2014, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ****************************************************************************** 8 | * sharedpluralrules.h 9 | */ 10 | 11 | #ifndef __SHARED_PLURALRULES_H__ 12 | #define __SHARED_PLURALRULES_H__ 13 | 14 | #include "unicode/utypes.h" 15 | #include "sharedobject.h" 16 | 17 | U_NAMESPACE_BEGIN 18 | 19 | class PluralRules; 20 | 21 | class U_I18N_API SharedPluralRules : public SharedObject { 22 | public: 23 | SharedPluralRules(PluralRules *prToAdopt) : ptr(prToAdopt) { } 24 | virtual ~SharedPluralRules(); 25 | const PluralRules *operator->() const { return ptr; } 26 | const PluralRules &operator*() const { return *ptr; } 27 | private: 28 | PluralRules *ptr; 29 | SharedPluralRules(const SharedPluralRules &); 30 | SharedPluralRules &operator=(const SharedPluralRules &); 31 | }; 32 | 33 | U_NAMESPACE_END 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /vendor/icu/i18n/smpdtfst.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2009-2013, International Business Machines Corporation and * 6 | * others. All Rights Reserved. * 7 | ******************************************************************************* 8 | * 9 | * This file contains declarations for the class SimpleDateFormatStaticSets 10 | * 11 | * SimpleDateFormatStaticSets holds the UnicodeSets that are needed for lenient 12 | * parsing of literal characters in date/time strings. 13 | ******************************************************************************** 14 | */ 15 | 16 | #ifndef SMPDTFST_H 17 | #define SMPDTFST_H 18 | 19 | #include "unicode/uobject.h" 20 | #include "unicode/utypes.h" 21 | 22 | #if !UCONFIG_NO_FORMATTING 23 | 24 | #include "unicode/udat.h" 25 | 26 | U_NAMESPACE_BEGIN 27 | 28 | class UnicodeSet; 29 | 30 | 31 | class SimpleDateFormatStaticSets : public UMemory 32 | { 33 | public: 34 | SimpleDateFormatStaticSets(UErrorCode &status); 35 | ~SimpleDateFormatStaticSets(); 36 | 37 | static void initSets(UErrorCode *status); 38 | static UBool cleanup(); 39 | 40 | static UnicodeSet *getIgnorables(UDateFormatField fieldIndex); 41 | 42 | private: 43 | UnicodeSet *fDateIgnorables; 44 | UnicodeSet *fTimeIgnorables; 45 | UnicodeSet *fOtherIgnorables; 46 | }; 47 | 48 | 49 | U_NAMESPACE_END 50 | 51 | #endif // #if !UCONFIG_NO_FORMATTING 52 | #endif // SMPDTFST_H 53 | -------------------------------------------------------------------------------- /vendor/icu/i18n/tmutamt.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2008, Google, International Business Machines Corporation and * 6 | * others. All Rights Reserved. * 7 | ******************************************************************************* 8 | */ 9 | 10 | #include "unicode/tmutamt.h" 11 | 12 | #if !UCONFIG_NO_FORMATTING 13 | 14 | U_NAMESPACE_BEGIN 15 | 16 | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TimeUnitAmount) 17 | 18 | 19 | TimeUnitAmount::TimeUnitAmount(const Formattable& number, 20 | TimeUnit::UTimeUnitFields timeUnitField, 21 | UErrorCode& status) 22 | : Measure(number, TimeUnit::createInstance(timeUnitField, status), status) { 23 | } 24 | 25 | 26 | TimeUnitAmount::TimeUnitAmount(double amount, 27 | TimeUnit::UTimeUnitFields timeUnitField, 28 | UErrorCode& status) 29 | : Measure(Formattable(amount), 30 | TimeUnit::createInstance(timeUnitField, status), 31 | status) { 32 | } 33 | 34 | 35 | TimeUnitAmount::TimeUnitAmount(const TimeUnitAmount& other) 36 | : Measure(other) 37 | { 38 | } 39 | 40 | 41 | TimeUnitAmount& 42 | TimeUnitAmount::operator=(const TimeUnitAmount& other) { 43 | Measure::operator=(other); 44 | return *this; 45 | } 46 | 47 | 48 | UBool 49 | TimeUnitAmount::operator==(const UObject& other) const { 50 | return Measure::operator==(other); 51 | } 52 | 53 | UObject* 54 | TimeUnitAmount::clone() const { 55 | return new TimeUnitAmount(*this); 56 | } 57 | 58 | 59 | TimeUnitAmount::~TimeUnitAmount() { 60 | } 61 | 62 | 63 | 64 | const TimeUnit& 65 | TimeUnitAmount::getTimeUnit() const { 66 | return (const TimeUnit&) getUnit(); 67 | } 68 | 69 | 70 | TimeUnit::UTimeUnitFields 71 | TimeUnitAmount::getTimeUnitField() const { 72 | return getTimeUnit().getTimeUnitField(); 73 | } 74 | 75 | 76 | U_NAMESPACE_END 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /vendor/icu/i18n/tolowtrn.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2001-2007, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * Date Name Description 9 | * 05/24/01 aliu Creation. 10 | ********************************************************************** 11 | */ 12 | 13 | #include "unicode/utypes.h" 14 | 15 | #if !UCONFIG_NO_TRANSLITERATION 16 | 17 | #include "unicode/uchar.h" 18 | #include "unicode/ustring.h" 19 | #include "tolowtrn.h" 20 | #include "ustr_imp.h" 21 | #include "cpputils.h" 22 | 23 | U_NAMESPACE_BEGIN 24 | 25 | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LowercaseTransliterator) 26 | 27 | /** 28 | * Constructs a transliterator. 29 | */ 30 | LowercaseTransliterator::LowercaseTransliterator() : 31 | CaseMapTransliterator(UNICODE_STRING("Any-Lower", 9), ucase_toFullLower) 32 | { 33 | } 34 | 35 | /** 36 | * Destructor. 37 | */ 38 | LowercaseTransliterator::~LowercaseTransliterator() { 39 | } 40 | 41 | /** 42 | * Copy constructor. 43 | */ 44 | LowercaseTransliterator::LowercaseTransliterator(const LowercaseTransliterator& o) : 45 | CaseMapTransliterator(o) 46 | { 47 | } 48 | 49 | /** 50 | * Assignment operator. 51 | */ 52 | /*LowercaseTransliterator& LowercaseTransliterator::operator=( 53 | const LowercaseTransliterator& o) { 54 | CaseMapTransliterator::operator=(o); 55 | return *this; 56 | }*/ 57 | 58 | /** 59 | * Transliterator API. 60 | */ 61 | Transliterator* LowercaseTransliterator::clone(void) const { 62 | return new LowercaseTransliterator(*this); 63 | } 64 | 65 | U_NAMESPACE_END 66 | 67 | #endif /* #if !UCONFIG_NO_TRANSLITERATION */ 68 | -------------------------------------------------------------------------------- /vendor/icu/i18n/tolowtrn.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2001-2007, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * Date Name Description 9 | * 05/24/01 aliu Creation. 10 | ********************************************************************** 11 | */ 12 | #ifndef TOLOWTRN_H 13 | #define TOLOWTRN_H 14 | 15 | #include "unicode/utypes.h" 16 | 17 | #if !UCONFIG_NO_TRANSLITERATION 18 | 19 | #include "unicode/translit.h" 20 | #include "casetrn.h" 21 | 22 | U_NAMESPACE_BEGIN 23 | 24 | /** 25 | * A transliterator that performs locale-sensitive toLower() 26 | * case mapping. 27 | * @author Alan Liu 28 | */ 29 | class LowercaseTransliterator : public CaseMapTransliterator { 30 | 31 | public: 32 | 33 | /** 34 | * Constructs a transliterator. 35 | * @param loc the given locale. 36 | */ 37 | LowercaseTransliterator(); 38 | 39 | /** 40 | * Destructor. 41 | */ 42 | virtual ~LowercaseTransliterator(); 43 | 44 | /** 45 | * Copy constructor. 46 | */ 47 | LowercaseTransliterator(const LowercaseTransliterator&); 48 | 49 | /** 50 | * Transliterator API. 51 | * @return a copy of the object. 52 | */ 53 | virtual Transliterator* clone(void) const; 54 | 55 | /** 56 | * ICU "poor man's RTTI", returns a UClassID for the actual class. 57 | */ 58 | virtual UClassID getDynamicClassID() const; 59 | 60 | /** 61 | * ICU "poor man's RTTI", returns a UClassID for this class. 62 | */ 63 | U_I18N_API static UClassID U_EXPORT2 getStaticClassID(); 64 | private: 65 | 66 | /** 67 | * Assignment operator. 68 | */ 69 | LowercaseTransliterator& operator=(const LowercaseTransliterator&); 70 | }; 71 | 72 | U_NAMESPACE_END 73 | 74 | #endif /* #if !UCONFIG_NO_TRANSLITERATION */ 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /vendor/icu/i18n/toupptrn.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2001-2007, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * Date Name Description 9 | * 05/24/01 aliu Creation. 10 | ********************************************************************** 11 | */ 12 | 13 | #include "unicode/utypes.h" 14 | 15 | #if !UCONFIG_NO_TRANSLITERATION 16 | 17 | #include "unicode/ustring.h" 18 | #include "unicode/uchar.h" 19 | #include "toupptrn.h" 20 | #include "ustr_imp.h" 21 | #include "cpputils.h" 22 | 23 | U_NAMESPACE_BEGIN 24 | 25 | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(UppercaseTransliterator) 26 | 27 | /** 28 | * Constructs a transliterator. 29 | */ 30 | UppercaseTransliterator::UppercaseTransliterator() : 31 | CaseMapTransliterator(UNICODE_STRING("Any-Upper", 9), ucase_toFullUpper) 32 | { 33 | } 34 | 35 | /** 36 | * Destructor. 37 | */ 38 | UppercaseTransliterator::~UppercaseTransliterator() { 39 | } 40 | 41 | /** 42 | * Copy constructor. 43 | */ 44 | UppercaseTransliterator::UppercaseTransliterator(const UppercaseTransliterator& o) : 45 | CaseMapTransliterator(o) 46 | { 47 | } 48 | 49 | /** 50 | * Assignment operator. 51 | */ 52 | /*UppercaseTransliterator& UppercaseTransliterator::operator=( 53 | const UppercaseTransliterator& o) { 54 | CaseMapTransliterator::operator=(o); 55 | return *this; 56 | }*/ 57 | 58 | /** 59 | * Transliterator API. 60 | */ 61 | Transliterator* UppercaseTransliterator::clone(void) const { 62 | return new UppercaseTransliterator(*this); 63 | } 64 | 65 | U_NAMESPACE_END 66 | 67 | #endif /* #if !UCONFIG_NO_TRANSLITERATION */ 68 | -------------------------------------------------------------------------------- /vendor/icu/i18n/toupptrn.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2001-2007, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * Date Name Description 9 | * 05/24/01 aliu Creation. 10 | ********************************************************************** 11 | */ 12 | #ifndef TOUPPTRN_H 13 | #define TOUPPTRN_H 14 | 15 | #include "unicode/utypes.h" 16 | 17 | #if !UCONFIG_NO_TRANSLITERATION 18 | 19 | #include "unicode/translit.h" 20 | #include "casetrn.h" 21 | 22 | U_NAMESPACE_BEGIN 23 | 24 | /** 25 | * A transliterator that performs locale-sensitive toUpper() 26 | * case mapping. 27 | * @author Alan Liu 28 | */ 29 | class UppercaseTransliterator : public CaseMapTransliterator { 30 | 31 | public: 32 | 33 | /** 34 | * Constructs a transliterator. 35 | * @param loc the given locale. 36 | */ 37 | UppercaseTransliterator(); 38 | 39 | /** 40 | * Destructor. 41 | */ 42 | virtual ~UppercaseTransliterator(); 43 | 44 | /** 45 | * Copy constructor. 46 | */ 47 | UppercaseTransliterator(const UppercaseTransliterator&); 48 | 49 | /** 50 | * Transliterator API. 51 | * @return a copy of the object. 52 | */ 53 | virtual Transliterator* clone(void) const; 54 | 55 | /** 56 | * ICU "poor man's RTTI", returns a UClassID for the actual class. 57 | */ 58 | virtual UClassID getDynamicClassID() const; 59 | 60 | /** 61 | * ICU "poor man's RTTI", returns a UClassID for this class. 62 | */ 63 | U_I18N_API static UClassID U_EXPORT2 getStaticClassID(); 64 | 65 | private: 66 | /** 67 | * Assignment operator. 68 | */ 69 | UppercaseTransliterator& operator=(const UppercaseTransliterator&); 70 | }; 71 | 72 | U_NAMESPACE_END 73 | 74 | #endif /* #if !UCONFIG_NO_TRANSLITERATION */ 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /vendor/icu/i18n/tzgnames.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2011-2012, International Business Machines Corporation and * 6 | * others. All Rights Reserved. * 7 | ******************************************************************************* 8 | */ 9 | #ifndef __TZGNAMES_H 10 | #define __TZGNAMES_H 11 | 12 | /** 13 | * \file 14 | * \brief C API: Time zone generic names classe 15 | */ 16 | 17 | #include "unicode/utypes.h" 18 | 19 | #if !UCONFIG_NO_FORMATTING 20 | 21 | #include "unicode/locid.h" 22 | #include "unicode/unistr.h" 23 | #include "unicode/tzfmt.h" 24 | #include "unicode/tznames.h" 25 | 26 | U_CDECL_BEGIN 27 | 28 | typedef enum UTimeZoneGenericNameType { 29 | UTZGNM_UNKNOWN = 0x00, 30 | UTZGNM_LOCATION = 0x01, 31 | UTZGNM_LONG = 0x02, 32 | UTZGNM_SHORT = 0x04 33 | } UTimeZoneGenericNameType; 34 | 35 | U_CDECL_END 36 | 37 | U_NAMESPACE_BEGIN 38 | 39 | class TimeZone; 40 | struct TZGNCoreRef; 41 | 42 | class U_I18N_API TimeZoneGenericNames : public UMemory { 43 | public: 44 | virtual ~TimeZoneGenericNames(); 45 | 46 | static TimeZoneGenericNames* createInstance(const Locale& locale, UErrorCode& status); 47 | 48 | virtual UBool operator==(const TimeZoneGenericNames& other) const; 49 | virtual UBool operator!=(const TimeZoneGenericNames& other) const {return !operator==(other);} 50 | virtual TimeZoneGenericNames* clone() const; 51 | 52 | UnicodeString& getDisplayName(const TimeZone& tz, UTimeZoneGenericNameType type, 53 | UDate date, UnicodeString& name) const; 54 | 55 | UnicodeString& getGenericLocationName(const UnicodeString& tzCanonicalID, UnicodeString& name) const; 56 | 57 | int32_t findBestMatch(const UnicodeString& text, int32_t start, uint32_t types, 58 | UnicodeString& tzID, UTimeZoneFormatTimeType& timeType, UErrorCode& status) const; 59 | 60 | private: 61 | TimeZoneGenericNames(); 62 | TZGNCoreRef* fRef; 63 | }; 64 | 65 | U_NAMESPACE_END 66 | #endif 67 | #endif 68 | -------------------------------------------------------------------------------- /vendor/icu/i18n/ucln_in.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ****************************************************************************** 5 | * * 6 | * Copyright (C) 2001-2014, International Business Machines * 7 | * Corporation and others. All Rights Reserved. * 8 | * * 9 | ****************************************************************************** 10 | * file name: ucln_in.cpp 11 | * encoding: UTF-8 12 | * tab size: 8 (not used) 13 | * indentation:4 14 | * 15 | * created on: 2001July05 16 | * created by: George Rhoten 17 | */ 18 | 19 | #include "ucln.h" 20 | #include "ucln_in.h" 21 | #include "mutex.h" 22 | #include "uassert.h" 23 | 24 | /** Auto-client for UCLN_I18N **/ 25 | #define UCLN_TYPE UCLN_I18N 26 | #include "ucln_imp.h" 27 | 28 | /* Leave this copyright notice here! It needs to go somewhere in this library. */ 29 | static const char copyright[] = U_COPYRIGHT_STRING; 30 | 31 | static cleanupFunc *gCleanupFunctions[UCLN_I18N_COUNT]; 32 | 33 | static UBool U_CALLCONV i18n_cleanup(void) 34 | { 35 | int32_t libType = UCLN_I18N_START; 36 | (void)copyright; /* Suppress unused variable warning with clang. */ 37 | 38 | while (++libTypenext(fp)) { 49 | field = fp.getField(); 50 | if (beginIndex) { 51 | *beginIndex = fp.getBeginIndex(); 52 | } 53 | if (endIndex) { 54 | *endIndex = fp.getEndIndex(); 55 | } 56 | } 57 | return field; 58 | } 59 | 60 | 61 | #endif /* #if !UCONFIG_NO_FORMATTING */ 62 | -------------------------------------------------------------------------------- /vendor/icu/i18n/umsg_imp.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ********************************************************************** 5 | * Copyright (C) 2001, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ********************************************************************** 8 | * file name: umsg_imp.h 9 | * encoding: UTF-8 10 | * tab size: 8 (not used) 11 | * indentation:4 12 | * 13 | * created on: 2001jun22 14 | * created by: George Rhoten 15 | */ 16 | 17 | #ifndef UMISC_H 18 | #define UMISC_H 19 | 20 | #include "unicode/utypes.h" 21 | 22 | #if !UCONFIG_NO_FORMATTING 23 | 24 | /* global variables used by the C and C++ message formatting API. */ 25 | 26 | extern const UChar *g_umsgTypeList[]; 27 | extern const UChar *g_umsgModifierList[]; 28 | extern const UChar *g_umsgDateModifierList[]; 29 | extern const int32_t g_umsgListLength; 30 | 31 | extern const UChar g_umsg_number[]; 32 | extern const UChar g_umsg_date[]; 33 | extern const UChar g_umsg_time[]; 34 | extern const UChar g_umsg_choice[]; 35 | 36 | extern const UChar g_umsg_currency[]; 37 | extern const UChar g_umsg_percent[]; 38 | extern const UChar g_umsg_integer[]; 39 | 40 | extern const UChar g_umsg_short[]; 41 | extern const UChar g_umsg_medium[]; 42 | extern const UChar g_umsg_long[]; 43 | extern const UChar g_umsg_full[]; 44 | 45 | #endif /* #if !UCONFIG_NO_FORMATTING */ 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /vendor/icu/i18n/unicode/ugender.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ***************************************************************************************** 5 | * Copyright (C) 2010-2013, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ***************************************************************************************** 8 | */ 9 | 10 | #ifndef UGENDER_H 11 | #define UGENDER_H 12 | 13 | #include "unicode/utypes.h" 14 | 15 | #if !UCONFIG_NO_FORMATTING 16 | 17 | #include "unicode/localpointer.h" 18 | 19 | /** 20 | * \file 21 | * \brief C API: The purpose of this API is to compute the gender of a list as a 22 | * whole given the gender of each element. 23 | * 24 | */ 25 | 26 | /** 27 | * Genders 28 | * @stable ICU 50 29 | */ 30 | enum UGender { 31 | /** 32 | * Male gender. 33 | * @stable ICU 50 34 | */ 35 | UGENDER_MALE, 36 | /** 37 | * Female gender. 38 | * @stable ICU 50 39 | */ 40 | UGENDER_FEMALE, 41 | /** 42 | * Neutral gender. 43 | * @stable ICU 50 44 | */ 45 | UGENDER_OTHER 46 | }; 47 | /** 48 | * @stable ICU 50 49 | */ 50 | typedef enum UGender UGender; 51 | 52 | struct UGenderInfo; 53 | /** 54 | * Opaque UGenderInfo object for use in C programs. 55 | * @stable ICU 50 56 | */ 57 | typedef struct UGenderInfo UGenderInfo; 58 | 59 | /** 60 | * Opens a new UGenderInfo object given locale. 61 | * @param locale The locale for which the rules are desired. 62 | * @param status UErrorCode pointer 63 | * @return A UGenderInfo for the specified locale, or NULL if an error occurred. 64 | * @stable ICU 50 65 | */ 66 | U_STABLE const UGenderInfo* U_EXPORT2 67 | ugender_getInstance(const char *locale, UErrorCode *status); 68 | 69 | 70 | /** 71 | * Given a list, returns the gender of the list as a whole. 72 | * @param genderInfo pointer that ugender_getInstance returns. 73 | * @param genders the gender of each element in the list. 74 | * @param size the size of the list. 75 | * @param status A pointer to a UErrorCode to receive any errors. 76 | * @return The gender of the list. 77 | * @stable ICU 50 78 | */ 79 | U_STABLE UGender U_EXPORT2 80 | ugender_getListGender(const UGenderInfo* genderInfo, const UGender *genders, int32_t size, UErrorCode *status); 81 | 82 | #endif /* #if !UCONFIG_NO_FORMATTING */ 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /vendor/icu/i18n/uregexc.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2003-2006, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ******************************************************************************* 8 | * file name: regexc.cpp 9 | * description: The purpose of this function is to separate the codepage 10 | * conversion from the rest of the uregex_ API. This can removes any 11 | * dependency on codepage conversion, which reduces the overhead of 12 | */ 13 | 14 | #include "unicode/uregex.h" 15 | #include "unicode/unistr.h" 16 | 17 | U_NAMESPACE_USE 18 | 19 | //---------------------------------------------------------------------------------------- 20 | // 21 | // uregex_openC 22 | // 23 | //---------------------------------------------------------------------------------------- 24 | #if !UCONFIG_NO_CONVERSION && !UCONFIG_NO_REGULAR_EXPRESSIONS 25 | 26 | U_CAPI URegularExpression * U_EXPORT2 27 | uregex_openC( const char *pattern, 28 | uint32_t flags, 29 | UParseError *pe, 30 | UErrorCode *status) { 31 | if (U_FAILURE(*status)) { 32 | return NULL; 33 | } 34 | if (pattern == NULL) { 35 | *status = U_ILLEGAL_ARGUMENT_ERROR; 36 | return NULL; 37 | } 38 | 39 | UnicodeString patString(pattern); 40 | return uregex_open(patString.getBuffer(), patString.length(), flags, pe, status); 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /vendor/icu/i18n/wintzimpl.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************** 5 | * Copyright (C) 2008-2011, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ******************************************************************************** 8 | * 9 | * File WINTZIMPL.H 10 | * 11 | ******************************************************************************** 12 | */ 13 | 14 | #ifndef __WINTZIMPL 15 | #define __WINTZIMPL 16 | 17 | #include "unicode/utypes.h" 18 | 19 | #if U_PLATFORM_USES_ONLY_WIN32_API 20 | /** 21 | * \file 22 | * \brief C API: Utilities for dealing w/ Windows time zones. 23 | */ 24 | U_CDECL_BEGIN 25 | /* Forward declarations for Windows types... */ 26 | typedef struct _TIME_ZONE_INFORMATION TIME_ZONE_INFORMATION; 27 | U_CDECL_END 28 | 29 | /* 30 | * This method was moved over from common/wintz.h to allow for access to i18n functions 31 | * needed to get the Windows time zone information without using static tables. 32 | */ 33 | U_CAPI UBool U_EXPORT2 34 | uprv_getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const UChar *icuid, int32_t length); 35 | 36 | 37 | #endif /* U_PLATFORM_USES_ONLY_WIN32_API */ 38 | 39 | #endif /* __WINTZIMPL */ 40 | -------------------------------------------------------------------------------- /vendor/icu/icu_config.gypi: -------------------------------------------------------------------------------- 1 | { 'variables': { 'icu_small_canned': 1, 2 | 'icu_src_common': [ 'common/uarrsort.cpp', 3 | 'common/umutex.h', 4 | 'common/cstring.cpp', 5 | 'common/ucln.h', 6 | 'common/ucln_cmn.h', 7 | 'common/ucln_cmn.cpp', 8 | 'common/putil.cpp', 9 | 'common/cmemory.h', 10 | 'common/uenum.cpp', 11 | 'common/cmemory.cpp', 12 | 'common/cstring.h', 13 | 'common/uenumimp.h', 14 | 'common/umutex.cpp', 15 | 'common/utypes.cpp', 16 | 'common/putilimp.h', 17 | 'common/uobject.cpp', 18 | 'common/uarrsort.h'], 19 | 'icu_src_genccode': [ ], 20 | 'icu_src_genrb': [ ], 21 | 'icu_src_i18n': [ 'i18n/csrucode.h', 22 | 'i18n/ucsdet.cpp', 23 | 'i18n/csrutf8.cpp', 24 | 'i18n/csdetect.cpp', 25 | 'i18n/csdetect.h', 26 | 'i18n/ucln_in.h', 27 | 'i18n/inputext.h', 28 | 'i18n/csrucode.cpp', 29 | 'i18n/csrecog.h', 30 | 'i18n/ucln_in.cpp', 31 | 'i18n/csmatch.h', 32 | 'i18n/csrutf8.h', 33 | 'i18n/csrsbcs.cpp', 34 | 'i18n/csr2022.cpp', 35 | 'i18n/inputext.cpp', 36 | 'i18n/csrsbcs.h', 37 | 'i18n/csrmbcs.h', 38 | 'i18n/csrmbcs.cpp', 39 | 'i18n/csmatch.cpp', 40 | 'i18n/csr2022.h', 41 | 'i18n/csrecog.cpp'], 42 | 'icu_src_icupkg': [ ], 43 | 'icu_src_stubdata': [ ], 44 | 'icu_src_tools': [ ]}} 45 | -------------------------------------------------------------------------------- /vendor/icu/icu_small.json: -------------------------------------------------------------------------------- 1 | { 2 | "copyright": "Copyright (c) 2014 IBM Corporation and Others. All Rights Reserved.", 3 | "comment": "icutrim.py config: Trim down ICU to just a certain locale set, needed for node.js use.", 4 | "variables": { 5 | "none": { 6 | "only": [] 7 | }, 8 | "locales": { 9 | "only": [ 10 | "root", 11 | "en" 12 | ] 13 | }, 14 | "leavealone": { 15 | } 16 | }, 17 | "trees": { 18 | "ROOT": "locales", 19 | "brkitr": "none", 20 | "coll": "locales", 21 | "curr": "locales", 22 | "lang": "none", 23 | "rbnf": "none", 24 | "region": "none", 25 | "zone": "locales", 26 | "converters": "none", 27 | "stringprep": "locales", 28 | "translit": "locales", 29 | "brkfiles": "none", 30 | "brkdict": "none", 31 | "confusables": "none", 32 | "unit": "none" 33 | }, 34 | "remove": [ 35 | "cnvalias.icu", 36 | "postalCodeData.res", 37 | "genderList.res", 38 | "brkitr/root.res", 39 | "unames.icu" 40 | ], 41 | "keep": [ 42 | "pool.res", 43 | "supplementalData.res", 44 | "zoneinfo64.res", 45 | "likelySubtags.res" 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /vendor/icu/tools/escapesrc/expect-simple.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | u"sa\u0127\u0127a"; 5 | u'\u6587'; 6 | u"\U000219F2"; 7 | u"\u039C\u03C5\u03C3\u03C4\u03AE\u03C1\u03B9\u03BF"; 8 | 9 | u"sa\u0127\u0127a"; 10 | u'\u6587'; u"\U000219F2"; 11 | 12 | "\x20\xCC\x81"; 13 | "\xCC\x88\x20"; 14 | "\x73\x61\xC4\xA7\xC4\xA7\x61"; 15 | "\xE6\x96\x87"; 16 | "\xF0\xA1\xA7\xB2"; 17 | "\x73\x61\xC4\xA7\xC4\xA7\x61"; 18 | -------------------------------------------------------------------------------- /vendor/icu/tools/escapesrc/test-nochange.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | // This is a source file with no changes needed in it. 5 | // In fact, the only non-ASCII character is the comment line at top. 6 | -------------------------------------------------------------------------------- /vendor/icu/tools/escapesrc/test-simple.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | u"saħħa"; 5 | u'文'; 6 | u"𡧲"; 7 | u"Μυστήριο"; 8 | 9 | u"saħħa"; 10 | u'文'; u"𡧲"; 11 | 12 | u8" \u0301"; 13 | u8"\u0308 "; 14 | u8"saħħa"; 15 | u8"文"; 16 | u8"𡧲"; 17 | u8"saħ\u0127a"; 18 | -------------------------------------------------------------------------------- /vendor/icu/tools/genrb/errmsg.c: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 1998-2011, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * 11 | * File error.c 12 | * 13 | * Modification History: 14 | * 15 | * Date Name Description 16 | * 05/28/99 stephen Creation. 17 | ******************************************************************************* 18 | */ 19 | 20 | #include 21 | #include 22 | #include "cstring.h" 23 | #include "errmsg.h" 24 | 25 | U_CFUNC void error(uint32_t linenumber, const char *msg, ...) 26 | { 27 | va_list va; 28 | 29 | va_start(va, msg); 30 | fprintf(stderr, "%s:%u: ", gCurrentFileName, (int)linenumber); 31 | vfprintf(stderr, msg, va); 32 | fprintf(stderr, "\n"); 33 | va_end(va); 34 | } 35 | 36 | static UBool gShowWarning = TRUE; 37 | 38 | U_CFUNC void setShowWarning(UBool val) 39 | { 40 | gShowWarning = val; 41 | } 42 | 43 | U_CFUNC UBool getShowWarning(){ 44 | return gShowWarning; 45 | } 46 | 47 | static UBool gStrict =FALSE; 48 | U_CFUNC UBool isStrict(){ 49 | return gStrict; 50 | } 51 | U_CFUNC void setStrict(UBool val){ 52 | gStrict = val; 53 | } 54 | static UBool gVerbose =FALSE; 55 | U_CFUNC UBool isVerbose(){ 56 | return gVerbose; 57 | } 58 | U_CFUNC void setVerbose(UBool val){ 59 | gVerbose = val; 60 | } 61 | U_CFUNC void warning(uint32_t linenumber, const char *msg, ...) 62 | { 63 | if (gShowWarning) 64 | { 65 | va_list va; 66 | 67 | va_start(va, msg); 68 | fprintf(stderr, "%s:%u: warning: ", gCurrentFileName, (int)linenumber); 69 | vfprintf(stderr, msg, va); 70 | fprintf(stderr, "\n"); 71 | va_end(va); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /vendor/icu/tools/genrb/errmsg.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 1998-2016, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * 11 | * File error.h 12 | * 13 | * Modification History: 14 | * 15 | * Date Name Description 16 | * 05/28/99 stephen Creation. 17 | ******************************************************************************* 18 | */ 19 | 20 | #ifndef ERROR_H 21 | #define ERROR_H 1 22 | 23 | #include "unicode/utypes.h" 24 | 25 | U_CDECL_BEGIN 26 | 27 | extern const char *gCurrentFileName; 28 | 29 | U_CFUNC void error(uint32_t linenumber, const char *msg, ...); 30 | U_CFUNC void warning(uint32_t linenumber, const char *msg, ...); 31 | 32 | /* Show warnings? */ 33 | U_CFUNC void setShowWarning(UBool val); 34 | U_CFUNC UBool getShowWarning(void); 35 | 36 | /* strict */ 37 | U_CFUNC void setStrict(UBool val); 38 | U_CFUNC UBool isStrict(void); 39 | 40 | /* verbosity */ 41 | U_CFUNC void setVerbose(UBool val); 42 | U_CFUNC UBool isVerbose(void); 43 | 44 | U_CDECL_END 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /vendor/icu/tools/genrb/genrb.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 2002-2015, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * 11 | * File genrb.h 12 | */ 13 | 14 | #ifndef GENRB_H 15 | #define GENRB_H 16 | 17 | #include 18 | #include "unicode/utypes.h" 19 | #include "unicode/putil.h" 20 | #include "cmemory.h" 21 | #include "cstring.h" 22 | #include "filestrm.h" 23 | 24 | 25 | #include "ucbuf.h" 26 | #include "errmsg.h" 27 | #include "parse.h" 28 | #include "rbutil.h" 29 | 30 | #include "toolutil.h" 31 | #include "uoptions.h" 32 | 33 | #include "unicode/ucol.h" 34 | #include "unicode/uloc.h" 35 | 36 | /* The version of genrb */ 37 | #define GENRB_VERSION "56" 38 | 39 | U_CDECL_BEGIN 40 | 41 | U_CAPI void processFile( 42 | const char *filename, 43 | const char* cp, 44 | const char *inputDir, 45 | const char *outputDir, 46 | const char *packageName, 47 | UBool omitBinaryCollation, 48 | UErrorCode *status); 49 | 50 | U_CDECL_END 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /vendor/icu/tools/genrb/parse.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 1998-2014, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * 11 | * File parse.h 12 | * 13 | * Modification History: 14 | * 15 | * Date Name Description 16 | * 05/26/99 stephen Creation. 17 | ******************************************************************************* 18 | */ 19 | 20 | #ifndef PARSE_H 21 | #define PARSE_H 1 22 | 23 | #include "unicode/utypes.h" 24 | #include "filestrm.h" 25 | #include "ucbuf.h" 26 | 27 | U_CDECL_BEGIN 28 | /* One time parser initalisation */ 29 | void initParser(); 30 | 31 | /* Parse a ResourceBundle text file */ 32 | struct SRBRoot* parse(UCHARBUF *buf, const char* inputDir, const char* outputDir, 33 | const char *filename, 34 | UBool makeBinaryCollation, UBool omitCollationRules, UErrorCode *status); 35 | 36 | U_CDECL_END 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /vendor/icu/tools/genrb/prscmnts.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 1998-2016, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * 11 | * File read.h 12 | * 13 | * Modification History: 14 | * 15 | * Date Name Description 16 | * 05/26/99 stephen Creation. 17 | * 5/10/01 Ram removed ustdio dependency 18 | ******************************************************************************* 19 | */ 20 | 21 | #ifndef PRSCMNTS_H 22 | #define PRSCMNTS_H 1 23 | 24 | #include "unicode/utypes.h" 25 | 26 | #if UCONFIG_NO_REGULAR_EXPRESSIONS==0 /* donot compile when no RegularExpressions are available */ 27 | 28 | enum UParseCommentsOption { 29 | UPC_TRANSLATE, 30 | UPC_NOTE, 31 | UPC_LIMIT 32 | }; 33 | 34 | typedef enum UParseCommentsOption UParseCommentsOption; 35 | 36 | U_CFUNC int32_t 37 | getNote(const UChar* source, int32_t srcLen, 38 | UChar** dest, int32_t destCapacity, 39 | UErrorCode* status); 40 | U_CFUNC int32_t 41 | removeCmtText(UChar* source, int32_t srcLen, UErrorCode* status); 42 | 43 | U_CFUNC int32_t 44 | getDescription( const UChar* source, int32_t srcLen, 45 | UChar** dest, int32_t destCapacity, 46 | UErrorCode* status); 47 | U_CFUNC int32_t 48 | getTranslate( const UChar* source, int32_t srcLen, 49 | UChar** dest, int32_t destCapacity, 50 | UErrorCode* status); 51 | 52 | U_CFUNC int32_t 53 | getAt(const UChar* source, int32_t srcLen, 54 | UChar** dest, int32_t destCapacity, 55 | int32_t index, 56 | UParseCommentsOption option, 57 | UErrorCode* status); 58 | 59 | U_CFUNC int32_t 60 | getCount(const UChar* source, int32_t srcLen, 61 | UParseCommentsOption option, UErrorCode *status); 62 | 63 | #endif /* UCONFIG_NO_REGULAR_EXPRESSIONS */ 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /vendor/icu/tools/genrb/rbutil.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 1998-2016, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * 11 | * File rbutil.h 12 | * 13 | * Modification History: 14 | * 15 | * Date Name Description 16 | * 06/10/99 stephen Creation. 17 | ******************************************************************************* 18 | */ 19 | 20 | #ifndef UTIL_H 21 | #define UTIL_H 1 22 | 23 | #include "unicode/utypes.h" 24 | 25 | U_CDECL_BEGIN 26 | 27 | void get_dirname(char *dirname, const char *filename); 28 | void get_basename(char *basename, const char *filename); 29 | int32_t itostr(char * buffer, int32_t i, uint32_t radix, int32_t pad); 30 | 31 | U_CDECL_END 32 | 33 | #endif /* ! UTIL_H */ 34 | -------------------------------------------------------------------------------- /vendor/icu/tools/genrb/read.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 1998-2011, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * 11 | * File read.h 12 | * 13 | * Modification History: 14 | * 15 | * Date Name Description 16 | * 05/26/99 stephen Creation. 17 | * 5/10/01 Ram removed ustdio dependency 18 | ******************************************************************************* 19 | */ 20 | 21 | #ifndef READ_H 22 | #define READ_H 1 23 | 24 | #include "unicode/utypes.h" 25 | #include "ustr.h" 26 | #include "ucbuf.h" 27 | 28 | /* The types of tokens which may be returned by getNextToken. 29 | NOTE: Keep these in sync with tokenNames in parse.c */ 30 | enum ETokenType 31 | { 32 | TOK_STRING, /* A string token, such as "MonthNames" */ 33 | TOK_OPEN_BRACE, /* An opening brace character */ 34 | TOK_CLOSE_BRACE, /* A closing brace character */ 35 | TOK_COMMA, /* A comma */ 36 | TOK_COLON, /* A colon */ 37 | 38 | TOK_EOF, /* End of the file has been reached successfully */ 39 | TOK_ERROR, /* An error, such an unterminated quoted string */ 40 | TOK_TOKEN_COUNT /* Number of "real" token types */ 41 | }; 42 | 43 | U_CFUNC UChar32 unescape(UCHARBUF *buf, UErrorCode *status); 44 | 45 | U_CFUNC void resetLineNumber(void); 46 | 47 | U_CFUNC enum ETokenType 48 | getNextToken(UCHARBUF *buf, 49 | struct UString *token, 50 | uint32_t *linenumber, /* out: linenumber of token */ 51 | struct UString *comment, 52 | UErrorCode *status); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /vendor/icu/tools/toolutil/collationinfo.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2013-2015, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ******************************************************************************* 8 | * collationinfo.h 9 | * 10 | * created on: 2013aug05 11 | * created by: Markus W. Scherer 12 | */ 13 | 14 | #ifndef __COLLATIONINFO_H__ 15 | #define __COLLATIONINFO_H__ 16 | 17 | #include "unicode/utypes.h" 18 | 19 | #if !UCONFIG_NO_COLLATION 20 | 21 | U_NAMESPACE_BEGIN 22 | 23 | struct CollationData; 24 | 25 | /** 26 | * Collation-related code for tools & demos. 27 | */ 28 | class U_TOOLUTIL_API CollationInfo /* all static */ { 29 | public: 30 | static void printSizes(int32_t sizeWithHeader, const int32_t indexes[]); 31 | static void printReorderRanges(const CollationData &data, const int32_t *codes, int32_t length); 32 | 33 | private: 34 | CollationInfo(); // no constructor 35 | 36 | static int32_t getDataLength(const int32_t indexes[], int32_t startIndex); 37 | }; 38 | 39 | U_NAMESPACE_END 40 | 41 | #endif // !UCONFIG_NO_COLLATION 42 | #endif // __COLLATIONINFO_H__ 43 | -------------------------------------------------------------------------------- /vendor/icu/tools/toolutil/dbgutil.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | 4 | /* 5 | ************************************************************************ 6 | * Copyright (c) 2007-2012, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | ************************************************************************ 9 | */ 10 | 11 | /** C++ Utilities to aid in debugging **/ 12 | 13 | #ifndef _DBGUTIL_H 14 | #define _DBGUTIL_H 15 | 16 | #include "unicode/utypes.h" 17 | #include "udbgutil.h" 18 | #include "unicode/unistr.h" 19 | 20 | #if !UCONFIG_NO_FORMATTING 21 | 22 | U_TOOLUTIL_API const icu::UnicodeString& U_EXPORT2 23 | udbg_enumString(UDebugEnumType type, int32_t field); 24 | 25 | /** 26 | * @return enum offset, or UDBG_INVALID_ENUM on error 27 | */ 28 | U_CAPI int32_t U_EXPORT2 29 | udbg_enumByString(UDebugEnumType type, const icu::UnicodeString& string); 30 | 31 | /** 32 | * Convert a UnicodeString (with ascii digits) into a number. 33 | * @param s string 34 | * @return numerical value, or 0 on error 35 | */ 36 | U_CAPI int32_t U_EXPORT2 udbg_stoi(const icu::UnicodeString &s); 37 | 38 | U_CAPI double U_EXPORT2 udbg_stod(const icu::UnicodeString &s); 39 | 40 | U_CAPI icu::UnicodeString * U_EXPORT2 41 | udbg_escape(const icu::UnicodeString &s, icu::UnicodeString *dst); 42 | 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /vendor/icu/tools/toolutil/denseranges.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * Copyright (C) 2010, International Business Machines 6 | * Corporation and others. All Rights Reserved. 7 | ******************************************************************************* 8 | * file name: denseranges.h 9 | * encoding: UTF-8 10 | * tab size: 8 (not used) 11 | * indentation:4 12 | * 13 | * created on: 2010sep25 14 | * created by: Markus W. Scherer 15 | * 16 | * Helper code for finding a small number of dense ranges. 17 | */ 18 | 19 | #ifndef __DENSERANGES_H__ 20 | #define __DENSERANGES_H__ 21 | 22 | #include "unicode/utypes.h" 23 | 24 | /** 25 | * Does it make sense to write 1..capacity ranges? 26 | * Returns 0 if not, otherwise the number of ranges. 27 | * @param values Sorted array of signed-integer values. 28 | * @param length Number of values. 29 | * @param density Minimum average range density, in 256th. (0x100=100%=perfectly dense.) 30 | * Should be 0x80..0x100, must be 1..0x100. 31 | * @param ranges Output ranges array. 32 | * @param capacity Maximum number of ranges. 33 | * @return Minimum number of ranges (at most capacity) that have the desired density, 34 | * or 0 if that density cannot be achieved. 35 | */ 36 | U_CAPI int32_t U_EXPORT2 37 | uprv_makeDenseRanges(const int32_t values[], int32_t length, 38 | int32_t density, 39 | int32_t ranges[][2], int32_t capacity); 40 | 41 | #endif // __DENSERANGES_H__ 42 | -------------------------------------------------------------------------------- /vendor/icu/tools/toolutil/filetools.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 2009, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * file name: filetools.h 11 | * encoding: UTF-8 12 | * tab size: 8 (not used) 13 | * indentation:4 14 | * 15 | * created on: 2009jan09 16 | * created by: Michael Ow 17 | * 18 | * Contains various functions to handle files. 19 | * Not suitable for production use. Not supported. 20 | * Not conformant. Not efficient. 21 | */ 22 | 23 | #ifndef __FILETOOLS_H__ 24 | #define __FILETOOLS_H__ 25 | 26 | #include "unicode/utypes.h" 27 | 28 | U_CAPI UBool U_EXPORT2 29 | isFileModTimeLater(const char *filePath, const char *checkAgainst, UBool isDir=FALSE); 30 | 31 | U_CAPI void U_EXPORT2 32 | swapFileSepChar(char *filePath, const char oldFileSepChar, const char newFileSepChar); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /vendor/icu/tools/toolutil/flagparser.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 2009-2011, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * file name: flagparser.h 11 | * encoding: UTF-8 12 | * tab size: 8 (not used) 13 | * indentation:4 14 | * 15 | * created on: 2009jan08 16 | * created by: Michael Ow 17 | * 18 | * Tiny flag file parser using ICU and intended for use in ICU tests and in build tools. 19 | * Not suitable for production use. Not supported. 20 | * Not conformant. Not efficient. 21 | * But very small. 22 | */ 23 | 24 | #ifndef __FLAGPARSER_H__ 25 | #define __FLAGPARSER_H__ 26 | 27 | #include "unicode/utypes.h" 28 | 29 | U_CAPI int32_t U_EXPORT2 30 | parseFlagsFile(const char *fileName, char **flagBuffer, int32_t flagBufferSize, const char ** flagNames, int32_t numOfFlags, UErrorCode *status); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /vendor/icu/tools/toolutil/pkg_gencmn.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /****************************************************************************** 4 | * Copyright (C) 2008, International Business Machines 5 | * Corporation and others. All Rights Reserved. 6 | ******************************************************************************* 7 | */ 8 | 9 | #ifndef __PKG_GENCMN_H__ 10 | #define __PKG_GENCMN_H__ 11 | 12 | #include "unicode/utypes.h" 13 | 14 | U_CAPI void U_EXPORT2 15 | createCommonDataFile(const char *destDir, const char *name, const char *entrypointName, const char *type, const char *source, const char *copyRight, 16 | const char *dataFile, uint32_t max_size, UBool sourceTOC, UBool verbose, char *gencmnFileName); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /vendor/icu/tools/toolutil/pkg_icu.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /****************************************************************************** 4 | * Copyright (C) 2008-2016, International Business Machines 5 | * Corporation and others. All Rights Reserved. 6 | ******************************************************************************* 7 | */ 8 | 9 | #ifndef __PKG_ICU_H__ 10 | #define __PKG_ICU_H__ 11 | 12 | #include "unicode/utypes.h" 13 | #include "package.h" 14 | 15 | #define U_PKG_RESERVED_CHARS "\"%&'()*+,-./:;<=>?_" 16 | 17 | U_CAPI int U_EXPORT2 18 | writePackageDatFile(const char *outFilename, const char *outComment, 19 | const char *sourcePath, const char *addList, icu::Package *pkg, 20 | char outType); 21 | 22 | U_CAPI icu::Package * U_EXPORT2 23 | readList(const char *filesPath, const char *listname, UBool readContents, icu::Package *listPkgIn); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /vendor/icu/tools/toolutil/pkg_imp.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 2005-2016, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * file name: pkg_imp.h 11 | * encoding: UTF-8 12 | * tab size: 8 (not used) 13 | * indentation:4 14 | * 15 | * created on: 2005sep18 16 | * created by: Markus W. Scherer 17 | * 18 | * Implementation definitions for data package functions in toolutil. 19 | */ 20 | 21 | #ifndef __PKG_IMP_H__ 22 | #define __PKG_IMP_H__ 23 | 24 | #include "unicode/utypes.h" 25 | #include "unicode/udata.h" 26 | 27 | /* 28 | * Read an ICU data item with any platform type, 29 | * return the pointer to the UDataInfo in its header, 30 | * and set the lengths of the UDataInfo and of the whole header. 31 | * All data remains in its platform type. 32 | */ 33 | U_CFUNC const UDataInfo * 34 | getDataInfo(const uint8_t *data, int32_t length, 35 | int32_t &infoLength, int32_t &headerLength, 36 | UErrorCode *pErrorCode); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /vendor/icu/tools/toolutil/swapimpl.h: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /* 4 | ******************************************************************************* 5 | * 6 | * Copyright (C) 2005, International Business Machines 7 | * Corporation and others. All Rights Reserved. 8 | * 9 | ******************************************************************************* 10 | * file name: swapimpl.h 11 | * encoding: UTF-8 12 | * tab size: 8 (not used) 13 | * indentation:4 14 | * 15 | * created on: 2005jul29 16 | * created by: Markus W. Scherer 17 | * 18 | * Declarations for data file swapping functions not declared in internal 19 | * library headers. 20 | */ 21 | 22 | #ifndef __SWAPIMPL_H__ 23 | #define __SWAPIMPL_H__ 24 | 25 | #include "unicode/utypes.h" 26 | #include "udataswp.h" 27 | 28 | /** 29 | * Identifies and then transforms the ICU data piece in-place, or determines 30 | * its length. See UDataSwapFn. 31 | * This function handles single data pieces (but not .dat data packages) 32 | * and internally dispatches to per-type swap functions. 33 | * Sets a U_UNSUPPORTED_ERROR if the data format is not recognized. 34 | * 35 | * @see UDataSwapFn 36 | * @see udata_openSwapper 37 | * @see udata_openSwapperForInputData 38 | * @internal ICU 2.8 39 | */ 40 | U_CAPI int32_t U_EXPORT2 41 | udata_swap(const UDataSwapper *ds, 42 | const void *inData, int32_t length, void *outData, 43 | UErrorCode *pErrorCode); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /vendor/icu/tools/toolutil/ucln_tu.cpp: -------------------------------------------------------------------------------- 1 | // © 2016 and later: Unicode, Inc. and others. 2 | // License & terms of use: http://www.unicode.org/copyright.html 3 | /******************************************************************** 4 | * COPYRIGHT: 5 | * Copyright (c) 2007-2014, International Business Machines Corporation and 6 | * others. All Rights Reserved. 7 | ********************************************************************/ 8 | 9 | 10 | /** Auto-client **/ 11 | #define UCLN_TYPE UCLN_TOOLUTIL 12 | #include "ucln_imp.h" 13 | 14 | int uprv_dummyFunction_TU(void); 15 | int uprv_dummyFunction_TU(void) 16 | { 17 | /* this is here to prevent the compiler from complaining about an empty file */ 18 | return 0; 19 | } 20 | --------------------------------------------------------------------------------