Tag: cws_src680_qiq User: fs Date: 06/05/19 01:40:15 Modified: /dba/connectivity/inc/connectivity/ dbexception.hxx
Log: #i51143# tweaking the SQLExceptionIteratorHelper File Changes: Directory: /dba/connectivity/inc/connectivity/ ============================================== File [changed]: dbexception.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/inc/connectivity/dbexception.hxx?r1=1.14.56.4&r2=1.14.56.5 Delta lines: +74 -20 --------------------- --- dbexception.hxx 18 May 2006 09:08:13 -0000 1.14.56.4 +++ dbexception.hxx 19 May 2006 08:40:12 -0000 1.14.56.5 @@ -4,9 +4,9 @@ * * $RCSfile: dbexception.hxx,v $ * - * $Revision: 1.14.56.4 $ + * $Revision: 1.14.56.5 $ * - * last change: $Author: fs $ $Date: 2006/05/18 09:08:13 $ + * last change: $Author: fs $ $Date: 2006/05/19 08:40:12 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -179,27 +179,81 @@ class SQLExceptionIteratorHelper { -public: - // specifying the type of the elements to include - enum NODES_INCLUDED { NI_EXCEPTIONS, NI_WARNINGS, NI_CONTEXTINFOS }; - // as ContextInfos are derived from Warnings and Warnings from Exceptions this is sufficient ... - protected: - const ::com::sun::star::sdbc::SQLException* m_pCurrent; + ::com::sun::star::sdbc::SQLException* m_pCurrent; SQLExceptionInfo::TYPE m_eCurrentType; - NODES_INCLUDED m_eMask; - public: - SQLExceptionIteratorHelper(const ::com::sun::star::sdbc::SQLException* _pStart, NODES_INCLUDED _eMask = NI_EXCEPTIONS); - SQLExceptionIteratorHelper(const ::com::sun::star::sdbc::SQLWarning* _pStart, NODES_INCLUDED _eMask = NI_EXCEPTIONS); - SQLExceptionIteratorHelper(const ::com::sun::star::sdb::SQLContext* _pStart, NODES_INCLUDED _eMask = NI_EXCEPTIONS); - // same note as above for the SQLExceptionInfo ctors - SQLExceptionIteratorHelper(const SQLExceptionInfo& _rStart, NODES_INCLUDED _eMask = NI_EXCEPTIONS); - - sal_Bool hasMoreElements() const { return (m_pCurrent != NULL); } - const ::com::sun::star::sdbc::SQLException* next(); - void next(SQLExceptionInfo& _rOutInfo); + /** constructs an iterator instance from an SQLException + + @param _rChainStart + the start of the exception chain to iterate. Must live as long as the iterator + instances lives, at least. + */ + SQLExceptionIteratorHelper( ::com::sun::star::sdbc::SQLException& _rChainStart ); + + /** constructs an iterator instance from an SQLWarning + + @param _rChainStart + the start of the exception chain to iterate. Must live as long as the iterator + instances lives, at least. + */ + SQLExceptionIteratorHelper( ::com::sun::star::sdbc::SQLWarning& _rChainStart ); + + /** constructs an iterator instance from an SQLContext + + @param _rChainStart + the start of the exception chain to iterate. Must live as long as the iterator + instances lives, at least. + */ + SQLExceptionIteratorHelper( ::com::sun::star::sdb::SQLContext& _rChainStart ); + + /** constructs an iterator instance from an SQLExceptionInfo + + @param _rErrorInfo + the start of the exception chain to iterate. Must live as long as the iterator + instances lives, at least. + */ + SQLExceptionIteratorHelper( SQLExceptionInfo& _rErrorInfo ); + + /** determines whether there are more elements in the exception chain + */ + sal_Bool hasMoreElements() const { return ( m_pCurrent != NULL ); } + + /** returns the type of the current element in the exception chain + */ + SQLExceptionInfo::TYPE currentType() const { return m_eCurrentType; } + + /** retrieves the current element in the chain, or <NULL/> if the chain has been completely + traveled. + */ + const ::com::sun::star::sdbc::SQLException* current() const { return m_pCurrent; } + + /** retrieves the current element in the chain, or <NULL/> if the chain has been completely + traveled. + */ + ::com::sun::star::sdbc::SQLException* current() { return m_pCurrent; } + + /** retrieves the current element in the chain, or <NULL/> if the chain has been completely + traveled. + + In opposite to the second <member>current</member>, this version allows typed access to + the respective SQLException. + */ + void current( SQLExceptionInfo& _out_rInfo ) const; + + /** proceeds to the next element in the chain + + @return the current element in the chain, as <b>before</em> the chain move. + */ + ::com::sun::star::sdbc::SQLException* next(); + + /** proceeds to the next element in the chain + + In opposite to the second <member>current</member>, this version allows typed access to + the respective SQLException. + */ + void next( SQLExceptionInfo& _out_rInfo ); }; //================================================================================== --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
