#include "support/Package.h"
#include "support/unicode.h"
-#include <boost/function.hpp>
-
#include <fstream>
#include <iostream>
#include <string>
if (a.empty() || !*p)
return a;
- string::size_type r = a.find_last_not_of(p);
- string::size_type l = a.find_first_not_of(p);
+ size_t r = a.find_last_not_of(p);
+ size_t l = a.find_first_not_of(p);
// Is this the minimal test? (lgb)
if (r == string::npos && l == string::npos)
/// return the number of arguments consumed
-typedef boost::function<int(string const &, string const &)> cmd_helper;
+typedef int (*cmd_helper)(string const &, string const &);
int parse_help(string const &, string const &)
#include "support/convert.h"
#include "support/filetools.h"
-#include <boost/tuple/tuple.hpp>
-
#include <iostream>
#include <map>
#include <sstream>
/// get the arguments of a natbib or jurabib citation command
-std::pair<string, string> getCiteArguments(Parser & p, bool natbibOrder)
+void get_cite_arguments(Parser & p, bool natbibOrder,
+ string & before, string & after)
{
// We need to distinguish "" and "[]", so we can't use p.getOpt().
// text before the citation
- string before;
+ before.clear();
// text after the citation
- string after = p.getFullOpt();
+ after = p.getFullOpt();
if (!after.empty()) {
before = p.getFullOpt();
if (natbibOrder && !before.empty())
std::swap(before, after);
}
- return std::make_pair(before, after);
}
-/// Convert filenames with TeX macros and/or quotes to something LyX can understand
+/// Convert filenames with TeX macros and/or quotes to something LyX
+/// can understand
string const normalize_filename(string const & name)
{
Parser p(trim(name, "\""));
string before;
// text after the citation
string after;
+ get_cite_arguments(p, true, before, after);
- boost::tie(before, after) = getCiteArguments(p, true);
if (command == "\\cite") {
// \cite without optional argument means
// \citet, \cite with at least one optional
string before;
// text after the citation
string after;
+ get_cite_arguments(p, argumentOrder != 'j', before, after);
- boost::tie(before, after) =
- getCiteArguments(p, argumentOrder != 'j');
string const citation = p.verbatim_item();
if (!before.empty() && argumentOrder == '\0') {
cerr << "Warning: Assuming argument order "