ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FeepingCreaturism/Jargon.cpp
(Generate patch)

Comparing FeepingCreaturism/Jargon.cpp (file contents):
Revision 202 by Douglas Thrift, 2004-08-30T23:18:58-07:00 vs.
Revision 265 by Douglas Thrift, 2004-10-27T01:50:34-07:00

# Line 5 | Line 5
5   // $Id$
6  
7   #include "Jargon.hpp"
8 + #include "Matcher.hpp"
9  
10 < Jargon::Jargon(const std::string& path)
10 > Jargon::Jargon(const ext::String& path, const ext::String& jargon, bool include,
11 >        const ext::String& relative) : include(include), args(1, "jargon.xsl")
12   {
13 <        std::vector<std::string> args(1, FeepingCreaturism::program);
13 >        args.InsertLast(ios::String() << path << "/" << jargon);
14 >        args.InsertLast(ios::String() << "$jargon=" << jargon);
15  
16 <        args.push_back(path);
14 <        args.push_back("jargon.xsl");
16 >        if (include) args.InsertLast("$include=true()");
17  
18 <        redi::pstreambuf pin("/usr/local/bin/Xalan", args, std::ios_base::in);
19 <        ios::StreamBufInputAdapter adaptor(pin);
20 <        ext::Handle<xml::Document> document(xml::Parse(adaptor));
21 <        ext::Handle<xml::Node> jargon(*document/"jargon");
20 <
21 <        word = *jargon/"word";
22 <        pronunciation = *jargon/"pronunciation";
23 <        grammar = *jargon/"grammar";
24 <        definition = *jargon/"definition";
18 >        if (!relative.IsEmpty())
19 >        {
20 >                args.InsertLast(ios::String() << "$relative=" << relative);
21 >        }
22   }
23  
24 < std::ostream& operator<<(std::ostream& sout, const Jargon& jargon)
24 > ios::PrintWriter& operator<<(ios::PrintWriter& pout, const Jargon& jargon)
25   {
26 <        ios::StreamBufOutputAdapter adaptor(*sout.rdbuf());
26 >        _S<api::Process> xslt("/usr/local/bin/sabcmd", jargon.args);
27  
28 <        sout << jargon.word << '\n' << jargon.pronunciation << '\n'
32 <                << jargon.grammar << '\n' << jargon.definition.GetSize() << '\n';
28 >        if (jargon.include) ios::ReadLine(*xslt.GetReader());
29  
30 < /*      ios::PrintWriter writer(adaptor);
30 >        ios::ReadToWrite(*xslt.GetReader(), pout);
31  
32 <        writer << jargon.definition << '\n';*/
37 <
38 <        return sout;
32 >        return pout;
33   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines