@@ -4815,7 +4815,7 @@ namespace Firebird
48154815 }
48164816 };
48174817
4818- #define FIREBIRD_IUTIL_VERSION 5u
4818+ #define FIREBIRD_IUTIL_VERSION 6u
48194819
48204820 class IUtil : public IVersioned
48214821 {
@@ -4845,6 +4845,7 @@ namespace Firebird
48454845 void (CLOOP_CARG *decodeTimeTzEx)(IUtil* self, IStatus* status, const ISC_TIME_TZ_EX* timeTz, unsigned* hours, unsigned* minutes, unsigned* seconds, unsigned* fractions, unsigned timeZoneBufferLength, char* timeZoneBuffer) CLOOP_NOEXCEPT;
48464846 void (CLOOP_CARG *decodeTimeStampTzEx)(IUtil* self, IStatus* status, const ISC_TIMESTAMP_TZ_EX* timeStampTz, unsigned* year, unsigned* month, unsigned* day, unsigned* hours, unsigned* minutes, unsigned* seconds, unsigned* fractions, unsigned timeZoneBufferLength, char* timeZoneBuffer) CLOOP_NOEXCEPT;
48474847 IAttachment* (CLOOP_CARG *executeCreateDatabase2)(IUtil* self, IStatus* status, unsigned stmtLength, const char* creatDBstatement, unsigned dialect, unsigned dpbLength, const unsigned char* dpb, FB_BOOLEAN* stmtIsCreateDb) CLOOP_NOEXCEPT;
4848+ void (CLOOP_CARG *convert)(IUtil* self, IStatus* status, unsigned sourceType, unsigned sourceScale, unsigned sourceLength, const void* source, unsigned targetType, unsigned targetScale, unsigned targetLength, void* target) CLOOP_NOEXCEPT;
48484849 };
48494850
48504851 protected:
@@ -5079,6 +5080,19 @@ namespace Firebird
50795080 StatusType::checkException(status);
50805081 return ret;
50815082 }
5083+
5084+ template <typename StatusType> void convert(StatusType* status, unsigned sourceType, unsigned sourceScale, unsigned sourceLength, const void* source, unsigned targetType, unsigned targetScale, unsigned targetLength, void* target)
5085+ {
5086+ if (cloopVTable->version < 6)
5087+ {
5088+ StatusType::setVersionError(status, "IUtil", cloopVTable->version, 6);
5089+ StatusType::checkException(status);
5090+ return;
5091+ }
5092+ StatusType::clearException(status);
5093+ static_cast<VTable*>(this->cloopVTable)->convert(this, status, sourceType, sourceScale, sourceLength, source, targetType, targetScale, targetLength, target);
5094+ StatusType::checkException(status);
5095+ }
50825096 };
50835097
50845098#define FIREBIRD_IOFFSETS_CALLBACK_VERSION 2u
@@ -16430,6 +16444,7 @@ namespace Firebird
1643016444 this->decodeTimeTzEx = &Name::cloopdecodeTimeTzExDispatcher;
1643116445 this->decodeTimeStampTzEx = &Name::cloopdecodeTimeStampTzExDispatcher;
1643216446 this->executeCreateDatabase2 = &Name::cloopexecuteCreateDatabase2Dispatcher;
16447+ this->convert = &Name::cloopconvertDispatcher;
1643316448 }
1643416449 } vTable;
1643516450
@@ -16756,6 +16771,20 @@ namespace Firebird
1675616771 return static_cast<IAttachment*>(0);
1675716772 }
1675816773 }
16774+
16775+ static void CLOOP_CARG cloopconvertDispatcher(IUtil* self, IStatus* status, unsigned sourceType, unsigned sourceScale, unsigned sourceLength, const void* source, unsigned targetType, unsigned targetScale, unsigned targetLength, void* target) CLOOP_NOEXCEPT
16776+ {
16777+ StatusType status2(status);
16778+
16779+ try
16780+ {
16781+ static_cast<Name*>(self)->Name::convert(&status2, sourceType, sourceScale, sourceLength, source, targetType, targetScale, targetLength, target);
16782+ }
16783+ catch (...)
16784+ {
16785+ StatusType::catchException(&status2);
16786+ }
16787+ }
1675916788 };
1676016789
1676116790 template <typename Name, typename StatusType, typename Base = IVersionedImpl<Name, StatusType, Inherit<IUtil> > >
@@ -16794,6 +16823,7 @@ namespace Firebird
1679416823 virtual void decodeTimeTzEx(StatusType* status, const ISC_TIME_TZ_EX* timeTz, unsigned* hours, unsigned* minutes, unsigned* seconds, unsigned* fractions, unsigned timeZoneBufferLength, char* timeZoneBuffer) = 0;
1679516824 virtual void decodeTimeStampTzEx(StatusType* status, const ISC_TIMESTAMP_TZ_EX* timeStampTz, unsigned* year, unsigned* month, unsigned* day, unsigned* hours, unsigned* minutes, unsigned* seconds, unsigned* fractions, unsigned timeZoneBufferLength, char* timeZoneBuffer) = 0;
1679616825 virtual IAttachment* executeCreateDatabase2(StatusType* status, unsigned stmtLength, const char* creatDBstatement, unsigned dialect, unsigned dpbLength, const unsigned char* dpb, FB_BOOLEAN* stmtIsCreateDb) = 0;
16826+ virtual void convert(StatusType* status, unsigned sourceType, unsigned sourceScale, unsigned sourceLength, const void* source, unsigned targetType, unsigned targetScale, unsigned targetLength, void* target) = 0;
1679716827 };
1679816828
1679916829 template <typename Name, typename StatusType, typename Base>
0 commit comments