MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / toUpper

Method toUpper

src/common/IntlUtil.cpp:623–646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

621
622
623ULONG IntlUtil::toUpper(Jrd::CharSet* cs, ULONG srcLen, const UCHAR* src, ULONG dstLen, UCHAR* dst,
624 const ULONG* exceptions)
625{
626 const ULONG utf16_length = cs->getConvToUnicode().convertLength(srcLen);
627 Firebird::HalfStaticArray<UCHAR, BUFFER_SMALL> utf16_str;
628 UCHAR* utf16_ptr;
629
630 if (dst != src && dstLen >= utf16_length) // if dst buffer is sufficient large, use it as intermediate
631 utf16_ptr = dst;
632 else
633 utf16_ptr = utf16_str.getBuffer(utf16_length);
634
635 // convert to UTF-16
636 srcLen = cs->getConvToUnicode().convert(srcLen, src, utf16_length, utf16_ptr);
637
638 // convert to uppercase
639 Firebird::HalfStaticArray<UCHAR, BUFFER_SMALL> upper_str;
640 srcLen = UnicodeUtil::utf16UpperCase(srcLen, Firebird::Aligner<USHORT>(utf16_ptr, srcLen),
641 utf16_length, Firebird::OutAligner<USHORT>(upper_str.getBuffer(utf16_length), utf16_length),
642 exceptions);
643
644 // convert to original character set
645 return cs->getConvFromUnicode().convert(srcLen, upper_str.begin(), dstLen, dst);
646}
647
648
649bool IntlUtil::readOneChar(Jrd::CharSet* cs, const UCHAR** s, const UCHAR* end, ULONG* size)

Callers

nothing calls this directly

Calls 6

getConvToUnicodeMethod · 0.80
getConvFromUnicodeMethod · 0.80
convertLengthMethod · 0.45
getBufferMethod · 0.45
convertMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected