@@ -4542,6 +4542,7 @@ namespace Firebird
45424542 IInt128* (CLOOP_CARG *getInt128)(IUtil* self, IStatus* status) throw();
45434543 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) throw();
45444544 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) throw();
4545+ 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) throw();
45454546 };
45464547
45474548 protected:
@@ -4555,7 +4556,7 @@ namespace Firebird
45554556 }
45564557
45574558 public:
4558- static const unsigned VERSION = 4 ;
4559+ static const unsigned VERSION = 5 ;
45594560
45604561 template <typename StatusType> void getFbVersion(StatusType* status, IAttachment* att, IVersionCallback* callback)
45614562 {
@@ -4762,6 +4763,19 @@ namespace Firebird
47624763 static_cast<VTable*>(this->cloopVTable)->decodeTimeStampTzEx(this, status, timeStampTz, year, month, day, hours, minutes, seconds, fractions, timeZoneBufferLength, timeZoneBuffer);
47634764 StatusType::checkException(status);
47644765 }
4766+
4767+ template <typename StatusType> void convert(StatusType* status, unsigned sourceType, unsigned sourceScale, unsigned sourceLength, const void* source, unsigned targetType, unsigned targetScale, unsigned targetLength, void* target)
4768+ {
4769+ if (cloopVTable->version < 5)
4770+ {
4771+ StatusType::setVersionError(status, "IUtil", cloopVTable->version, 5);
4772+ StatusType::checkException(status);
4773+ return;
4774+ }
4775+ StatusType::clearException(status);
4776+ static_cast<VTable*>(this->cloopVTable)->convert(this, status, sourceType, sourceScale, sourceLength, source, targetType, targetScale, targetLength, target);
4777+ StatusType::checkException(status);
4778+ }
47654779 };
47664780
47674781 class IOffsetsCallback : public IVersioned
@@ -15457,6 +15471,7 @@ namespace Firebird
1545715471 this->getInt128 = &Name::cloopgetInt128Dispatcher;
1545815472 this->decodeTimeTzEx = &Name::cloopdecodeTimeTzExDispatcher;
1545915473 this->decodeTimeStampTzEx = &Name::cloopdecodeTimeStampTzExDispatcher;
15474+ this->convert = &Name::cloopconvertDispatcher;
1546015475 }
1546115476 } vTable;
1546215477
@@ -15768,6 +15783,20 @@ namespace Firebird
1576815783 StatusType::catchException(&status2);
1576915784 }
1577015785 }
15786+
15787+ 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) throw()
15788+ {
15789+ StatusType status2(status);
15790+
15791+ try
15792+ {
15793+ static_cast<Name*>(self)->Name::convert(&status2, sourceType, sourceScale, sourceLength, source, targetType, targetScale, targetLength, target);
15794+ }
15795+ catch (...)
15796+ {
15797+ StatusType::catchException(&status2);
15798+ }
15799+ }
1577115800 };
1577215801
1577315802 template <typename Name, typename StatusType, typename Base = IVersionedImpl<Name, StatusType, Inherit<IUtil> > >
@@ -15805,6 +15834,7 @@ namespace Firebird
1580515834 virtual IInt128* getInt128(StatusType* status) = 0;
1580615835 virtual void decodeTimeTzEx(StatusType* status, const ISC_TIME_TZ_EX* timeTz, unsigned* hours, unsigned* minutes, unsigned* seconds, unsigned* fractions, unsigned timeZoneBufferLength, char* timeZoneBuffer) = 0;
1580715836 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;
15837+ virtual void convert(StatusType* status, unsigned sourceType, unsigned sourceScale, unsigned sourceLength, const void* source, unsigned targetType, unsigned targetScale, unsigned targetLength, void* target) = 0;
1580815838 };
1580915839
1581015840 template <typename Name, typename StatusType, typename Base>
0 commit comments