Mantid
Loading...
Searching...
No Matches
LoadTBL.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//----------------------------------------------------------------------
13#include "MantidDataHandling/DllConfig.h"
16
17namespace Mantid {
18namespace DataHandling {
23class MANTID_DATAHANDLING_DLL LoadTBL : public API::IFileLoader<Kernel::FileDescriptor> {
24public:
28 const std::string name() const override { return "LoadTBL"; }
30 const std::string summary() const override {
31 return "Loads data from a reflectometry table file and stores it in a "
32 "table workspace (TableWorkspace class).";
33 }
34
36 int version() const override { return 1; }
37 const std::vector<std::string> seeAlso() const override { return {"SaveTBL"}; }
39 const std::string category() const override { return "DataHandling\\Text"; }
41 int confidence(Kernel::FileDescriptor &descriptor) const override;
42
43private:
45 void init() override;
47 void exec() override;
49 bool getColumnHeadings(std::string line, std::vector<std::string> &cols);
51 size_t getCells(std::string line, std::vector<std::string> &cols, size_t expectedCommas, bool isOldTBL) const;
53 size_t countCommas(const std::string &line) const;
55 size_t findQuotePairs(const std::string &line, std::vector<std::vector<size_t>> &quoteBounds) const;
58 void csvParse(const std::string &line, std::vector<std::string> &cols, std::vector<std::vector<size_t>> &quoteBounds,
59 size_t expectedCommas) const;
60};
61
62} // namespace DataHandling
63} // namespace Mantid
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
Definition: IFileLoader.h:19
Loads a table workspace from an ascii file in reflectometry tbl format.
Definition: LoadTBL.h:23
const std::string name() const override
The name of the algorithm.
Definition: LoadTBL.h:28
const std::string category() const override
The category.
Definition: LoadTBL.h:39
const std::string summary() const override
Summary of algorithms purpose.
Definition: LoadTBL.h:30
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: LoadTBL.h:37
int version() const override
The version number.
Definition: LoadTBL.h:36
LoadTBL()
Default constructor.
Defines a wrapper around an open file.
Helper class which provides the Collimation Length for SANS instruments.