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

Method convert

src/yvalve/utl.cpp:802–837  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

800}
801
802void UtilInterface::convert(Firebird::CheckStatusWrapper* status,
803 unsigned sourceType, unsigned sourceScale, unsigned sourceLength, const void* source,
804 unsigned targetType, unsigned targetScale, unsigned targetLength, void* target)
805{
806 dsc sourceDesc;
807 memset(&sourceDesc, 0, sizeof(sourceDesc));
808 sourceDesc.dsc_dtype = fb_utils::sqlTypeToDscType(sourceType);
809 sourceDesc.dsc_scale = sourceScale;
810 sourceDesc.dsc_length = sourceLength;
811 if (sourceDesc.isText())
812 sourceDesc.setTextType(CS_dynamic);
813 sourceDesc.dsc_address = (UCHAR*) source;
814
815 dsc targetDesc;
816 memset(&targetDesc, 0, sizeof(targetDesc));
817 targetDesc.dsc_dtype = fb_utils::sqlTypeToDscType(targetType);
818 targetDesc.dsc_scale = targetScale;
819 targetDesc.dsc_length = targetLength;
820 if (targetDesc.isText())
821 targetDesc.setTextType(CS_dynamic);
822 targetDesc.dsc_address = static_cast<UCHAR*>(target);
823
824 try
825 {
826 CVT_move(&sourceDesc, &targetDesc, 0,
827 [](const Arg::StatusVector& status)
828 {
829 status.raise();
830 }
831 );
832 }
833 catch (const Exception& ex)
834 {
835 ex.stuffException(status);
836 }
837}
838
839ISC_DATE UtilInterface::encodeDate(unsigned year, unsigned month, unsigned day)
840{

Callers

nothing calls this directly

Calls 6

sqlTypeToDscTypeFunction · 0.85
isTextMethod · 0.80
setTextTypeMethod · 0.80
CVT_moveFunction · 0.50
raiseMethod · 0.45
stuffExceptionMethod · 0.45

Tested by

no test coverage detected