diff options
author | Vincent Richard <[email protected]> | 2005-04-12 18:42:54 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2005-04-12 18:42:54 +0000 |
commit | f879a9794c4908df8e7484250b56b13342a66038 (patch) | |
tree | 83f91b9f743eb70d5398c6ce543596b434274c16 /src/parameter.cpp | |
parent | Added attachMDNRequest(). (diff) | |
download | vmime-f879a9794c4908df8e7484250b56b13342a66038.tar.gz vmime-f879a9794c4908df8e7484250b56b13342a66038.zip |
Added support for RFC-2231.
Diffstat (limited to 'src/parameter.cpp')
-rw-r--r-- | src/parameter.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/parameter.cpp b/src/parameter.cpp index 1cc2e697..988755be 100644 --- a/src/parameter.cpp +++ b/src/parameter.cpp @@ -63,6 +63,23 @@ void parameter::parse(const string& buffer, const string::size_type position, getValue().parse(buffer, position, end, newPosition); setParsedBounds(position, end); + + if (newPosition) + *newPosition = end; +} + + +void parameter::parse(const std::vector <valueChunk>& chunks) +{ + string value; + + for (std::vector <valueChunk>::const_iterator it = chunks.begin() ; + it != chunks.end() ; ++it) + { + value += (*it).data; + } + + getValue().parse(value, 0, value.length(), NULL); } @@ -87,10 +104,13 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL void parameter::generateValue(utility::outputStream& os, const string::size_type /* maxLineLength */, const string::size_type curLinePos, string::size_type* newLinePos) const { + // NOTE: This default implementation does not support parameter + // values that span on several lines ('defaultParameter' can do + // that, following rules specified in RFC-2231). + std::ostringstream valueStream; utility::outputStreamAdapter valueStreamV(valueStream); - // TODO: can we imagine having values that span on multiple lines? getValue().generate(valueStreamV, lineLengthLimits::infinite, 0, NULL); const string value(valueStream.str()); |