Commit 80acdb50 authored by Samuel Jackson's avatar Samuel Jackson
Browse files

Refs #16962 Correct namespaces for non-clang builds

We need to add the export macro to TSVSerialiser's class definition and
update the namespaces
parent ae5d900e
...@@ -5642,7 +5642,7 @@ void Graph::loadFromProject(const std::string &lines, ApplicationWindow *app, ...@@ -5642,7 +5642,7 @@ void Graph::loadFromProject(const std::string &lines, ApplicationWindow *app,
enableAutoscaling(app->autoscale2DPlots); enableAutoscaling(app->autoscale2DPlots);
TSVSerialiser tsv(lines); MantidQt::API::TSVSerialiser tsv(lines);
if (tsv.selectSection("Antialiasing")) { if (tsv.selectSection("Antialiasing")) {
int aa; int aa;
...@@ -6183,7 +6183,7 @@ void Graph::loadFromProject(const std::string &lines, ApplicationWindow *app, ...@@ -6183,7 +6183,7 @@ void Graph::loadFromProject(const std::string &lines, ApplicationWindow *app,
std::vector<std::string> specSections = tsv.sections("spectrogram"); std::vector<std::string> specSections = tsv.sections("spectrogram");
for (auto it = specSections.begin(); it != specSections.end(); ++it) { for (auto it = specSections.begin(); it != specSections.end(); ++it) {
TSVSerialiser specTSV(*it); MantidQt::API::TSVSerialiser specTSV(*it);
if (specTSV.selectLine("workspace")) { if (specTSV.selectLine("workspace")) {
std::string wsName; std::string wsName;
...@@ -6308,7 +6308,7 @@ void Graph::loadFromProject(const std::string &lines, ApplicationWindow *app, ...@@ -6308,7 +6308,7 @@ void Graph::loadFromProject(const std::string &lines, ApplicationWindow *app,
} }
std::string Graph::saveToProject() { std::string Graph::saveToProject() {
TSVSerialiser tsv; MantidQt::API::TSVSerialiser tsv;
tsv.writeLine("ggeometry") << pos().x() << pos().y() tsv.writeLine("ggeometry") << pos().x() << pos().y()
<< frameGeometry().width() << frameGeometry().width()
...@@ -6620,7 +6620,7 @@ std::string Graph::saveCurve(int i) { ...@@ -6620,7 +6620,7 @@ std::string Graph::saveCurve(int i) {
} }
std::string Graph::saveScale() { std::string Graph::saveScale() {
TSVSerialiser tsv; MantidQt::API::TSVSerialiser tsv;
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
tsv.writeLine("scale") << i; tsv.writeLine("scale") << i;
...@@ -6664,7 +6664,7 @@ std::string Graph::saveScale() { ...@@ -6664,7 +6664,7 @@ std::string Graph::saveScale() {
} }
std::string Graph::saveMarkers() { std::string Graph::saveMarkers() {
TSVSerialiser tsv; MantidQt::API::TSVSerialiser tsv;
for (int i = 0; i < d_images.size(); ++i) { for (int i = 0; i < d_images.size(); ++i) {
auto mrkI = dynamic_cast<ImageMarker *>(d_plot->marker(d_images[i])); auto mrkI = dynamic_cast<ImageMarker *>(d_plot->marker(d_images[i]));
if (!mrkI) if (!mrkI)
......
...@@ -2516,7 +2516,7 @@ IProjectSerialisable *Graph3D::loadFromProject(const std::string &lines, ...@@ -2516,7 +2516,7 @@ IProjectSerialisable *Graph3D::loadFromProject(const std::string &lines,
const std::string tsvLines = boost::algorithm::join(lineVec, "\n"); const std::string tsvLines = boost::algorithm::join(lineVec, "\n");
TSVSerialiser tsv(tsvLines); MantidQt::API::TSVSerialiser tsv(tsvLines);
if (tsv.selectLine("SurfaceFunction")) { if (tsv.selectLine("SurfaceFunction")) {
auto params = graph->readSurfaceFunction(tsv); auto params = graph->readSurfaceFunction(tsv);
...@@ -2784,7 +2784,7 @@ void Graph3D::setupMatrixPlot3D(ApplicationWindow *app, const QString &caption, ...@@ -2784,7 +2784,7 @@ void Graph3D::setupMatrixPlot3D(ApplicationWindow *app, const QString &caption,
} }
void Graph3D::setupMantidMatrixPlot3D(ApplicationWindow *app, void Graph3D::setupMantidMatrixPlot3D(ApplicationWindow *app,
TSVSerialiser &tsv) { MantidQt::API::TSVSerialiser &tsv) {
using MantidQt::API::PlotAxis; using MantidQt::API::PlotAxis;
MantidMatrix *matrix = readWorkspaceForPlot(app, tsv); MantidMatrix *matrix = readWorkspaceForPlot(app, tsv);
int style = read3DPlotStyle(tsv); int style = read3DPlotStyle(tsv);
...@@ -2835,7 +2835,7 @@ void Graph3D::setupMantidMatrixPlot3D(ApplicationWindow *app, ...@@ -2835,7 +2835,7 @@ void Graph3D::setupMantidMatrixPlot3D(ApplicationWindow *app,
} }
MantidMatrix *Graph3D::readWorkspaceForPlot(ApplicationWindow *app, MantidMatrix *Graph3D::readWorkspaceForPlot(ApplicationWindow *app,
TSVSerialiser &tsv) { MantidQt::API::TSVSerialiser &tsv) {
MantidMatrix *m = nullptr; MantidMatrix *m = nullptr;
if (tsv.selectLine("title")) { if (tsv.selectLine("title")) {
std::string wsName = tsv.asString(1); std::string wsName = tsv.asString(1);
...@@ -2851,7 +2851,7 @@ MantidMatrix *Graph3D::readWorkspaceForPlot(ApplicationWindow *app, ...@@ -2851,7 +2851,7 @@ MantidMatrix *Graph3D::readWorkspaceForPlot(ApplicationWindow *app,
return m; return m;
} }
int Graph3D::read3DPlotStyle(TSVSerialiser &tsv) { int Graph3D::read3DPlotStyle(MantidQt::API::TSVSerialiser &tsv) {
int style = Qwt3D::WIREFRAME; int style = Qwt3D::WIREFRAME;
if (tsv.selectLine("Style")) if (tsv.selectLine("Style"))
tsv >> style; tsv >> style;
...@@ -2859,7 +2859,7 @@ int Graph3D::read3DPlotStyle(TSVSerialiser &tsv) { ...@@ -2859,7 +2859,7 @@ int Graph3D::read3DPlotStyle(TSVSerialiser &tsv) {
} }
Graph3D::SurfaceFunctionParams Graph3D::SurfaceFunctionParams
Graph3D::readSurfaceFunction(TSVSerialiser &tsv) { Graph3D::readSurfaceFunction(MantidQt::API::TSVSerialiser &tsv) {
SurfaceFunctionParams params; SurfaceFunctionParams params;
tsv >> params.formula; tsv >> params.formula;
params.type = readSurfaceFunctionType(params.formula); params.type = readSurfaceFunctionType(params.formula);
...@@ -2928,7 +2928,7 @@ Graph3D::readSurfaceFunctionType(const std::string &formula) { ...@@ -2928,7 +2928,7 @@ Graph3D::readSurfaceFunctionType(const std::string &formula) {
} }
std::string Graph3D::saveToProject(ApplicationWindow *app) { std::string Graph3D::saveToProject(ApplicationWindow *app) {
TSVSerialiser tsv; MantidQt::API::TSVSerialiser tsv;
tsv.writeRaw("<SurfacePlot>"); tsv.writeRaw("<SurfacePlot>");
tsv.writeLine(name().toStdString()) << birthDate(); tsv.writeLine(name().toStdString()) << birthDate();
tsv.writeRaw(app->windowGeometryInfo(this)); tsv.writeRaw(app->windowGeometryInfo(this));
......
...@@ -416,13 +416,15 @@ signals: ...@@ -416,13 +416,15 @@ signals:
void modified(); void modified();
private: private:
Graph3D::SurfaceFunctionParams readSurfaceFunction(TSVSerialiser &tsv); Graph3D::SurfaceFunctionParams
readSurfaceFunction(MantidQt::API::TSVSerialiser &tsv);
Graph3D::SurfaceFunctionType Graph3D::SurfaceFunctionType
readSurfaceFunctionType(const std::string &formula); readSurfaceFunctionType(const std::string &formula);
MantidMatrix *readWorkspaceForPlot(ApplicationWindow *app, MantidMatrix *readWorkspaceForPlot(ApplicationWindow *app,
TSVSerialiser &tsv); MantidQt::API::TSVSerialiser &tsv);
int read3DPlotStyle(TSVSerialiser &tsv); int read3DPlotStyle(MantidQt::API::TSVSerialiser &tsv);
void setupMantidMatrixPlot3D(ApplicationWindow *app, TSVSerialiser &tsv); void setupMantidMatrixPlot3D(ApplicationWindow *app,
MantidQt::API::TSVSerialiser &tsv);
void setupPlot3D(ApplicationWindow *app, const QString &caption, void setupPlot3D(ApplicationWindow *app, const QString &caption,
const SurfaceFunctionParams &params); const SurfaceFunctionParams &params);
void setupPlotXYZ(ApplicationWindow *app, const QString &caption, void setupPlotXYZ(ApplicationWindow *app, const QString &caption,
......
...@@ -261,7 +261,7 @@ void Grid::copy(Grid *grid) { ...@@ -261,7 +261,7 @@ void Grid::copy(Grid *grid) {
} }
std::string Grid::saveToString() { std::string Grid::saveToString() {
TSVSerialiser tsv; MantidQt::API::TSVSerialiser tsv;
tsv.writeLine("grid"); tsv.writeLine("grid");
tsv << xEnabled() << xMinEnabled(); tsv << xEnabled() << xMinEnabled();
......
...@@ -49,7 +49,7 @@ IProjectSerialisable *InstrumentWindow::loadFromProject( ...@@ -49,7 +49,7 @@ IProjectSerialisable *InstrumentWindow::loadFromProject(
const std::string &lines, ApplicationWindow *app, const int fileVersion) { const std::string &lines, ApplicationWindow *app, const int fileVersion) {
Q_UNUSED(fileVersion); Q_UNUSED(fileVersion);
TSVSerialiser tsv(lines); MantidQt::API::TSVSerialiser tsv(lines);
if (!tsv.selectLine("WorkspaceName")) if (!tsv.selectLine("WorkspaceName"))
return nullptr; return nullptr;
...@@ -103,7 +103,7 @@ IProjectSerialisable *InstrumentWindow::loadFromProject( ...@@ -103,7 +103,7 @@ IProjectSerialisable *InstrumentWindow::loadFromProject(
* @return a string representing the state of the instrument window * @return a string representing the state of the instrument window
*/ */
std::string InstrumentWindow::saveToProject(ApplicationWindow *app) { std::string InstrumentWindow::saveToProject(ApplicationWindow *app) {
TSVSerialiser tsv, window; MantidQt::API::TSVSerialiser tsv, window;
window.writeRaw(app->windowGeometryInfo(this)); window.writeRaw(app->windowGeometryInfo(this));
auto widgetContents = m_instrumentWidget->saveToProject(); auto widgetContents = m_instrumentWidget->saveToProject();
window.writeRaw(widgetContents); window.writeRaw(widgetContents);
......
...@@ -1534,7 +1534,7 @@ IProjectSerialisable *Matrix::loadFromProject(const std::string &lines, ...@@ -1534,7 +1534,7 @@ IProjectSerialisable *Matrix::loadFromProject(const std::string &lines,
Mantid::Kernel::Strings::convert<int>(values[1], rows); Mantid::Kernel::Strings::convert<int>(values[1], rows);
Mantid::Kernel::Strings::convert<int>(values[2], cols); Mantid::Kernel::Strings::convert<int>(values[2], cols);
TSVSerialiser tsv(newLines); MantidQt::API::TSVSerialiser tsv(newLines);
std::string gStr; std::string gStr;
if (tsv.hasLine("geometry")) { if (tsv.hasLine("geometry")) {
gStr = tsv.lineAsString("geometry"); gStr = tsv.lineAsString("geometry");
...@@ -1642,7 +1642,7 @@ IProjectSerialisable *Matrix::loadFromProject(const std::string &lines, ...@@ -1642,7 +1642,7 @@ IProjectSerialisable *Matrix::loadFromProject(const std::string &lines,
} }
std::string Matrix::saveToProject(ApplicationWindow *app) { std::string Matrix::saveToProject(ApplicationWindow *app) {
TSVSerialiser tsv; MantidQt::API::TSVSerialiser tsv;
tsv.writeRaw("<matrix>"); tsv.writeRaw("<matrix>");
tsv.writeLine(objectName().toStdString()) << numRows() << numCols() tsv.writeLine(objectName().toStdString()) << numRows() << numCols()
......
...@@ -1014,7 +1014,7 @@ void MatrixModel::pasteData(double *clipboardBuffer, int topRow, int leftCol, ...@@ -1014,7 +1014,7 @@ void MatrixModel::pasteData(double *clipboardBuffer, int topRow, int leftCol,
MatrixModel::~MatrixModel() { free(d_data); } MatrixModel::~MatrixModel() { free(d_data); }
std::string MatrixModel::saveToProject() { std::string MatrixModel::saveToProject() {
TSVSerialiser tsv; MantidQt::API::TSVSerialiser tsv;
for (int row = 0; row < d_rows; ++row) { for (int row = 0; row < d_rows; ++row) {
// Index to the first element of each row // Index to the first element of each row
......
...@@ -1758,7 +1758,7 @@ IProjectSerialisable *MultiLayer::loadFromProject(const std::string &lines, ...@@ -1758,7 +1758,7 @@ IProjectSerialisable *MultiLayer::loadFromProject(const std::string &lines,
auto multiLayer = new MultiLayer(app, 0, rows, cols); auto multiLayer = new MultiLayer(app, 0, rows, cols);
TSVSerialiser tsv(lines); MantidQt::API::TSVSerialiser tsv(lines);
multiLayer->blockSignals(true); multiLayer->blockSignals(true);
...@@ -1805,7 +1805,7 @@ IProjectSerialisable *MultiLayer::loadFromProject(const std::string &lines, ...@@ -1805,7 +1805,7 @@ IProjectSerialisable *MultiLayer::loadFromProject(const std::string &lines,
for (auto it = graphSections.cbegin(); it != graphSections.cend(); ++it) { for (auto it = graphSections.cbegin(); it != graphSections.cend(); ++it) {
auto graphLines = *it; auto graphLines = *it;
TSVSerialiser gtsv(graphLines); MantidQt::API::TSVSerialiser gtsv(graphLines);
if (gtsv.selectLine("ggeometry")) { if (gtsv.selectLine("ggeometry")) {
int x = 0, y = 0, w = 0, h = 0; int x = 0, y = 0, w = 0, h = 0;
...@@ -1833,7 +1833,7 @@ IProjectSerialisable *MultiLayer::loadFromProject(const std::string &lines, ...@@ -1833,7 +1833,7 @@ IProjectSerialisable *MultiLayer::loadFromProject(const std::string &lines,
} }
std::string MultiLayer::saveToProject(ApplicationWindow *app) { std::string MultiLayer::saveToProject(ApplicationWindow *app) {
TSVSerialiser tsv; MantidQt::API::TSVSerialiser tsv;
tsv.writeRaw("<multiLayer>"); tsv.writeRaw("<multiLayer>");
......
...@@ -155,7 +155,7 @@ IProjectSerialisable *Note::loadFromProject(const std::string &lines, ...@@ -155,7 +155,7 @@ IProjectSerialisable *Note::loadFromProject(const std::string &lines,
app->setListViewDate(name, date); app->setListViewDate(name, date);
note->setBirthDate(date); note->setBirthDate(date);
TSVSerialiser tsv(lines); MantidQt::API::TSVSerialiser tsv(lines);
if (tsv.hasLine("geometry")) { if (tsv.hasLine("geometry")) {
const QString geometry = const QString geometry =
...@@ -186,7 +186,7 @@ IProjectSerialisable *Note::loadFromProject(const std::string &lines, ...@@ -186,7 +186,7 @@ IProjectSerialisable *Note::loadFromProject(const std::string &lines,
} }
std::string Note::saveToProject(ApplicationWindow *app) { std::string Note::saveToProject(ApplicationWindow *app) {
TSVSerialiser tsv; MantidQt::API::TSVSerialiser tsv;
tsv.writeRaw("<note>"); tsv.writeRaw("<note>");
tsv.writeLine(name().toStdString()) << birthDate(); tsv.writeLine(name().toStdString()) << birthDate();
tsv.writeRaw(app->windowGeometryInfo(this)); tsv.writeRaw(app->windowGeometryInfo(this));
......
...@@ -435,7 +435,7 @@ void ScriptingWindow::loadFromProject(const std::string &lines, ...@@ -435,7 +435,7 @@ void ScriptingWindow::loadFromProject(const std::string &lines,
const int fileVersion) { const int fileVersion) {
Q_UNUSED(fileVersion); Q_UNUSED(fileVersion);
TSVSerialiser sTSV(lines); MantidQt::API::TSVSerialiser sTSV(lines);
QStringList files; QStringList files;
setWindowTitle("MantidPlot: " + app->scriptingEnv()->languageName() + setWindowTitle("MantidPlot: " + app->scriptingEnv()->languageName() +
......
...@@ -1015,7 +1015,7 @@ QImage Spectrogram::renderImage(const QwtScaleMap &xMap, ...@@ -1015,7 +1015,7 @@ QImage Spectrogram::renderImage(const QwtScaleMap &xMap,
void Spectrogram::loadFromProject(const std::string &lines) { void Spectrogram::loadFromProject(const std::string &lines) {
using namespace Mantid::Kernel; using namespace Mantid::Kernel;
TSVSerialiser tsv(lines); MantidQt::API::TSVSerialiser tsv(lines);
if (tsv.hasSection("ColorPolicy")) { if (tsv.hasSection("ColorPolicy")) {
std::string policyStr = tsv.sections("ColorPolicy").front(); std::string policyStr = tsv.sections("ColorPolicy").front();
...@@ -1027,7 +1027,7 @@ void Spectrogram::loadFromProject(const std::string &lines) { ...@@ -1027,7 +1027,7 @@ void Spectrogram::loadFromProject(const std::string &lines) {
setDefaultColorMap(); setDefaultColorMap();
} else if (tsv.hasSection("ColorMap")) { } else if (tsv.hasSection("ColorMap")) {
const std::string cmStr = tsv.sections("ColorMap").front(); const std::string cmStr = tsv.sections("ColorMap").front();
TSVSerialiser cm(cmStr); MantidQt::API::TSVSerialiser cm(cmStr);
std::string filename; std::string filename;
if (cm.selectLine("FileName")) if (cm.selectLine("FileName"))
...@@ -1073,7 +1073,7 @@ void Spectrogram::loadFromProject(const std::string &lines) { ...@@ -1073,7 +1073,7 @@ void Spectrogram::loadFromProject(const std::string &lines) {
if (tsv.hasSection("ColorBar")) { if (tsv.hasSection("ColorBar")) {
const std::string cbStr = tsv.sections("ColorBar").front(); const std::string cbStr = tsv.sections("ColorBar").front();
TSVSerialiser cb(cbStr); MantidQt::API::TSVSerialiser cb(cbStr);
std::string axisStr = cb.sections("axis")[0]; std::string axisStr = cb.sections("axis")[0];
std::string widthStr = cb.sections("width")[0]; std::string widthStr = cb.sections("width")[0];
...@@ -1105,7 +1105,7 @@ void Spectrogram::loadFromProject(const std::string &lines) { ...@@ -1105,7 +1105,7 @@ void Spectrogram::loadFromProject(const std::string &lines) {
std::string Spectrogram::saveToProject() { std::string Spectrogram::saveToProject() {
using namespace Mantid::Kernel; using namespace Mantid::Kernel;
TSVSerialiser tsv; MantidQt::API::TSVSerialiser tsv;
tsv.writeRaw("<spectrogram>"); tsv.writeRaw("<spectrogram>");
if (!d_wsName.empty()) if (!d_wsName.empty())
tsv.writeLine("workspace") << d_wsName; tsv.writeLine("workspace") << d_wsName;
...@@ -1116,7 +1116,7 @@ std::string Spectrogram::saveToProject() { ...@@ -1116,7 +1116,7 @@ std::string Spectrogram::saveToProject() {
tsv.writeInlineSection("ColorPolicy", tsv.writeInlineSection("ColorPolicy",
Strings::toString<int>(color_map_policy)); Strings::toString<int>(color_map_policy));
else { else {
TSVSerialiser cm; MantidQt::API::TSVSerialiser cm;
if (!mCurrentColorMap.isEmpty()) if (!mCurrentColorMap.isEmpty())
cm.writeLine("FileName") << mCurrentColorMap.toStdString(); cm.writeLine("FileName") << mCurrentColorMap.toStdString();
cm.writeInlineSection("Mode", Strings::toString<int>(color_map.mode())); cm.writeInlineSection("Mode", Strings::toString<int>(color_map.mode()));
...@@ -1143,7 +1143,7 @@ std::string Spectrogram::saveToProject() { ...@@ -1143,7 +1143,7 @@ std::string Spectrogram::saveToProject() {
QwtScaleWidget *colorAxis = plot()->axisWidget(color_axis); QwtScaleWidget *colorAxis = plot()->axisWidget(color_axis);
if (colorAxis && colorAxis->isColorBarEnabled()) { if (colorAxis && colorAxis->isColorBarEnabled()) {
TSVSerialiser cb; MantidQt::API::TSVSerialiser cb;
cb.writeInlineSection("axis", Strings::toString<int>(color_axis)); cb.writeInlineSection("axis", Strings::toString<int>(color_axis));
cb.writeInlineSection("width", cb.writeInlineSection("width",
Strings::toString<int>(colorAxis->colorBarWidth())); Strings::toString<int>(colorAxis->colorBarWidth()));
......
...@@ -638,7 +638,7 @@ void Table::updateValues(Table *t, const QString &columnName) { ...@@ -638,7 +638,7 @@ void Table::updateValues(Table *t, const QString &columnName) {
} }
std::string Table::saveToProject(ApplicationWindow *app) { std::string Table::saveToProject(ApplicationWindow *app) {
TSVSerialiser tsv; MantidQt::API::TSVSerialiser tsv;
tsv.writeRaw("<table>"); tsv.writeRaw("<table>");
tsv.writeLine(objectName().toStdString()) tsv.writeLine(objectName().toStdString())
...@@ -3036,7 +3036,7 @@ IProjectSerialisable *Table::loadFromProject(const std::string &lines, ...@@ -3036,7 +3036,7 @@ IProjectSerialisable *Table::loadFromProject(const std::string &lines,
} }
} }
TSVSerialiser tsv(lines); MantidQt::API::TSVSerialiser tsv(lines);
if (tsv.selectLine("geometry")) if (tsv.selectLine("geometry"))
app->restoreWindowGeometry( app->restoreWindowGeometry(
...@@ -3176,7 +3176,7 @@ IProjectSerialisable *Table::loadFromProject(const std::string &lines, ...@@ -3176,7 +3176,7 @@ IProjectSerialisable *Table::loadFromProject(const std::string &lines,
} }
std::string Table::saveTableMetadata() { std::string Table::saveTableMetadata() {
TSVSerialiser tsv; MantidQt::API::TSVSerialiser tsv;
tsv.writeLine("header"); tsv.writeLine("header");
for (int j = 0; j < d_table->columnCount(); j++) { for (int j = 0; j < d_table->columnCount(); j++) {
QString val = colLabel(j); QString val = colLabel(j);
......
...@@ -293,7 +293,7 @@ IProjectSerialisable *TableStatistics::loadFromProject(const std::string &lines, ...@@ -293,7 +293,7 @@ IProjectSerialisable *TableStatistics::loadFromProject(const std::string &lines,
const std::string type = firstLineVec[2]; const std::string type = firstLineVec[2];
QString birthDate = QString::fromStdString(firstLineVec[3]); QString birthDate = QString::fromStdString(firstLineVec[3]);
TSVSerialiser tsv(lines); MantidQt::API::TSVSerialiser tsv(lines);
if (!tsv.hasLine("Targets")) if (!tsv.hasLine("Targets"))
return nullptr; return nullptr;
...@@ -406,7 +406,7 @@ IProjectSerialisable *TableStatistics::loadFromProject(const std::string &lines, ...@@ -406,7 +406,7 @@ IProjectSerialisable *TableStatistics::loadFromProject(const std::string &lines,
} }
std::string TableStatistics::saveToProject(ApplicationWindow *app) { std::string TableStatistics::saveToProject(ApplicationWindow *app) {
TSVSerialiser tsv; MantidQt::API::TSVSerialiser tsv;
tsv.writeRaw("<TableStatistics>"); tsv.writeRaw("<TableStatistics>");
tsv.writeLine(objectName().toStdString()); tsv.writeLine(objectName().toStdString());
......
#ifndef MANTID_TSVSERIALISER_H_ #ifndef MANTID_TSVSERIALISER_H_
#define MANTID_TSVSERIALISER_H_ #define MANTID_TSVSERIALISER_H_
#include "DllOption.h"
#include "MantidKernel/CaseInsensitiveMap.h" #include "MantidKernel/CaseInsensitiveMap.h"
#include <map> #include <map>
...@@ -39,7 +40,10 @@ ...@@ -39,7 +40,10 @@
File change history is stored at: <https://github.com/mantidproject/mantid> File change history is stored at: <https://github.com/mantidproject/mantid>
*/ */
class TSVSerialiser { namespace MantidQt {
namespace API {
class EXPORT_OPT_MANTIDQT_API TSVSerialiser {
public: public:
TSVSerialiser(); TSVSerialiser();
...@@ -108,5 +112,7 @@ private: ...@@ -108,5 +112,7 @@ private:
std::stringstream m_output; std::stringstream m_output;
bool m_midLine; bool m_midLine;
}; };
}
}
#endif #endif
...@@ -10,6 +10,8 @@ namespace { ...@@ -10,6 +10,8 @@ namespace {
Mantid::Kernel::Logger g_log("TSVSerialiser"); Mantid::Kernel::Logger g_log("TSVSerialiser");
} }
using namespace MantidQt::API;
TSVSerialiser::TSVSerialiser() : m_curIndex(0), m_midLine(false) {} TSVSerialiser::TSVSerialiser() : m_curIndex(0), m_midLine(false) {}
TSVSerialiser::TSVSerialiser(const std::string &lines) TSVSerialiser::TSVSerialiser(const std::string &lines)
......
...@@ -327,7 +327,7 @@ void ColorMapWidget::mouseReleaseEvent(QMouseEvent * /*e*/) { ...@@ -327,7 +327,7 @@ void ColorMapWidget::mouseReleaseEvent(QMouseEvent * /*e*/) {
* @return string representing the current state of the color map widget. * @return string representing the current state of the color map widget.
*/ */
std::string ColorMapWidget::saveToProject() const { std::string ColorMapWidget::saveToProject() const {
TSVSerialiser tsv, cm; API::TSVSerialiser tsv, cm;
cm.writeLine("ScaleType") << getScaleType(); cm.writeLine("ScaleType") << getScaleType();
cm.writeLine("Power") << getNth_power(); cm.writeLine("Power") << getNth_power();
cm.writeLine("MinValue") << getMinValue(); cm.writeLine("MinValue") << getMinValue();
...@@ -342,11 +342,11 @@ std::string ColorMapWidget::saveToProject() const { ...@@ -342,11 +342,11 @@ std::string ColorMapWidget::saveToProject() const {
* widget. * widget.
*/ */
void ColorMapWidget::loadFromProject(const std::string &lines) { void ColorMapWidget::loadFromProject(const std::string &lines) {
TSVSerialiser tsv(lines); API::TSVSerialiser tsv(lines);
if (tsv.selectSection("colormap")) { if (tsv.selectSection("colormap")) {
std::string colorMapLines; std::string colorMapLines;
tsv >> colorMapLines; tsv >> colorMapLines;
TSVSerialiser cm(colorMapLines); API::TSVSerialiser cm(colorMapLines);
int scaleType; int scaleType;
double min, max, power; double min, max, power;
......
...@@ -1289,7 +1289,7 @@ bool FindComponentVisitor::visit(GLActor *actor) { ...@@ -1289,7 +1289,7 @@ bool FindComponentVisitor::visit(GLActor *actor) {
* @return string representing the current state of the instrumet actor. * @return string representing the current state of the instrumet actor.
*/ */
std::string InstrumentActor::saveToProject() const { std::string InstrumentActor::saveToProject() const {
TSVSerialiser tsv;