// Feeping Creaturism // // Douglas Thrift // // $Id$ #include "Jargon.hpp" Jargon::Jargon(const std::string& path) { std::vector args(1, FeepingCreaturism::program); args.push_back(path); args.push_back("jargon.xsl"); redi::pstreambuf pin("/usr/local/bin/Xalan", args, std::ios_base::in); ios::StreamBufInputAdapter adaptor(pin); ext::Handle document(xml::Parse(adaptor)); ext::Handle jargon(*document/"jargon"); word = *jargon/"word"; pronunciation = *jargon/"pronunciation"; grammar = *jargon/"grammar"; definition = *jargon/"definition"; } std::ostream& operator<<(std::ostream& sout, const Jargon& jargon) { ios::StreamBufOutputAdapter adaptor(*sout.rdbuf()); sout << jargon.word << '\n' << jargon.pronunciation << '\n' << jargon.grammar << '\n' << jargon.definition.GetSize() << '\n'; /* ios::PrintWriter writer(adaptor); writer << jargon.definition << '\n';*/ return sout; }