����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
// © 2025 and later: Unicode, Inc. and others.
// License & terms of use: https://www.unicode.org/copyright.html
// utfstring.h
// created: 2025jul18 Markus W. Scherer
#ifndef __UTFSTRING_H__
#define __UTFSTRING_H__
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API || U_SHOW_CPLUSPLUS_HEADER_API || !defined(UTYPES_H)
#include "unicode/utf16.h"
/**
* \file
* \brief C++ header-only API: C++ string helper functions.
*/
#ifndef U_HIDE_DRAFT_API
namespace U_HEADER_ONLY_NAMESPACE {
namespace utfstring {
// Write code points to strings -------------------------------------------- ***
#ifndef U_IN_DOXYGEN
namespace prv {
// This function, and the public wrappers,
// want to be U_FORCE_INLINE but the gcc-debug-build-and-test CI check failed with
// error: ‘always_inline’ function might not be inlinable [-Werror=attributes]
template<typename StringClass, bool validate>
inline StringClass &appendCodePoint(StringClass &s, uint32_t c) {
using Unit = typename StringClass::value_type;
if constexpr (sizeof(Unit) == 1) {
// UTF-8: Similar to U8_APPEND().
if (c <= 0x7f) {
s.push_back(static_cast<Unit>(c));
} else {
Unit buf[4];
uint8_t len;
if (c <= 0x7ff) {
len = 2;
buf[2] = (c >> 6) | 0xc0;
} else {
if (validate ?
c < 0xd800 ||
(c < 0xe000 || c > 0x10ffff ? (c = 0xfffd, true) : c <= 0xffff) :
c <= 0xffff) {
len = 3;
buf[1] = (c >> 12) | 0xe0;
} else {
len = 4;
buf[0] = (c >> 18) | 0xf0;
buf[1] = ((c >> 12) & 0x3f) | 0x80;
}
buf[2] = ((c >> 6) & 0x3f) | 0x80;
}
buf[3] = (c & 0x3f) | 0x80;
s.append(buf + 4 - len, len);
}
} else if constexpr (sizeof(Unit) == 2) {
// UTF-16: Similar to U16_APPEND().
if (validate ?
c < 0xd800 || (c < 0xe000 || c > 0x10ffff ? (c = 0xfffd, true) : c <= 0xffff) :
c <= 0xffff) {
s.push_back(static_cast<Unit>(c));
} else {
Unit buf[2] = { U16_LEAD(c), U16_TRAIL(c) };
s.append(buf, 2);
}
} else {
// UTF-32
s.push_back(!validate || U_IS_SCALAR_VALUE(c) ? c : 0xfffd);
}
return s;
}
} // namespace prv
#endif // U_IN_DOXYGEN
#ifndef U_HIDE_DRAFT_API
/**
* Appends the code point to the string.
* Appends the U+FFFD replacement character instead if c is not a scalar value.
* See https://www.unicode.org/glossary/#unicode_scalar_value
*
* @tparam StringClass A version of std::basic_string (or a compatible type)
* @param s The string to append to
* @param c The code point to append
* @return s
* @draft ICU 78
* @see U_IS_SCALAR_VALUE
*/
template<typename StringClass>
inline StringClass &appendOrFFFD(StringClass &s, UChar32 c) {
return prv::appendCodePoint<StringClass, true>(s, c);
}
/**
* Appends the code point to the string.
* The code point must be a scalar value; otherwise the behavior is undefined.
* See https://www.unicode.org/glossary/#unicode_scalar_value
*
* @tparam StringClass A version of std::basic_string (or a compatible type)
* @param s The string to append to
* @param c The code point to append (must be a scalar value)
* @return s
* @draft ICU 78
* @see U_IS_SCALAR_VALUE
*/
template<typename StringClass>
inline StringClass &appendUnsafe(StringClass &s, UChar32 c) {
return prv::appendCodePoint<StringClass, false>(s, c);
}
/**
* Returns the code point as a string of code units.
* Returns the U+FFFD replacement character instead if c is not a scalar value.
* See https://www.unicode.org/glossary/#unicode_scalar_value
*
* @tparam StringClass A version of std::basic_string (or a compatible type)
* @param c The code point
* @return the string of c's code units
* @draft ICU 78
* @see U_IS_SCALAR_VALUE
*/
template<typename StringClass>
inline StringClass encodeOrFFFD(UChar32 c) {
StringClass s;
prv::appendCodePoint<StringClass, true>(s, c);
return s;
}
/**
* Returns the code point as a string of code units.
* The code point must be a scalar value; otherwise the behavior is undefined.
* See https://www.unicode.org/glossary/#unicode_scalar_value
*
* @tparam StringClass A version of std::basic_string (or a compatible type)
* @param c The code point
* @return the string of c's code units
* @draft ICU 78
* @see U_IS_SCALAR_VALUE
*/
template<typename StringClass>
inline StringClass encodeUnsafe(UChar32 c) {
StringClass s;
prv::appendCodePoint<StringClass, false>(s, c);
return s;
}
#endif // U_HIDE_DRAFT_API
} // namespace utfstring
} // namespace U_HEADER_ONLY_NAMESPACE
#endif // U_HIDE_DRAFT_API
#endif // U_SHOW_CPLUSPLUS_API || U_SHOW_CPLUSPLUS_HEADER_API
#endif // __UTFSTRING_H__
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| alphaindex.h | File | 26.43 KB | 0644 |
|
| appendable.h | File | 8.54 KB | 0644 |
|
| basictz.h | File | 9.99 KB | 0644 |
|
| brkiter.h | File | 28.52 KB | 0644 |
|
| bytestream.h | File | 11.79 KB | 0644 |
|
| bytestrie.h | File | 20.83 KB | 0644 |
|
| bytestriebuilder.h | File | 7.44 KB | 0644 |
|
| calendar.h | File | 110.47 KB | 0644 |
|
| caniter.h | File | 7.47 KB | 0644 |
|
| casemap.h | File | 25.42 KB | 0644 |
|
| char16ptr.h | File | 10.79 KB | 0644 |
|
| chariter.h | File | 23.79 KB | 0644 |
|
| choicfmt.h | File | 23.99 KB | 0644 |
|
| coleitr.h | File | 13.78 KB | 0644 |
|
| coll.h | File | 59.5 KB | 0644 |
|
| compactdecimalformat.h | File | 6.88 KB | 0644 |
|
| curramt.h | File | 3.67 KB | 0644 |
|
| currpinf.h | File | 7.3 KB | 0644 |
|
| currunit.h | File | 4.02 KB | 0644 |
|
| datefmt.h | File | 41.29 KB | 0644 |
|
| dbbi.h | File | 1.19 KB | 0644 |
|
| dcfmtsym.h | File | 21.27 KB | 0644 |
|
| decimfmt.h | File | 87.45 KB | 0644 |
|
| displayoptions.h | File | 7.08 KB | 0644 |
|
| docmain.h | File | 7.66 KB | 0644 |
|
| dtfmtsym.h | File | 41.04 KB | 0644 |
|
| dtintrv.h | File | 3.84 KB | 0644 |
|
| dtitvfmt.h | File | 49.2 KB | 0644 |
|
| dtitvinf.h | File | 18.54 KB | 0644 |
|
| dtptngen.h | File | 29.28 KB | 0644 |
|
| dtrule.h | File | 8.66 KB | 0644 |
|
| edits.h | File | 20.74 KB | 0644 |
|
| enumset.h | File | 2.08 KB | 0644 |
|
| errorcode.h | File | 4.84 KB | 0644 |
|
| fieldpos.h | File | 8.69 KB | 0644 |
|
| filteredbrk.h | File | 5.37 KB | 0644 |
|
| fmtable.h | File | 24.36 KB | 0644 |
|
| format.h | File | 12.78 KB | 0644 |
|
| formattednumber.h | File | 6.25 KB | 0644 |
|
| formattedvalue.h | File | 9.75 KB | 0644 |
|
| fpositer.h | File | 3.03 KB | 0644 |
|
| gender.h | File | 3.35 KB | 0644 |
|
| gregocal.h | File | 30.05 KB | 0644 |
|
| icudataver.h | File | 1.02 KB | 0644 |
|
| icuplug.h | File | 12.1 KB | 0644 |
|
| idna.h | File | 12.93 KB | 0644 |
|
| listformatter.h | File | 8.59 KB | 0644 |
|
| localebuilder.h | File | 11.09 KB | 0644 |
|
| localematcher.h | File | 26.86 KB | 0644 |
|
| localpointer.h | File | 19.52 KB | 0644 |
|
| locdspnm.h | File | 7.12 KB | 0644 |
|
| locid.h | File | 53.98 KB | 0644 |
|
| measfmt.h | File | 11.41 KB | 0644 |
|
| measunit.h | File | 133.12 KB | 0644 |
|
| measure.h | File | 4.63 KB | 0644 |
|
| messageformat2.h | File | 21.59 KB | 0644 |
|
| messageformat2_arguments.h | File | 3.84 KB | 0644 |
|
| messageformat2_data_model.h | File | 96.61 KB | 0644 |
|
| messageformat2_data_model_names.h | File | 784 B | 0644 |
|
| messageformat2_formattable.h | File | 39.37 KB | 0644 |
|
| messageformat2_function_registry.h | File | 18.07 KB | 0644 |
|
| messagepattern.h | File | 33.79 KB | 0644 |
|
| msgfmt.h | File | 44.94 KB | 0644 |
|
| normalizer2.h | File | 34.68 KB | 0644 |
|
| normlzr.h | File | 30.79 KB | 0644 |
|
| nounit.h | File | 2.24 KB | 0644 |
|
| numberformatter.h | File | 90.72 KB | 0644 |
|
| numberrangeformatter.h | File | 25.68 KB | 0644 |
|
| numfmt.h | File | 50.16 KB | 0644 |
|
| numsys.h | File | 7.22 KB | 0644 |
|
| parseerr.h | File | 3.08 KB | 0644 |
|
| parsepos.h | File | 5.56 KB | 0644 |
|
| platform.h | File | 27.19 KB | 0644 |
|
| plurfmt.h | File | 25.46 KB | 0644 |
|
| plurrule.h | File | 20.63 KB | 0644 |
|
| ptypes.h | File | 2.16 KB | 0644 |
|
| putil.h | File | 6.32 KB | 0644 |
|
| rbbi.h | File | 31.73 KB | 0644 |
|
| rbnf.h | File | 57.19 KB | 0644 |
|
| rbtz.h | File | 15.75 KB | 0644 |
|
| regex.h | File | 83.83 KB | 0644 |
|
| region.h | File | 9.2 KB | 0644 |
|
| reldatefmt.h | File | 22.69 KB | 0644 |
|
| rep.h | File | 9.38 KB | 0644 |
|
| resbund.h | File | 18.02 KB | 0644 |
|
| schriter.h | File | 6.09 KB | 0644 |
|
| scientificnumberformatter.h | File | 6.44 KB | 0644 |
|
| search.h | File | 22.21 KB | 0644 |
|
| selfmt.h | File | 14.35 KB | 0644 |
|
| simpleformatter.h | File | 12.6 KB | 0644 |
|
| simplenumberformatter.h | File | 8.87 KB | 0644 |
|
| simpletz.h | File | 45.62 KB | 0644 |
|
| smpdtfmt.h | File | 57.57 KB | 0644 |
|
| sortkey.h | File | 11.13 KB | 0644 |
|
| std_string.h | File | 1.05 KB | 0644 |
|
| strenum.h | File | 9.96 KB | 0644 |
|
| stringoptions.h | File | 5.79 KB | 0644 |
|
| stringpiece.h | File | 10.29 KB | 0644 |
|
| stringtriebuilder.h | File | 15.53 KB | 0644 |
|
| stsearch.h | File | 21.43 KB | 0644 |
|
| symtable.h | File | 4.28 KB | 0644 |
|
| tblcoll.h | File | 38.79 KB | 0644 |
|
| timezone.h | File | 45.59 KB | 0644 |
|
| tmunit.h | File | 3.37 KB | 0644 |
|
| tmutamt.h | File | 4.9 KB | 0644 |
|
| tmutfmt.h | File | 7.42 KB | 0644 |
|
| translit.h | File | 65.81 KB | 0644 |
|
| tzfmt.h | File | 44.76 KB | 0644 |
|
| tznames.h | File | 16.85 KB | 0644 |
|
| tzrule.h | File | 34.81 KB | 0644 |
|
| tztrans.h | File | 6.11 KB | 0644 |
|
| ubidi.h | File | 89.61 KB | 0644 |
|
| ubiditransform.h | File | 12.71 KB | 0644 |
|
| ubrk.h | File | 24.43 KB | 0644 |
|
| ucal.h | File | 63.95 KB | 0644 |
|
| ucasemap.h | File | 15.27 KB | 0644 |
|
| ucat.h | File | 5.35 KB | 0644 |
|
| uchar.h | File | 152.33 KB | 0644 |
|
| ucharstrie.h | File | 22.59 KB | 0644 |
|
| ucharstriebuilder.h | File | 7.48 KB | 0644 |
|
| uchriter.h | File | 13.24 KB | 0644 |
|
| uclean.h | File | 11.21 KB | 0644 |
|
| ucnv.h | File | 83.34 KB | 0644 |
|
| ucnv_cb.h | File | 6.58 KB | 0644 |
|
| ucnv_err.h | File | 20.98 KB | 0644 |
|
| ucnvsel.h | File | 6.24 KB | 0644 |
|
| ucol.h | File | 67.35 KB | 0644 |
|
| ucoleitr.h | File | 9.82 KB | 0644 |
|
| uconfig.h | File | 12.56 KB | 0644 |
|
| ucpmap.h | File | 5.54 KB | 0644 |
|
| ucptrie.h | File | 22.51 KB | 0644 |
|
| ucsdet.h | File | 14.69 KB | 0644 |
|
| ucurr.h | File | 16.72 KB | 0644 |
|
| udat.h | File | 62.66 KB | 0644 |
|
| udata.h | File | 15.63 KB | 0644 |
|
| udateintervalformat.h | File | 11.93 KB | 0644 |
|
| udatpg.h | File | 30.13 KB | 0644 |
|
| udisplaycontext.h | File | 5.94 KB | 0644 |
|
| udisplayoptions.h | File | 8.86 KB | 0644 |
|
| uenum.h | File | 7.79 KB | 0644 |
|
| ufieldpositer.h | File | 4.41 KB | 0644 |
|
| uformattable.h | File | 10.97 KB | 0644 |
|
| uformattednumber.h | File | 8.09 KB | 0644 |
|
| uformattedvalue.h | File | 12.25 KB | 0644 |
|
| ugender.h | File | 2.06 KB | 0644 |
|
| uidna.h | File | 34.12 KB | 0644 |
|
| uiter.h | File | 22.75 KB | 0644 |
|
| uldnames.h | File | 10.48 KB | 0644 |
|
| ulistformatter.h | File | 10.78 KB | 0644 |
|
| uloc.h | File | 55.38 KB | 0644 |
|
| ulocale.h | File | 6.31 KB | 0644 |
|
| ulocbuilder.h | File | 16.69 KB | 0644 |
|
| ulocdata.h | File | 11.3 KB | 0644 |
|
| umachine.h | File | 15.25 KB | 0644 |
|
| umisc.h | File | 1.34 KB | 0644 |
|
| umsg.h | File | 24.25 KB | 0644 |
|
| umutablecptrie.h | File | 8.3 KB | 0644 |
|
| unifilt.h | File | 4 KB | 0644 |
|
| unifunct.h | File | 4.05 KB | 0644 |
|
| unimatch.h | File | 6.1 KB | 0644 |
|
| unirepl.h | File | 3.38 KB | 0644 |
|
| uniset.h | File | 70.18 KB | 0644 |
|
| unistr.h | File | 184.51 KB | 0644 |
|
| unorm.h | File | 20.55 KB | 0644 |
|
| unorm2.h | File | 25.66 KB | 0644 |
|
| unum.h | File | 55.16 KB | 0644 |
|
| unumberformatter.h | File | 19.68 KB | 0644 |
|
| unumberoptions.h | File | 5.23 KB | 0644 |
|
| unumberrangeformatter.h | File | 15.35 KB | 0644 |
|
| unumsys.h | File | 7.26 KB | 0644 |
|
| uobject.h | File | 10.6 KB | 0644 |
|
| upluralrules.h | File | 8.79 KB | 0644 |
|
| uregex.h | File | 71.99 KB | 0644 |
|
| uregion.h | File | 9.81 KB | 0644 |
|
| ureldatefmt.h | File | 16.98 KB | 0644 |
|
| urename.h | File | 142.22 KB | 0644 |
|
| urep.h | File | 5.38 KB | 0644 |
|
| ures.h | File | 36.65 KB | 0644 |
|
| uscript.h | File | 28.95 KB | 0644 |
|
| usearch.h | File | 39.21 KB | 0644 |
|
| uset.h | File | 63.03 KB | 0644 |
|
| usetiter.h | File | 9.63 KB | 0644 |
|
| ushape.h | File | 18 KB | 0644 |
|
| usimplenumberformatter.h | File | 7.31 KB | 0644 |
|
| uspoof.h | File | 80 KB | 0644 |
|
| usprep.h | File | 8.19 KB | 0644 |
|
| ustdio.h | File | 38.58 KB | 0644 |
|
| ustream.h | File | 1.89 KB | 0644 |
|
| ustring.h | File | 72.16 KB | 0644 |
|
| ustringtrie.h | File | 3.15 KB | 0644 |
|
| utext.h | File | 58.1 KB | 0644 |
|
| utf.h | File | 8.65 KB | 0644 |
|
| utf16.h | File | 23.35 KB | 0644 |
|
| utf32.h | File | 763 B | 0644 |
|
| utf8.h | File | 31.65 KB | 0644 |
|
| utf_old.h | File | 45.85 KB | 0644 |
|
| utfiterator.h | File | 95.02 KB | 0644 |
|
| utfstring.h | File | 4.89 KB | 0644 |
|
| utmscale.h | File | 13.78 KB | 0644 |
|
| utrace.h | File | 17.18 KB | 0644 |
|
| utrans.h | File | 25.54 KB | 0644 |
|
| utypes.h | File | 36.73 KB | 0644 |
|
| uvernum.h | File | 6.33 KB | 0644 |
|
| uversion.h | File | 8.21 KB | 0644 |
|
| vtzone.h | File | 20.68 KB | 0644 |
|