LibreOffice Module connectivity (master) 1
Functions
dbtools::DBTypeConversion Namespace Reference

Functions

OOO_DLLPUBLIC_DBTOOLS css::util::Date const & getStandardDate ()
 
OOO_DLLPUBLIC_DBTOOLS void setValue (const css::uno::Reference< css::sdb::XColumnUpdate > &xVariant, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter, const css::util::Date &rNullDate, const OUString &rString, sal_Int32 nKey, sal_Int16 nFieldType, sal_Int16 nKeyType)
 
OOO_DLLPUBLIC_DBTOOLS void setValue (const css::uno::Reference< css::sdb::XColumnUpdate > &xVariant, const css::util::Date &rNullDate, const double &rValue, sal_Int16 nKeyType)
 
OOO_DLLPUBLIC_DBTOOLS double getValue (const css::uno::Reference< css::sdb::XColumn > &xVariant, const css::util::Date &rNullDate)
 
OOO_DLLPUBLIC_DBTOOLS OUString getFormattedValue (const css::uno::Reference< css::beans::XPropertySet > &_xColumn, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter, const css::lang::Locale &_rLocale, const css::util::Date &rNullDate)
 
OOO_DLLPUBLIC_DBTOOLS OUString getFormattedValue (const css::uno::Reference< css::sdb::XColumn > &_xColumn, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter, const css::util::Date &rNullDate, sal_Int32 nKey, sal_Int16 nKeyType)
 
OOO_DLLPUBLIC_DBTOOLS css::util::Date toDate (double dVal, const css::util::Date &_rNullDate=getStandardDate())
 
OOO_DLLPUBLIC_DBTOOLS css::util::Date toDate (std::u16string_view _sSQLDate)
 
OOO_DLLPUBLIC_DBTOOLS css::util::Time toTime (double dVal, short nDigits=9)
 
OOO_DLLPUBLIC_DBTOOLS css::util::Time toTime (std::u16string_view _sSQLDate)
 
OOO_DLLPUBLIC_DBTOOLS css::util::DateTime toDateTime (double dVal, const css::util::Date &_rNullDate=getStandardDate())
 
OOO_DLLPUBLIC_DBTOOLS css::util::DateTime toDateTime (const OUString &_sSQLDate)
 
OOO_DLLPUBLIC_DBTOOLS sal_Int64 getNsFromTime (const css::util::Time &rVal)
 
OOO_DLLPUBLIC_DBTOOLS sal_Int32 toDays (const css::util::Date &_rVal, const css::util::Date &_rNullDate=getStandardDate())
 
OOO_DLLPUBLIC_DBTOOLS double toDouble (const css::util::Date &rVal, const css::util::Date &_rNullDate=getStandardDate())
 
OOO_DLLPUBLIC_DBTOOLS double toDouble (const css::util::Time &rVal)
 
OOO_DLLPUBLIC_DBTOOLS double toDouble (const css::util::DateTime &rVal, const css::util::Date &_rNullDate=getStandardDate())
 
OOO_DLLPUBLIC_DBTOOLS css::util::Date toDate (sal_Int32 _nVal)
 
OOO_DLLPUBLIC_DBTOOLS css::util::Time toTime (sal_Int64 _nVal)
 
double toNullDate (const css::util::Date &_rNullDate, double _rVal)
 convert a double which is a date value relative to the standard db null date into a date value relative to a given fixed date. More...
 
OOO_DLLPUBLIC_DBTOOLS css::util::Date getNULLDate (const css::uno::Reference< css::util::XNumberFormatsSupplier > &xSupplier)
 
OOO_DLLPUBLIC_DBTOOLS OUString toDateString (const css::util::Date &rDate)
 
OOO_DLLPUBLIC_DBTOOLS OUString toTimeStringS (const css::util::Time &rTime)
 
OOO_DLLPUBLIC_DBTOOLS OUString toTimeString (const css::util::Time &rTime)
 
OOO_DLLPUBLIC_DBTOOLS OUString toDateTimeString (const css::util::DateTime &_rDateTime)
 
OOO_DLLPUBLIC_DBTOOLS OUString toSQLString (sal_Int32 eType, const css::uno::Any &_rVal, const css::uno::Reference< css::script::XTypeConverter > &_rxTypeConverter)
 
