From ee46de08f7144af3e1101c7e505e01902b8c79a3 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 6 Oct 2005 11:08:56 +0000 Subject: Renamed 'progressionListener' to 'progressListener'. --- src/utility/progressListener.cpp | 79 +++++++++++++++++++++++++++++++++++++ src/utility/progressionListener.cpp | 79 ------------------------------------- src/utility/stream.cpp | 2 +- src/utility/stringProxy.cpp | 2 +- 4 files changed, 81 insertions(+), 81 deletions(-) create mode 100644 src/utility/progressListener.cpp delete mode 100644 src/utility/progressionListener.cpp (limited to 'src/utility') diff --git a/src/utility/progressListener.cpp b/src/utility/progressListener.cpp new file mode 100644 index 00000000..0a6f63e9 --- /dev/null +++ b/src/utility/progressListener.cpp @@ -0,0 +1,79 @@ +// +// VMime library (http://www.vmime.org) +// Copyright (C) 2002-2005 Vincent Richard +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of +// the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +// Linking this library statically or dynamically with other modules is making +// a combined work based on this library. Thus, the terms and conditions of +// the GNU General Public License cover the whole combination. +// + +#include "vmime/utility/progressListener.hpp" + + +namespace vmime { +namespace utility { + + +// progressListenerSizeAdapter + +progressListenerSizeAdapter::progressListenerSizeAdapter + (progressListener* list, const int total) + : m_wrapped(list), m_total(total) +{ +} + + +const bool progressListenerSizeAdapter::cancel() const +{ + return (m_wrapped ? m_wrapped->cancel() : false); +} + + +void progressListenerSizeAdapter::start(const int predictedTotal) +{ + if (m_wrapped) + m_wrapped->start(predictedTotal); +} + + +void progressListenerSizeAdapter::progress(const int current, const int currentTotal) +{ + if (m_wrapped) + { + if (currentTotal > m_total) + m_total = currentTotal; + + m_wrapped->progress(current, m_total); + } +} + + +void progressListenerSizeAdapter::stop(const int total) +{ + if (m_wrapped) + { + if (total > m_total) + m_total = total; + + m_wrapped->stop(m_total); + } +} + + +} // utility +} // vmime + diff --git a/src/utility/progressionListener.cpp b/src/utility/progressionListener.cpp deleted file mode 100644 index d2895f01..00000000 --- a/src/utility/progressionListener.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// -// VMime library (http://www.vmime.org) -// Copyright (C) 2002-2005 Vincent Richard -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of -// the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this program; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Linking this library statically or dynamically with other modules is making -// a combined work based on this library. Thus, the terms and conditions of -// the GNU General Public License cover the whole combination. -// - -#include "vmime/utility/progressionListener.hpp" - - -namespace vmime { -namespace utility { - - -// progressionListenerSizeAdapter - -progressionListenerSizeAdapter::progressionListenerSizeAdapter - (progressionListener* list, const int total) - : m_wrapped(list), m_total(total) -{ -} - - -const bool progressionListenerSizeAdapter::cancel() const -{ - return (m_wrapped ? m_wrapped->cancel() : false); -} - - -void progressionListenerSizeAdapter::start(const int predictedTotal) -{ - if (m_wrapped) - m_wrapped->start(predictedTotal); -} - - -void progressionListenerSizeAdapter::progress(const int current, const int currentTotal) -{ - if (m_wrapped) - { - if (currentTotal > m_total) - m_total = currentTotal; - - m_wrapped->progress(current, m_total); - } -} - - -void progressionListenerSizeAdapter::stop(const int total) -{ - if (m_wrapped) - { - if (total > m_total) - m_total = total; - - m_wrapped->stop(m_total); - } -} - - -} // utility -} // vmime - diff --git a/src/utility/stream.cpp b/src/utility/stream.cpp index 04fa3308..c9f901ec 100644 --- a/src/utility/stream.cpp +++ b/src/utility/stream.cpp @@ -55,7 +55,7 @@ const stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os) const stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os, - const stream::size_type length, progressionListener* progress) + const stream::size_type length, progressListener* progress) { stream::value_type buffer[65536]; stream::size_type total = 0; diff --git a/src/utility/stringProxy.cpp b/src/utility/stringProxy.cpp index 6ad41e26..10c2c3ce 100644 --- a/src/utility/stringProxy.cpp +++ b/src/utility/stringProxy.cpp @@ -86,7 +86,7 @@ stringProxy& stringProxy::operator=(const string_type& s) void stringProxy::extract(outputStream& os, const size_type start, const size_type end, - utility::progressionListener* progress) const + utility::progressListener* progress) const { size_type len = 0; -- cgit