]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlex.C
revert recent change to development/FORMAT (don't change history)
[lyx.git] / src / lyxlex.C
index 6758dc167d767a3632e2525785e5a0a6eaa6c6b4..3ad334d38ffd8c21e04e12eb722c819b20c1e7b9 100644 (file)
@@ -21,6 +21,8 @@
 #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;
@@ -145,6 +147,12 @@ string const LyXLex::getString() const
 }
 
 
+lyx::docstring const LyXLex::getDocString() const
+{
+       return pimpl_->getDocString();
+}
+
+
 // I would prefer to give a tag number instead of an explicit token
 // here, but it is not possible because Buffer::readDocument uses
 // explicit tokens (JMarc)
@@ -293,3 +301,12 @@ LyXLex & LyXLex::operator>>(bool & s)
        }
        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();
+}