diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-04 10:09:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-04 12:25:18 +0100 |
commit | b47bca7fd71abb7fb65269f377446a26cd41cb91 (patch) | |
tree | 66221856f9bdf8ae35cf84b0b18af68ef18663e0 /include | |
parent | 96af93e5df3ea2e775cdfebf31447abaeec6dcfa (diff) |
OSequenceIterator is not necessary anymore
we have been able to iterate over a sequence for a long time now
Change-Id: Ie7ed6ec25682f631e01170029f7c9f0089448836
Reviewed-on: https://gerrit.libreoffice.org/68666
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/comphelper/sequence.hxx | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx index 7f134294ea57..3c52c4715965 100644 --- a/include/comphelper/sequence.hxx +++ b/include/comphelper/sequence.hxx @@ -97,79 +97,6 @@ namespace comphelper _rSeq.realloc(nLength-1); } - - //= iterating through sequences - - /** a helper class for iterating through a sequence - */ - template <class TYPE> - class OSequenceIterator - { - const TYPE* m_pElements; - sal_Int32 m_nLen; - const TYPE* m_pCurrent; - - public: - /** construct a sequence iterator from a sequence - */ - OSequenceIterator(const css::uno::Sequence< TYPE >& _rSeq); - /** construct a sequence iterator from a Any containing a sequence - */ - OSequenceIterator(const css::uno::Any& _rSequenceAny); - - bool hasMoreElements() const; - css::uno::Any nextElement(); - - private: - inline void construct(const css::uno::Sequence< TYPE >& _rSeq); - }; - - - template <class TYPE> - inline OSequenceIterator<TYPE>::OSequenceIterator(const css::uno::Sequence< TYPE >& _rSeq) - :m_pElements(nullptr) - ,m_nLen(0) - ,m_pCurrent(nullptr) - { - construct(_rSeq); - } - - - template <class TYPE> - inline OSequenceIterator<TYPE>::OSequenceIterator(const css::uno::Any& _rSequenceAny) - :m_pElements(nullptr) - ,m_nLen(0) - ,m_pCurrent(nullptr) - { - css::uno::Sequence< TYPE > aContainer; - bool bSuccess = _rSequenceAny >>= aContainer; - OSL_ENSURE(bSuccess, "OSequenceIterator::OSequenceIterator: invalid Any!"); - construct(aContainer); - } - - - template <class TYPE> - void OSequenceIterator<TYPE>::construct(const css::uno::Sequence< TYPE >& _rSeq) - { - m_pElements = _rSeq.getConstArray(); - m_nLen = _rSeq.getLength(); - m_pCurrent = m_pElements; - } - - - template <class TYPE> - inline bool OSequenceIterator<TYPE>::hasMoreElements() const - { - return m_pCurrent - m_pElements < m_nLen; - } - - - template <class TYPE> - inline css::uno::Any OSequenceIterator<TYPE>::nextElement() - { - return css::uno::toAny(*m_pCurrent++); - } - /** Copy from a plain C/C++ array into a Sequence. @tpl SrcType |