OOO_DLLPUBLIC_DBTOOLS sal_Int32 convertUnicodeString (const OUString &_rSource, OString &_rDest, rtl_TextEncoding _eEncoding)
 converts a Unicode string into a 8-bit string, using the given encoding More...
 
OOO_DLLPUBLIC_DBTOOLS sal_Int32 convertUnicodeStringToLength (const OUString &_rSource, OString &_rDest, sal_Int32 _nMaxLen, rtl_TextEncoding _eEncoding)
 converts a Unicode string into a 8-bit string, using the given encoding More...
 

Function Documentation

◆ convertUnicodeString()

sal_Int32 dbtools::DBTypeConversion::convertUnicodeString ( const OUString &  _rSource,
OString &  _rDest,
rtl_TextEncoding  _eEncoding 
)

converts a Unicode string into a 8-bit string, using the given encoding

Parameters
_rSourcethe source string to convert
_rDestthe destination string
_eEncodingthe encoding to use for the conversion
Exceptions
css::sdbc::SQLExceptionif the given string contains characters which are not convertible using the given encoding The SQLState of the exception will be set to 22018 ("Invalid character value for cast specification")
Returns
the length of the converted string

Definition at line 887 of file dbtools2.cxx.

References Any, connectivity::SharedResources::getResourceStringWithSubstitution(), and sMessage.

Referenced by convertUnicodeStringToLength().

◆ convertUnicodeStringToLength()

sal_Int32 dbtools::DBTypeConversion::convertUnicodeStringToLength ( const OUString &  _rSource,
OString &  _rDest,
sal_Int32  _nMaxLen,
rtl_TextEncoding  _eEncoding 
)

converts a Unicode string into a 8-bit string, using the given encoding

Parameters
_rSourcethe source string to convert
_rDestthe destination string
_nMaxLenthe maximum length of the destination string
_eEncodingthe encoding to use for the conversion
Exceptions
css::sdbc::SQLExceptionif convertUnicodeString, which is called internally, throws such an exception
css::sdbc::SQLExceptionif the conversion results in a string which is longer than _nMaxLen
Returns
the length of the converted string

Definition at line 915 of file dbtools2.cxx.

References Any, convertUnicodeString(), connectivity::SharedResources::getResourceStringWithSubstitution(), and sMessage.

◆ getFormattedValue() [1/2]

OOO_DLLPUBLIC_DBTOOLS OUString dbtools::DBTypeConversion::getFormattedValue ( const css::uno::Reference< css::beans::XPropertySet > &  _xColumn,
const css::uno::Reference< css::util::XNumberFormatter > &  xFormatter,
const css::lang::Locale &  _rLocale,
const css::util::Date &  rNullDate 
)

◆ getFormattedValue() [2/2]

OOO_DLLPUBLIC_DBTOOLS OUString dbtools::DBTypeConversion::getFormattedValue ( const css::uno::Reference< css::sdb::XColumn > &  _xColumn,
const css::uno::Reference< css::util::XNumberFormatter > &  xFormatter,
const css::util::Date &  rNullDate,
sal_Int32  nKey,
sal_Int16  nKeyType 
)

◆ getNsFromTime()

sal_Int64 dbtools::DBTypeConversion::getNsFromTime ( const css::util::Time &  rVal)

Definition at line 139 of file dbconversion.cxx.

Referenced by toDouble().

◆ getNULLDate()

OOO_DLLPUBLIC_DBTOOLS css::util::Date dbtools::DBTypeConversion::getNULLDate ( const css::uno::Reference< css::util::XNumberFormatsSupplier > &  xSupplier)

◆ getStandardDate()

css::util::Date const & dbtools::DBTypeConversion::getStandardDate ( )

Definition at line 70 of file dbconversion.cxx.

Referenced by connectivity::macab::MacabRecord::createMacabField().

◆ getValue()

OOO_DLLPUBLIC_DBTOOLS double dbtools::DBTypeConversion::getValue ( const css::uno::Reference< css::sdb::XColumn > &  xVariant,
const css::util::Date &  rNullDate 
)

◆ setValue() [1/2]

OOO_DLLPUBLIC_DBTOOLS void dbtools::DBTypeConversion::setValue ( const css::uno::Reference< css::sdb::XColumnUpdate > &  xVariant,
const css::uno::Reference< css::util::XNumberFormatter > &  xFormatter,
const css::util::Date &  rNullDate,
const OUString &  rString,
sal_Int32  nKey,
sal_Int16  nFieldType,
sal_Int16  nKeyType 
)
Exceptions
css::lang::IllegalArgumentException

