ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FeepingCreaturism/Jargon.cpp
Revision: 202
Committed: 2004-08-30T23:18:58-07:00 (20 years, 9 months ago) by Douglas Thrift
File size: 948 byte(s)
Log Message:
Yeah!

File Contents

# User Rev Content
1 Douglas Thrift 196 // Feeping Creaturism
2     //
3     // Douglas Thrift
4     //
5     // $Id$
6    
7     #include "Jargon.hpp"
8    
9     Jargon::Jargon(const std::string& path)
10     {
11 Douglas Thrift 201 std::vector<std::string> args(1, FeepingCreaturism::program);
12 Douglas Thrift 196
13     args.push_back(path);
14 Douglas Thrift 201 args.push_back("jargon.xsl");
15 Douglas Thrift 196
16     redi::pstreambuf pin("/usr/local/bin/Xalan", args, std::ios_base::in);
17     ios::StreamBufInputAdapter adaptor(pin);
18     ext::Handle<xml::Document> document(xml::Parse(adaptor));
19 Douglas Thrift 202 ext::Handle<xml::Node> jargon(*document/"jargon");
20 Douglas Thrift 196
21 Douglas Thrift 202 word = *jargon/"word";
22     pronunciation = *jargon/"pronunciation";
23     grammar = *jargon/"grammar";
24     definition = *jargon/"definition";
25 Douglas Thrift 196 }
26    
27     std::ostream& operator<<(std::ostream& sout, const Jargon& jargon)
28     {
29     ios::StreamBufOutputAdapter adaptor(*sout.rdbuf());
30    
31     sout << jargon.word << '\n' << jargon.pronunciation << '\n'
32     << jargon.grammar << '\n' << jargon.definition.GetSize() << '\n';
33    
34     /* ios::PrintWriter writer(adaptor);
35    
36     writer << jargon.definition << '\n';*/
37    
38     return sout;
39     }

Properties

Name Value
svn:eol-style native
svn:keywords Id