#include <config.h>
#include "biblio.h"
+
+#include "Lsstream.h"
#include "gettext.h" // for _()
#include "helper_funcs.h"
#include "Lsstream.h"
#include <algorithm>
+using namespace lyx::support;
+
using std::vector;
+
namespace biblio {
string const familyName(string const & name)
string const getAbbreviatedAuthor(InfoMap const & map, string const & key)
{
- lyx::Assert(!map.empty());
+ Assert(!map.empty());
InfoMap::const_iterator it = map.find(key);
if (it == map.end())
}
string author = parseBibTeX(data, "author");
+
if (author.empty())
author = parseBibTeX(data, "editor");
string const getYear(InfoMap const & map, string const & key)
{
- lyx::Assert(!map.empty());
+ Assert(!map.empty());
InfoMap::const_iterator it = map.find(key);
if (it == map.end())
string const getInfo(InfoMap const & map, string const & key)
{
- lyx::Assert(!map.empty());
+ Assert(!map.empty());
InfoMap::const_iterator it = map.find(key);
if (it == map.end())
// The '$' must be prefixed with the escape character '\' for
// boost to treat it as a literal.
// Thus, to prefix a matched expression with '\', we use:
- string const fmt("\\\\$&");
-
- return reg.Merge(expr, fmt);
+ return STRCONV(reg.Merge(STRCONV(expr), "\\\\$&"));
}
// re and icase are used to construct an instance of boost::RegEx.
// if icase is true, then matching is insensitive to case
RegexMatch(InfoMap const & m, string const & re, bool icase)
- : map_(m), regex_(re, icase) {}
+ : map_(m), regex_(STRCONV(re), icase) {}
bool operator()(string const & key) {
if (!validRE())
// Attempts to find a match for the current RE
// somewhere in data.
- return regex_.Search(data);
+ return regex_.Search(STRCONV(data));
}
bool validRE() const { return regex_.error_code() == 0; }