From f777b659b9bd43f90c3f8b224ad296e42d89a02b Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sat, 3 Sep 2005 12:48:59 +0000 Subject: Added progression notifications. --- src/utility/stringProxy.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/utility/stringProxy.cpp') diff --git a/src/utility/stringProxy.cpp b/src/utility/stringProxy.cpp index 798cbf1a..ef8a0cea 100644 --- a/src/utility/stringProxy.cpp +++ b/src/utility/stringProxy.cpp @@ -85,12 +85,26 @@ stringProxy& stringProxy::operator=(const string_type& s) } -void stringProxy::extract(outputStream& os, const size_type start, const size_type end) const +void stringProxy::extract(outputStream& os, const size_type start, const size_type end, + utility::progressionListener* progress) const { + size_type len = 0; + if (end == std::numeric_limits ::max()) - os.write(m_buffer.data() + m_start + start, m_end - start - m_start); - else - os.write(m_buffer.data() + m_start + start, end - start - m_start); + len = m_end - start - m_start; + else if (end > start) + len = end - start - m_start; + + if (progress) + progress->start(len); + + os.write(m_buffer.data() + m_start + start, len); + + if (progress) + { + progress->progress(len, len); + progress->stop(len); + } } -- cgit