-/* This file is part of
- * ======================================================
+/**
+ * \file Chktex.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * LyX, The Document Processor
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team.
+ * \author Asger Alstrup
*
- * This file is Copyright 1997-1998
- * Asger Alstrup
- *
- * ======================================================
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "Chktex.h"
-#include "LaTeX.h" // TeXErrors
-#include "lyxlex.h"
-#include "debug.h"
#include "gettext.h"
-#include "support/FileInfo.h"
+#include "LaTeX.h" // TeXErrors
+
+#include "support/convert.h"
#include "support/filetools.h"
-#include "support/systemcall.h"
-#include "support/path.h"
#include "support/lstrings.h"
+#include "support/systemcall.h"
-#include "support/BoostFormat.h"
+#include <boost/format.hpp>
#include <fstream>
-using std::ifstream;
+using lyx::support::changeExtension;
+using lyx::support::onlyFilename;
+using lyx::support::split;
+using lyx::support::Systemcall;
+
using std::getline;
+using std::string;
+using std::ifstream;
-/*
- * CLASS Chktex
- */
Chktex::Chktex(string const & chktex, string const & f, string const & p)
: cmd(chktex), file(f), path(p)
int Chktex::run(TeXErrors &terr)
{
// run bibtex
- string log = OnlyFilename(ChangeExtension(file, ".log"));
+ string log = onlyFilename(changeExtension(file, ".log"));
string tmp = cmd + " -q -v0 -b0 -x " + file + " -o " + log;
Systemcall one;
- int result= one.startscript(Systemcall::Wait, tmp);
+ int result = one.startscript(Systemcall::Wait, tmp);
if (result == 0) {
result = scanLogFile(terr);
} else {
string token;
int retval = 0;
- string const tmp = OnlyFilename(ChangeExtension(file, ".log"));
+ string const tmp = onlyFilename(changeExtension(file, ".log"));
#if USE_BOOST_FORMAT
boost::format msg(_("ChkTeX warning id # %1$d"));
token = split(token, warno, ':');
token = split(token, warning, ':');
- int const lineno = lyx::atoi(line);
+ int const lineno = convert<int>(line);
#if USE_BOOST_FORMAT
msg % warno;