diff options
| author | Vincent Richard <[email protected]> | 2012-12-06 10:02:31 +0000 |
|---|---|---|
| committer | Vincent Richard <[email protected]> | 2012-12-06 10:02:31 +0000 |
| commit | 1ba5e8698cb0f3904fc7a1faf50597bc877b5099 (patch) | |
| tree | 1b8b99a6bb147c7f6de31c4f242d7cf4aa240003 /src/net/pop3/POP3Utils.cpp | |
| parent | Fixed progression notification when message size is lower than 64K. (diff) | |
| download | vmime-1ba5e8698cb0f3904fc7a1faf50597bc877b5099.tar.gz vmime-1ba5e8698cb0f3904fc7a1faf50597bc877b5099.zip | |
Moved POP3 response receiving and parsing to a separate class.
Diffstat (limited to 'src/net/pop3/POP3Utils.cpp')
| -rw-r--r-- | src/net/pop3/POP3Utils.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/net/pop3/POP3Utils.cpp b/src/net/pop3/POP3Utils.cpp index f75d338e..c065b695 100644 --- a/src/net/pop3/POP3Utils.cpp +++ b/src/net/pop3/POP3Utils.cpp @@ -28,6 +28,7 @@ #include "vmime/net/pop3/POP3Utils.hpp" +#include "vmime/net/pop3/POP3Response.hpp" #include <sstream> @@ -38,15 +39,13 @@ namespace pop3 { // static -void POP3Utils::parseMultiListOrUidlResponse(const string& response, std::map <int, string>& result) +void POP3Utils::parseMultiListOrUidlResponse(ref <POP3Response> response, std::map <int, string>& result) { - std::istringstream iss(response); std::map <int, string> ids; - string line; - - while (std::getline(iss, line)) + for (unsigned int i = 0, n = response->getLineCount() ; i < n ; ++i) { + string line = response->getLineAt(i); string::iterator it = line.begin(); while (it != line.end() && (*it == ' ' || *it == '\t')) |
