diff options
| author | Vincent Richard <[email protected]> | 2005-09-03 12:48:59 +0000 |
|---|---|---|
| committer | Vincent Richard <[email protected]> | 2005-09-03 12:48:59 +0000 |
| commit | f777b659b9bd43f90c3f8b224ad296e42d89a02b (patch) | |
| tree | 20f08abf13d3f2cb3ff1bfaa83348d1f69cc20d9 /src/utility/stringProxy.cpp | |
| parent | Updated code to use smart pointers. (diff) | |
| download | vmime-f777b659b9bd43f90c3f8b224ad296e42d89a02b.tar.gz vmime-f777b659b9bd43f90c3f8b224ad296e42d89a02b.zip | |
Added progression notifications.
Diffstat (limited to 'src/utility/stringProxy.cpp')
| -rw-r--r-- | src/utility/stringProxy.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
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 <size_type>::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); + } } |
