#include <config.h>
#include "Chktex.h"
-#include "LaTeX.h" // TeXErrors
#include "gettext.h"
+#include "LaTeX.h" // TeXErrors
+
+#include "support/convert.h"
#include "support/filetools.h"
#include "support/lstrings.h"
-#include "support/lyxlib.h"
#include "support/systemcall.h"
-#include "support/BoostFormat.h"
+#include <boost/format.hpp>
#include <fstream>
-using namespace lyx::support;
+
+namespace lyx {
+
+using support::changeExtension;
+using support::onlyFilename;
+using support::split;
+using support::Systemcall;
using std::getline;
+using std::string;
using std::ifstream;
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);
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(STRCONV(_("ChkTeX warning id # %1$d")));
+ boost::format msg(to_utf8(_("ChkTeX warning id # %1$d")));
#else
- string const msg(_("ChkTeX warning id # "));
+ string const msg(to_utf8(_("ChkTeX warning id # ")));
#endif
ifstream ifs(tmp.c_str());
while (getline(ifs, token)) {
token = split(token, warno, ':');
token = split(token, warning, ':');
- int const lineno = atoi(line);
+ int const lineno = convert<int>(line);
#if USE_BOOST_FORMAT
msg % warno;
- terr.insertError(lineno, STRCONV(msg.str()), warning);
+ terr.insertError(lineno, msg.str(), warning);
msg.clear();
#else
terr.insertError(lineno, msg + warno, warning);
}
return retval;
}
+
+
+} // namespace lyx