Mantid
Loading...
Searching...
No Matches
UnitLabel.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2014 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
11#include "MantidKernel/DllConfig.h"
12#include <string>
13
14namespace Mantid {
15namespace Kernel {
20class MANTID_KERNEL_DLL UnitLabel {
21public:
22 UnitLabel() = delete;
23
25 using AsciiString = std::string;
29 using Utf8String = std::wstring;
30
32 UnitLabel(AsciiString ascii, Utf8String unicode, AsciiString latex);
34 UnitLabel(const AsciiString &ascii);
36 UnitLabel(const char *ascii);
37
39 bool operator==(const UnitLabel &rhs) const;
41 bool operator==(const std::string &rhs) const;
43 bool operator==(const char *rhs) const;
45 bool operator==(const std::wstring &rhs) const;
46
48 bool operator!=(const UnitLabel &rhs) const;
50 bool operator!=(const std::string &rhs) const;
52 bool operator!=(const char *rhs) const;
54 bool operator!=(const std::wstring &rhs) const;
55
57 const AsciiString &ascii() const;
59 const Utf8String &utf8() const;
61 const AsciiString &latex() const;
62
64 operator std::string() const;
65
66private:
68 std::string m_ascii;
70 std::wstring m_utf8;
72 std::string m_latex;
73};
74
75} // namespace Kernel
76} // namespace Mantid
const std::vector< double > & rhs
A base-class for the a class that is able to return unit labels in different representations.
Definition: UnitLabel.h:20
std::wstring m_utf8
Value of utf-8 encoded string.
Definition: UnitLabel.h:70
std::string AsciiString
Type that contains a plain-text string.
Definition: UnitLabel.h:25
std::string m_ascii
Value of plain-text label.
Definition: UnitLabel.h:68
std::string m_latex
Value of latex label.
Definition: UnitLabel.h:72
std::wstring Utf8String
Type that can hold a unicode string.
Definition: UnitLabel.h:29
Helper class which provides the Collimation Length for SANS instruments.
constexpr bool operator==(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)
constexpr bool operator!=(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)