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

Method result

src/jrd/Collation.cpp:299–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297 }
298
299 virtual bool result()
300 {
301 UCharBuffer utfBuffer;
302 const auto charSetId = textType->getCharSet()->getId();
303 UCharBuffer* bufferPtr = &buffer;
304
305 if (charSetId != CS_NONE && charSetId != CS_BINARY && charSetId != CS_UTF8)
306 {
307 converter.convert(buffer.getCount(), buffer.begin(), utfBuffer);
308 bufferPtr = &utfBuffer;
309 }
310
311 if (textType->getAttributes() & TEXTTYPE_ATTR_ACCENT_INSENSITIVE)
312 UnicodeUtil::utf8Normalize(*bufferPtr);
313
314 if (!regex->matches((const char*) bufferPtr->begin(), bufferPtr->getCount(), &resultStart, &resultLength))
315 return false;
316
317 if (charSetId != CS_NONE && charSetId != CS_BINARY)
318 {
319 // Get the character positions in the utf-8 string.
320 auto utf8CharSet = IntlUtil::getUtf8CharSet();
321 resultLength = utf8CharSet->length(resultLength, bufferPtr->begin() + resultStart, true);
322 resultStart = utf8CharSet->length(resultStart, bufferPtr->begin(), true);
323 }
324
325 return true;
326 }
327
328 virtual void getResultInfo(unsigned* start, unsigned* length)
329 {

Callers

nothing calls this directly

Calls 8

getAttributesMethod · 0.80
getIdMethod · 0.45
getCharSetMethod · 0.45
convertMethod · 0.45
getCountMethod · 0.45
beginMethod · 0.45
matchesMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected