1 |
// Feeping Creaturism |
2 |
// |
3 |
// Douglas Thrift |
4 |
// |
5 |
// $Id$ |
6 |
|
7 |
#include "Jargon.hpp" |
8 |
#include "Matcher.hpp" |
9 |
|
10 |
Jargon::Jargon(const ext::String& path, bool include) |
11 |
{ |
12 |
std::vector<std::string> args(1, FeepingCreaturism::program); |
13 |
|
14 |
args.push_back("-p"); |
15 |
args.push_back("include"); |
16 |
args.push_back(lexical_cast<ext::String>(include) + "()"); |
17 |
args.push_back(path); |
18 |
args.push_back("jargon.xsl"); |
19 |
|
20 |
redi::ipstream pin("/usr/local/bin/Xalan", args); |
21 |
|
22 |
if (include) |
23 |
{ |
24 |
std::string ignore; |
25 |
|
26 |
std::getline(pin, ignore); |
27 |
} |
28 |
|
29 |
do |
30 |
{ |
31 |
std::string line; |
32 |
|
33 |
std::getline(pin, line); |
34 |
|
35 |
buffer << line << '\n'; |
36 |
} |
37 |
while (pin.good()); |
38 |
} |