From 4f33877820edee1b47d1b6f4fc800eaad273adaa Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Mon, 16 Apr 2012 22:32:33 +0200 Subject: Added ability to parse directly from an input stream (eg. file). This allows very big messages to be parsed without loading the whole message data into memory. --- src/utility/inputStreamStringAdapter.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/utility/inputStreamStringAdapter.cpp') diff --git a/src/utility/inputStreamStringAdapter.cpp b/src/utility/inputStreamStringAdapter.cpp index 31c9fdaf..9b8fb0c7 100644 --- a/src/utility/inputStreamStringAdapter.cpp +++ b/src/utility/inputStreamStringAdapter.cpp @@ -89,6 +89,19 @@ stream::size_type inputStreamStringAdapter::skip(const size_type count) } +stream::size_type inputStreamStringAdapter::getPosition() const +{ + return m_pos - m_begin; +} + + +void inputStreamStringAdapter::seek(const size_type pos) +{ + if (m_begin + pos <= m_end) + m_pos = m_begin + pos; +} + + } // utility } // vmime -- cgit v1.2.3