diff --git a/src/parameterizedHeaderField.cpp b/src/parameterizedHeaderField.cpp index 2d7257be..1730f17e 100644 --- a/src/parameterizedHeaderField.cpp +++ b/src/parameterizedHeaderField.cpp @@ -184,9 +184,13 @@ void parameterizedHeaderField::parse(const string& buffer, const string::size_ty if (attrStart != attrEnd && value.length()) { // Append this parameter to the list - appendParameter(parameterFactory::getInstance()-> + parameter* param = parameterFactory::getInstance()-> create(string(buffer.begin() + attrStart, - buffer.begin() + attrEnd), value)); + buffer.begin() + attrEnd), value); + + param->setParsedBounds(attrStart, position + (p - pstart)); + + appendParameter(param); } // Skip white-spaces after this parameter @@ -434,4 +438,19 @@ const std::vector parameterizedHeaderField::getParameterList() } +const std::vector parameterizedHeaderField::getChildComponents() const +{ + std::vector list = headerField::getChildComponents(); + + for (std::vector ::const_iterator it = m_params.begin() ; + it != m_params.end() ; ++it) + { + list.push_back(*it); + } + + return (list); +} + + + } // vmime diff --git a/src/typeAdapter.cpp b/src/typeAdapter.cpp index 13651900..2d0b73ed 100644 --- a/src/typeAdapter.cpp +++ b/src/typeAdapter.cpp @@ -33,6 +33,8 @@ void typeAdapter ::parse(const string& buffer, const string::size_type p { m_value = string(buffer.begin() + position, buffer.begin() + end); + setParsedBounds(position, end); + if (newPosition) *newPosition = end; } diff --git a/vmime/parameter.hpp b/vmime/parameter.hpp index b762d220..125e7b38 100644 --- a/vmime/parameter.hpp +++ b/vmime/parameter.hpp @@ -32,6 +32,7 @@ namespace vmime class parameter : public component { friend class parameterFactory; + friend class parameterizedHeaderField; public: diff --git a/vmime/parameterizedHeaderField.hpp b/vmime/parameterizedHeaderField.hpp index a4180cd3..b6418b37 100644 --- a/vmime/parameterizedHeaderField.hpp +++ b/vmime/parameterizedHeaderField.hpp @@ -172,6 +172,8 @@ public: void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; + + const std::vector getChildComponents() const; }; diff --git a/vmime/typeAdapter.hpp b/vmime/typeAdapter.hpp index 906f34a5..3fed9383 100644 --- a/vmime/typeAdapter.hpp +++ b/vmime/typeAdapter.hpp @@ -91,6 +91,8 @@ public: std::istringstream iss(string(buffer.begin() + position, buffer.begin() + end)); iss >> m_value; + setParsedBounds(position, end); + if (newPosition) *newPosition = end; }