1 |
Douglas Thrift |
196 |
// Feeping Creaturism |
2 |
|
|
// |
3 |
|
|
// Douglas Thrift |
4 |
|
|
// |
5 |
|
|
// $Id$ |
6 |
|
|
|
7 |
|
|
#include "Jargon.hpp" |
8 |
Douglas Thrift |
224 |
#include "Matcher.hpp" |
9 |
Douglas Thrift |
196 |
|
10 |
Douglas Thrift |
227 |
Jargon::Jargon(const ext::String& path, bool include, |
11 |
|
|
const ext::String& relative) : include(include), |
12 |
|
|
args(1, FeepingCreaturism::program) |
13 |
Douglas Thrift |
196 |
{ |
14 |
Douglas Thrift |
223 |
args.push_back("-p"); |
15 |
|
|
args.push_back("include"); |
16 |
|
|
args.push_back(lexical_cast<ext::String>(include) + "()"); |
17 |
Douglas Thrift |
225 |
|
18 |
|
|
if (!relative.IsEmpty()) |
19 |
|
|
{ |
20 |
|
|
args.push_back("-p"); |
21 |
|
|
args.push_back("relative"); |
22 |
|
|
args.push_back("\"" + relative + "\""); |
23 |
|
|
} |
24 |
|
|
|
25 |
Douglas Thrift |
196 |
args.push_back(path); |
26 |
Douglas Thrift |
201 |
args.push_back("jargon.xsl"); |
27 |
Douglas Thrift |
227 |
} |
28 |
Douglas Thrift |
196 |
|
29 |
Douglas Thrift |
227 |
ios::PrintWriter& operator<<(ios::PrintWriter& pout, const Jargon& jargon) |
30 |
|
|
{ |
31 |
|
|
redi::ipstream pin("/usr/local/bin/Xalan", jargon.args); |
32 |
Douglas Thrift |
196 |
|
33 |
Douglas Thrift |
227 |
if (jargon.include) |
34 |
Douglas Thrift |
224 |
{ |
35 |
|
|
std::string ignore; |
36 |
|
|
|
37 |
|
|
std::getline(pin, ignore); |
38 |
|
|
} |
39 |
|
|
|
40 |
Douglas Thrift |
223 |
do |
41 |
Douglas Thrift |
208 |
{ |
42 |
Douglas Thrift |
223 |
std::string line; |
43 |
Douglas Thrift |
208 |
|
44 |
Douglas Thrift |
223 |
std::getline(pin, line); |
45 |
Douglas Thrift |
208 |
|
46 |
Douglas Thrift |
227 |
pout << line << '\n'; |
47 |
Douglas Thrift |
203 |
} |
48 |
Douglas Thrift |
223 |
while (pin.good()); |
49 |
Douglas Thrift |
227 |
|
50 |
|
|
return pout; |
51 |
Douglas Thrift |
196 |
} |