From 2949fb51f13e1236d5c161f02e1c2c8541100e9f Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 21 Oct 2004 15:05:47 +0000 Subject: Refactoring (see ChangeLog). --- examples/example4.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'examples/example4.cpp') diff --git a/examples/example4.cpp b/examples/example4.cpp index 164e4be9..605452fe 100644 --- a/examples/example4.cpp +++ b/examples/example4.cpp @@ -44,28 +44,28 @@ int main() vmime::messageParser mp("<...MIME message content...>"); // Enumerate text parts - for (std::vector ::const_iterator i = mp.textParts().begin() ; - i != mp.textParts().end() ; ++i) + for (int i = 0 ; i < mp.getTextPartCount() ; ++i) { - const vmime::textPart& part = **i; + const vmime::textPart& part = *mp.getTextPartAt(i); // Output content-type of the part - std::cout << part.type().generate() << std::endl; + std::cout << part.getType().generate() << std::endl; // text/html - if (part.type().subType() == vmime::mediaTypes::TEXT_HTML) + if (part.getType().getSubType() == vmime::mediaTypes::TEXT_HTML) { const vmime::htmlTextPart& hp = dynamic_cast(part); - // HTML text is in "hp.text()" - // Corresponding plain text is in "hp.plainText()" + // HTML text is in "hp.getText()" + // Corresponding plain text is in "hp.getPlainText()" // Enumerate embedded objects (eg. images) - for (vmime::htmlTextPart::const_iterator i = hp.embeddedObjects.begin() ; - i != hp.embeddedObjects.end() ; ++i) + for (int j = 0 ; j < hp.getObjectCount() ; ++j) { - // Identifier (content-id or content-location) is in "(*i).id()" - // Object data is in "(*i).data()" + const vmime::htmlTextPart::embeddedObject& obj = *hp.getObjectAt(j); + + // Identifier (content-id or content-location) is in "obj.getId()" + // Object data is in "obj.getData()" } } // text/plain @@ -73,7 +73,7 @@ int main() { const vmime::textPart& tp = dynamic_cast(part); - // Text is in "tp.text()" + // Text is in "tp.getText()" } } } -- cgit v1.2.3