Referenced by dbtools::FormattedColumnValue::setFormattedValue().

◆ setValue() [2/2]

OOO_DLLPUBLIC_DBTOOLS void dbtools::DBTypeConversion::setValue ( const css::uno::Reference< css::sdb::XColumnUpdate > &  xVariant,
const css::util::Date &  rNullDate,
const double &  rValue,
sal_Int16  nKeyType 
)
Exceptions
css::lang::IllegalArgumentException

◆ toDate() [1/3]

css::util::Date dbtools::DBTypeConversion::toDate ( double  dVal,
const css::util::Date &  _rNullDate = getStandardDate() 
)

◆ toDate() [2/3]

css::util::Date dbtools::DBTypeConversion::toDate ( sal_Int32  _nVal)

Definition at line 118 of file dbconversion.cxx.

◆ toDate() [3/3]

css::util::Date dbtools::DBTypeConversion::toDate ( std::u16string_view  _sSQLDate)

Definition at line 336 of file dbconversion.cxx.

References o3tl::getToken(), nIndex, and o3tl::toInt32().

◆ toDateString()

OUString dbtools::DBTypeConversion::toDateString ( const css::util::Date &  rDate)

◆ toDateTime() [1/2]

css::util::DateTime dbtools::DBTypeConversion::toDateTime ( const OUString &  _sSQLDate)

Definition at line 357 of file dbconversion.cxx.

References begin, p, toDate(), and toTime().

◆ toDateTime() [2/2]

css::util::DateTime dbtools::DBTypeConversion::toDateTime ( double  dVal,
const css::util::Date &  _rNullDate = getStandardDate() 
)

◆ toDateTimeString()

OUString dbtools::DBTypeConversion::toDateTimeString ( const css::util::DateTime &  _rDateTime)

◆ toDays()

sal_Int32 dbtools::DBTypeConversion::toDays ( const css::util::Date &  _rVal,
const css::util::Date &  _rNullDate = getStandardDate() 
)

◆ toDouble() [1/3]

double dbtools::DBTypeConversion::toDouble ( const css::util::Date &  rVal,
const css::util::Date &  _rNullDate = getStandardDate() 
)

◆ toDouble() [2/3]

double dbtools::DBTypeConversion::toDouble ( const css::util::DateTime &  rVal,
const css::util::Date &  _rNullDate = getStandardDate() 
)

Definition at line 191 of file dbconversion.cxx.

References toDays(), and toDouble().

◆ toDouble() [3/3]

double dbtools::DBTypeConversion::toDouble ( const css::util::Time &  rVal)

Definition at line 185 of file dbconversion.cxx.

References getNsFromTime().

◆ toNullDate()

double dbtools::DBTypeConversion::toNullDate ( const css::util::Date &  _rNullDate,
double  _rVal 
)
inline

convert a double which is a date value relative to the standard db null date into a date value relative to a given fixed date.

Definition at line 112 of file dbconversion.hxx.

References toDays().

◆ toSQLString()

OOO_DLLPUBLIC_DBTOOLS OUString dbtools::DBTypeConversion::toSQLString ( sal_Int32  eType,
const css::uno::Any &  _rVal,
const css::uno::Reference< css::script::XTypeConverter > &  _rxTypeConverter 
)

◆ toTime() [1/3]

css::util::Time dbtools::DBTypeConversion::toTime ( double  dVal,
short  nDigits = 9 
)

◆ toTime() [2/3]

css::util::Time dbtools::DBTypeConversion::toTime ( sal_Int64  _nVal)

Definition at line 128 of file dbconversion.cxx.

◆ toTime() [3/3]

css::util::Time dbtools::DBTypeConversion::toTime ( std::u16string_view  _sSQLDate)

Definition at line 381 of file dbconversion.cxx.

◆ toTimeString()

OUString dbtools::DBTypeConversion::toTimeString ( const css::util::Time &  rTime)

◆ toTimeStringS()

OUString dbtools::DBTypeConversion::toTimeStringS ( const css::util::Time &  rTime)

Definition at line 87 of file dbconversion.cxx.

Referenced by connectivity::java_sql_Time::java_sql_Time().