// Zoe AIM Away Message RSS Feed Generator // // Seth King and Douglas Thrift // // $Id$ #include "AwayMessage.hpp" AwayMessage::operator ext::String() const { std::string message(this->message); std::string::size_type begin(0), found; while ((found = message.find('%', begin)) != std::string::npos) { if (message.find_first_of("ndt", found + 1) == found + 1) { switch (message[found + 1]) { case 'n': message.replace(found, 2, "Zoe"); begin = found + 3; break; case 'd': message.replace(found, 2, stamp.getDate()); begin = found + 10; break; case 't': message.replace(found, 2, stamp.getTime()); begin = found + 11; } } else begin = found + 1; } return message; }