/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// get the columnvalue as string with a default format given by the column or a default format // for the type
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);
/** 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.
*/ inlinedouble toNullDate(const css::util::Date& _rNullDate, double _rVal) { return _rVal - toDays(_rNullDate); }
// return the date from the numberformatsupplier or the STANDARD_DATE (1900,1,1)
OOO_DLLPUBLIC_DBTOOLS css::util::Date getNULLDate(const css::uno::Reference< css::util::XNumberFormatsSupplier > &xSupplier);
// return the date in the format %04d-%02d-%02d
OOO_DLLPUBLIC_DBTOOLS OUString toDateString(const css::util::Date& rDate); // return the time in the format %02d:%02d:%02d
OOO_DLLPUBLIC_DBTOOLS OUString toTimeStringS(const css::util::Time& rTime); // return the time in the format %02d:%02d:%02d.%09d
OOO_DLLPUBLIC_DBTOOLS OUString toTimeString(const css::util::Time& rTime); // return the DateTime in the format %04d-%02d-%02d %02d:%02d:%02d.%09d
OOO_DLLPUBLIC_DBTOOLS OUString toDateTimeString(const css::util::DateTime& _rDateTime); // return the any in an sql standard format
OOO_DLLPUBLIC_DBTOOLS OUString toSQLString(sal_Int32 eType, const css::uno::Any& _rVal, const css::uno::Reference< css::script::XTypeConverter >& _rxTypeConverter);
/** converts a Unicode string into a 8-bit string, using the given encoding
@param _rSource the source string to convert @param _rDest the destination string @param _eEncoding the encoding to use for the conversion
@throws css::sdbc::SQLException if 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")
@return the length of the converted string
*/
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
@param _rSource the source string to convert
@param _rDest the destination string
@param _nMaxLen the maximum length of the destination string
@param _eEncoding the encoding to use for the conversion
@throws css::sdbc::SQLException if convertUnicodeString, which is called internally, throws such an exception
@throws css::sdbc::SQLException if the conversion results in a string which is longer than _nMaxLen
@return the length of the converted string
*/
OOO_DLLPUBLIC_DBTOOLS sal_Int32 convertUnicodeStringToLength( const OUString& _rSource,
OString& _rDest,
sal_Int32 _nMaxLen,
rtl_TextEncoding _eEncoding
);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.