Mantid
Loading...
Searching...
No Matches
SaveCSV.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/Algorithm.h"
13#include "MantidDataHandling/DllConfig.h"
15
16namespace Mantid {
17namespace DataHandling {
69class MANTID_DATAHANDLING_DLL SaveCSV final : public API::Algorithm {
70public:
74 const std::string name() const override { return "SaveCSV"; };
76 const std::string summary() const override { return "Saves a 1D or 2D workspace to a CSV file."; }
77
79 int version() const override { return 1; };
80 const std::vector<std::string> seeAlso() const override { return {"SaveAscii"}; }
82 const std::string category() const override { return "DataHandling\\Text"; }
83
84private:
86 void init() override;
87
89 void exec() override;
90
92 void saveXerrors(std::ofstream &stream, const Mantid::DataObjects::Workspace2D_sptr &workspace,
93 const size_t numberOfHist);
94
96 std::string m_filename;
97
99 std::string m_separator;
100
102 std::string m_lineSeparator;
103};
104
105} // namespace DataHandling
106} // namespace Mantid
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Saves a 1D or 2D workspace to a CSV file.
Definition: SaveCSV.h:69
std::string m_lineSeparator
The line seperator for the CSV file.
Definition: SaveCSV.h:102
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: SaveCSV.h:82
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: SaveCSV.h:80
SaveCSV()
Default constructor.
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: SaveCSV.h:79
const std::string summary() const override
Summary of algorithms purpose.
Definition: SaveCSV.h:76
std::string m_filename
The name of the file used for storing the workspace.
Definition: SaveCSV.h:96
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: SaveCSV.h:74
std::string m_separator
The seperator for the CSV file.
Definition: SaveCSV.h:99
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
Helper class which provides the Collimation Length for SANS instruments.