#include "MathExtern.h"
#include "support/textutils.h"
+#include "support/docstring.h"
#include <algorithm>
+#include <cstring>
#include <ostream>
+using namespace std;
namespace lyx {
-using std::strlen;
-
//////////////////////////////////////////////////////////////////////
}
-NormalStream & operator<<(NormalStream & ns, const std::string & s)
+NormalStream & operator<<(NormalStream & ns, const string & s)
{
ns.os() << from_utf8(s);
return ns;
}
-WriteStream::WriteStream(odocstream & os, bool fragile, bool latex)
+WriteStream::WriteStream(odocstream & os, bool fragile, bool latex, bool dryrun)
: os_(os), fragile_(fragile), firstitem_(false), latex_(latex),
- pendingspace_(false), line_(0)
+ dryrun_(dryrun), pendingspace_(false), textmode_(false), line_(0)
{}
WriteStream::WriteStream(odocstream & os)
: os_(os), fragile_(false), firstitem_(false), latex_(false),
- pendingspace_(false), line_(0)
+ dryrun_(false), pendingspace_(false), textmode_(false), line_(0)
{}
}
+void WriteStream::textMode(bool textmode)
+{
+ textmode_ = textmode;
+}
+
+
WriteStream & operator<<(WriteStream & ws, MathAtom const & at)
{
at->write(ws);
ws.pendingSpace(false);
}
ws.os() << s;
- ws.addlines(int(std::count(s, s + strlen(s), '\n')));
+ ws.addlines(int(count(s, s + strlen(s), '\n')));
return ws;
}
}
-OctaveStream & operator<<(OctaveStream & os, std::string const & s)
+OctaveStream & operator<<(OctaveStream & os, string const & s)
{
os.os() << from_utf8(s);
return os;