From df140bb13e20da47292b5d8fa80cd9d5cbd3a74a Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Fri, 2 Sep 2005 20:30:33 +0000 Subject: Updated code to use smart pointers. --- examples/example6.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'examples/example6.cpp') diff --git a/examples/example6.cpp b/examples/example6.cpp index 2d1b737a..97102e18 100644 --- a/examples/example6.cpp +++ b/examples/example6.cpp @@ -108,21 +108,21 @@ static std::ostream& operator<<(std::ostream& os, const vmime::exception& e) * @param s structure object * @param level current depth */ -static void printStructure(const vmime::net::structure& s, const int level = 0) +static void printStructure(vmime::ref s, const int level = 0) { - for (int i = 1 ; i <= s.getCount() ; ++i) + for (int i = 0 ; i < s->getPartCount() ; ++i) { - const vmime::net::part& part = s[i]; + vmime::ref part = s->getPartAt(i); for (int j = 0 ; j < level * 2 ; ++j) std::cout << " "; - std::cout << part.getNumber() << ". " - << part.getType().generate() - << " [" << part.getSize() << " byte(s)]" + std::cout << (part->getNumber() + 1) << ". " + << part->getType().generate() + << " [" << part->getSize() << " byte(s)]" << std::endl; - printStructure(part.getStructure(), level + 1); + printStructure(part->getStructure(), level + 1); } } -- cgit v1.2.3