*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* This file is Copyright 1999
* Kayvan A. Sylvan
#endif
#include <fstream>
+#include <cstdlib>
#include "ImportNoweb.h"
#include "lyxrc.h"
#include "support/syscall.h"
#include "bufferlist.h"
-extern LyXRC * lyxrc;
+using std::ifstream;
+using std::getline;
+
extern BufferList bufferlist;
/*
Buffer * ImportNoweb::run()
{
// run reLyX -n
- string tmp = lyxrc->relyx_command + " -n -c " +
+ string tmp = lyxrc.relyx_command + " -n -c " +
documentclass() + " -f " + file;
Systemcalls one;
Buffer * buf = 0;
{
string result = "literate-article"; // Default
-#warning If you use literate programming you should verify that this works
- // This method has been rewritten to use ifstream, but since I
- // don't use literate programming myself I am unable to check
- // this correclty. (Lgb)
ifstream ifs(file.c_str());
if (!ifs) return "nofile"; // Should not happen!
string line;
while (getline(ifs, line)) {
- int p = line.find("\\documentclass");
+ string::size_type p = line.find("\\documentclass");
if (p != string::npos) {
p = line.find('{', p);
- int q = line.find('}', p);
- result = "literate-" + line.substr(p, q - p);
+ string::size_type q = line.find('}', p);
+ result = "literate-" + line.substr(p + 1, q - p - 1);
break;
}
}