@@ -4815,7 +4815,7 @@ namespace Firebird
4815
4815
}
4816
4816
};
4817
4817
4818
- #define FIREBIRD_IUTIL_VERSION 5u
4818
+ #define FIREBIRD_IUTIL_VERSION 6u
4819
4819
4820
4820
class IUtil : public IVersioned
4821
4821
{
@@ -4845,6 +4845,7 @@ namespace Firebird
4845
4845
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;
4846
4846
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;
4847
4847
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;
4848
4849
};
4849
4850
4850
4851
protected:
@@ -5079,6 +5080,19 @@ namespace Firebird
5079
5080
StatusType::checkException(status);
5080
5081
return ret;
5081
5082
}
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
+ }
5082
5096
};
5083
5097
5084
5098
#define FIREBIRD_IOFFSETS_CALLBACK_VERSION 2u
@@ -16430,6 +16444,7 @@ namespace Firebird
16430
16444
this->decodeTimeTzEx = &Name::cloopdecodeTimeTzExDispatcher;
16431
16445
this->decodeTimeStampTzEx = &Name::cloopdecodeTimeStampTzExDispatcher;
16432
16446
this->executeCreateDatabase2 = &Name::cloopexecuteCreateDatabase2Dispatcher;
16447
+ this->convert = &Name::cloopconvertDispatcher;
16433
16448
}
16434
16449
} vTable;
16435
16450
@@ -16756,6 +16771,20 @@ namespace Firebird
16756
16771
return static_cast<IAttachment*>(0);
16757
16772
}
16758
16773
}
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
+ }
16759
16788
};
16760
16789
16761
16790
template <typename Name, typename StatusType, typename Base = IVersionedImpl<Name, StatusType, Inherit<IUtil> > >
@@ -16794,6 +16823,7 @@ namespace Firebird
16794
16823
virtual void decodeTimeTzEx(StatusType* status, const ISC_TIME_TZ_EX* timeTz, unsigned* hours, unsigned* minutes, unsigned* seconds, unsigned* fractions, unsigned timeZoneBufferLength, char* timeZoneBuffer) = 0;
16795
16824
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;
16796
16825
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;
16797
16827
};
16798
16828
16799
16829
template <typename Name, typename StatusType, typename Base>
0 commit comments