#include <config.h>
+#include "MathStream.h"
+
#include "InsetMath.h"
#include "MathData.h"
#include "MathExtern.h"
-#include "MathStream.h"
#include "support/textutils.h"
+#include "support/docstring.h"
#include <algorithm>
+#include <cstring>
+#include <ostream>
-namespace lyx {
+using namespace std;
-using std::strlen;
+namespace lyx {
//////////////////////////////////////////////////////////////////////
}
-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;
}
{
++ms.tab();
ms.cr();
- ms.os() << '<' << t.tag_ << '>';
+ ms.os() << '<' << from_ascii(t.tag_) << '>';
return ms;
}
ms.cr();
if (ms.tab() > 0)
--ms.tab();
- ms.os() << "</" << t.tag_ << '>';
+ ms.os() << "</" << from_ascii(t.tag_) << '>';
return ms;
}
}
-OctaveStream & operator<<(OctaveStream & os, std::string const & s)
+OctaveStream & operator<<(OctaveStream & os, string const & s)
{
os.os() << from_utf8(s);
return os;