]> git.lyx.org Git - lyx.git/blobdiff - src/Chktex.C
hopefully fix tex2lyx linking.
[lyx.git] / src / Chktex.C
index 6ae01d7df850bc8c83da896f489fd957db0dad66..09c48a7eabe1a45963a5e7d861c3439839d6df72 100644 (file)
 #include "LaTeX.h" // TeXErrors
 
 #include "support/convert.h"
+#include "support/docstream.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
 #include "support/systemcall.h"
 
 #include <boost/format.hpp>
 
-#include <fstream>
 
-using lyx::support::changeExtension;
-using lyx::support::onlyFilename;
-using lyx::support::split;
-using lyx::support::Systemcall;
+namespace lyx {
+
+using support::changeExtension;
+using support::onlyFilename;
+using support::split;
+using support::Systemcall;
 
 using std::getline;
 using std::string;
@@ -58,23 +60,25 @@ int Chktex::run(TeXErrors &terr)
 
 int Chktex::scanLogFile(TeXErrors & terr)
 {
-       string token;
        int retval = 0;
 
        string const tmp = onlyFilename(changeExtension(file, ".log"));
 
 #if USE_BOOST_FORMAT
-       boost::format msg(lyx::to_utf8(_("ChkTeX warning id # %1$d")));
+       boost::basic_format<char_type> msg(_("ChkTeX warning id # %1$d"));
 #else
-       string const msg(lyx::to_utf8(_("ChkTeX warning id # ")));
+       docstring const msg(_("ChkTeX warning id # "));
 #endif
-       ifstream ifs(tmp.c_str());
+       docstring token;
+       // FIXME UNICODE
+       // We have no idea what the encoding of the error file is
+       idocfstream ifs(tmp.c_str());
        while (getline(ifs, token)) {
-               string srcfile;
-               string line;
-               string pos;
-               string warno;
-               string warning;
+               docstring srcfile;
+               docstring line;
+               docstring pos;
+               docstring warno;
+               docstring warning;
                token = split(token, srcfile, ':');
                token = split(token, line, ':');
                token = split(token, pos, ':');
@@ -95,3 +99,6 @@ int Chktex::scanLogFile(TeXErrors & terr)
        }
        return retval;
 }
+
+
+} // namespace lyx