return Change::UNCHANGED;
}
-
-/// quotes a string for use as an argument of the "log" dialog
-string const quoteArg(string const & arg)
-{
- ostringstream os;
- os << '"' << subst(subst(arg, "\\", "\\\\"), "\"", "\\\"") << '"';
- return os.str();
-}
-
}
LyXFunc::LyXFunc(LyXView * lv)
data = "literate ";
break;
}
- data += quoteArg(logfile.second);
+ data += LyXLex::quoteString(logfile.second);
owner->getDialogs().show("log", data);
} else if (name == "vclog") {
string const data = "vc " +
- quoteArg(owner->buffer()->lyxvc().getLogFile());
+ LyXLex::quoteString(owner->buffer()->lyxvc().getLogFile());
owner->getDialogs().show("log", data);
} else
owner->getDialogs().show(name, data);
#include "support/convert.h"
#include "support/lstrings.h"
+#include <sstream>
+
using lyx::support::compare_ascii_no_case;
using lyx::support::isStrDbl;
using lyx::support::isStrInt;
}
return *this;
}
+
+
+/// quotes a string, e.g. for use in preferences files or as an argument of the "log" dialog
+string const LyXLex::quoteString(string const & arg)
+{
+ std::ostringstream os;
+ os << '"' << subst(subst(arg, "\\", "\\\\"), "\"", "\\\"") << '"';
+ return os.str();
+}
/// extract bool
LyXLex & operator>>(bool &);
+ /// Quotes a string so that reading it again with LyXLex::next(true)
+ /// gets the original string
+ static std::string const quoteString(std::string const &);
+
private:
class Pimpl;
///