+/// TexString : dumb struct to pass around docstrings with TexRow information.
+/// They are best created using otexstringstream.
+/// They can be output to otexrowstreams and otexstreams.
+/// A valid TexString has as many newlines in str as in texrow. Be careful not
+/// to introduce a mismatch between the line and the row counts, as this will
+/// assert in devel mode when outputting to a otexstream.
+struct TexString {
+ ///
+ docstring str;
+ ///
+ TexRow texrow;
+#if !(defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
+ /// Copy can be expensive and is not usually useful for TexString.
+ /// Force explicit copy, prefer move instead. This also prevents
+ /// move()s from being converted into copy silently.
+ explicit TexString(TexString const &) = default;
+ TexString(TexString && other) = default;
+ TexString & operator=(TexString const & other) = default;
+ TexString & operator=(TexString && other) = default;
+# else
+ //for gcc 4.6, nothing to do: it's enough to disable implicit copy during
+ // dev with more recent versions of gcc.
+#endif
+ /// Empty TexString
+ TexString() = default;
+ /// Texstring containing str and TexRow with enough lines which are empty
+ explicit TexString(docstring str);
+ /// Texstring containing str and texrow. Must be valid.
+ TexString(docstring str, TexRow texrow);
+ /// Ensure that the string and the TexRow have as many newlines.
+ void validate();
+};
+
+