// Zoe AIM Away Message RSS Feed Generator // // Seth King and Douglas Thrift // // $Id$ #include "Zoe.hpp" #include "Matcher.hpp" int main(int argc, char* argv[]) { Zoe::program = argv[0]; for (int index(1); index < argc; ++index) { ext::String arg(argv[index]); Matcher matcher; if (arg == matcher("^-config=(.*)$")) { Zoe::config = matcher[1]; } else if (arg == "-D") { if (!Zoe::debug) Zoe::debug = true; } else { cerr << "Usage: " << Zoe::program << " [-config=config] [-D]\n"; } } Zoe zoe; return 0; } Zoe::Zoe() : rss("zoe.rss") { configure(); } bool Zoe::debug(false); ext::String Zoe::program, Zoe::config("zoe.xml"); void Zoe::configure() { ext::Handle document(xml::Parse(config)); ext::Handle zoe(*document/"zoe"); login = *zoe/"login"; password = *zoe/"password"; if (!(*zoe/"rss").IsEmpty()) rss = *zoe/"rss"; }