Tag: cws_src680_oj14 User: fs Date: 2007-06-04 13:19:36+0000 Log: outsourced the container of wrappers, too
File Changes: Directory: /dba/connectivity/source/commontools/ ================================================ File [changed]: paramwrapper.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/paramwrapper.cxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +54 -4 -------------------- --- paramwrapper.cxx 2007-06-04 13:03:52+0000 1.1.2.1 +++ paramwrapper.cxx 2007-06-04 13:19:34+0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: paramwrapper.cxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: fs $ $Date: 2007/06/04 13:03:52 $ + * last change: $Author: fs $ $Date: 2007/06/04 13:19:34 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -34,20 +34,23 @@ ************************************************************************/ #ifndef CONNECTIVITY_PARAMWRAPPER_HXX -#include "paramwrapper.hxx" +#include <connectivity/paramwrapper.hxx> #endif /** === begin UNO includes === **/ #ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ #include <com/sun/star/beans/PropertyAttribute.hpp> #endif +#ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_ #include <com/sun/star/sdbc/DataType.hpp> +#endif #ifndef _COM_SUN_STAR_LANG_WRAPPEDTARGETEXCEPTION_HPP_ #include <com/sun/star/lang/WrappedTargetException.hpp> #endif /** === end UNO includes === **/ #include <tools/diagnose_ex.h> +#include <comphelper/enumhelper.hxx> #define PROPERTY_ID_VALUE 1000 @@ -75,6 +78,8 @@ using ::com::sun::star::lang::IllegalArgumentException; using ::com::sun::star::sdbc::SQLException; using ::com::sun::star::lang::WrappedTargetException; + using ::com::sun::star::lang::IndexOutOfBoundsException; + using ::com::sun::star::container::XEnumeration; /** === end UNO using === **/ namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute; namespace DataType = ::com::sun::star::sdbc::DataType; @@ -236,6 +241,51 @@ } } + //==================================================================== + //= ParameterWrapperContainer + //==================================================================== + //-------------------------------------------------------------------- + ParameterWrapperContainer::ParameterWrapperContainer() + { + } + + //-------------------------------------------------------------------- + Type SAL_CALL ParameterWrapperContainer::getElementType() throw( RuntimeException ) + { + return ::getCppuType( static_cast< Reference< XPropertySet >* >( NULL ) ); + } + + //-------------------------------------------------------------------- + sal_Bool SAL_CALL ParameterWrapperContainer::hasElements() throw( RuntimeException ) + { + return !m_aParameters.empty(); + } + + //-------------------------------------------------------------------- + sal_Int32 SAL_CALL ParameterWrapperContainer::getCount() throw( RuntimeException ) + { + return m_aParameters.size(); + } + + //-------------------------------------------------------------------- + Any SAL_CALL ParameterWrapperContainer::getByIndex( sal_Int32 _nIndex ) throw( IndexOutOfBoundsException, WrappedTargetException, RuntimeException ) + { + if ( ( _nIndex < 0 ) || ( _nIndex >= (sal_Int32)m_aParameters.size() ) ) + throw IndexOutOfBoundsException(); + + return makeAny( m_aParameters[ _nIndex ] ); + } + + //-------------------------------------------------------------------- + Reference< XEnumeration > ParameterWrapperContainer::createEnumeration() throw( RuntimeException ) + { + return new ::comphelper::OEnumerationByIndex( static_cast< XIndexAccess* >( this ) ); + } + + //-------------------------------------------------------------------- + ParameterWrapperContainer::~ParameterWrapperContainer() + { + } //........................................................................ } // namespace dbtools --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
