Mantid
Loading...
Searching...
No Matches
ParseKeyValueString.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 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
15#include "DllOption.h"
16#include "MantidKernel/System.h"
18
19#include <QString>
20#include <sstream>
21#include <string>
22
23#include <map>
24
25namespace MantidQt {
26namespace MantidWidgets {
27
28std::map<std::string, std::string> DLLExport parseKeyValueString(const std::string &str,
29 const std::string &separator = ",");
30std::map<QString, QString> DLLExport parseKeyValueQString(const QString &str, const std::string &separator = ",");
31// Trim leading/trailing whitespace and quotes from a string
32void trimWhitespaceAndQuotes(const QString &valueIn);
33// Trim whitespace, quotes and empty values from a string list
34void trimWhitespaceQuotesAndEmptyValues(QStringList &values);
36QString EXPORT_OPT_MANTIDQT_COMMON convertMapToString(const std::map<QString, QString> &optionsMap,
37 const char separator = ',', const bool quoteValues = true);
38std::string EXPORT_OPT_MANTIDQT_COMMON convertMapToString(const std::map<std::string, std::string> &optionsMap,
39 const char separator, const bool quoteValues);
41std::string EXPORT_OPT_MANTIDQT_COMMON optionsToString(std::map<std::string, std::string> const &options,
42 const bool quoteValues = true,
43 const std::string &separator = ", ");
44} // namespace MantidWidgets
45} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition: System.h:53
QString EXPORT_OPT_MANTIDQT_COMMON convertMapToString(const std::map< QString, QString > &optionsMap, const char separator=',', const bool quoteValues=true)
Convert an options map to a string.
void trimWhitespaceQuotesAndEmptyValues(QStringList &values)
Trim whitespace and quotes from the start/end for all strings in the given list, and subsequently rem...
std::map< std::string, std::string > DLLExport parseKeyValueString(const std::string &str, const std::string &separator=",")
Parses a string in the format ‘a = 1,b=2, c = "1,2,3,4", d = 5.0, e='a,b,c’` into a map of key/value ...
std::map< QString, QString > DLLExport parseKeyValueQString(const QString &str, const std::string &separator=",")
Parses a string in the format ‘a = 1,b=2, c = "1,2,3,4", d = 5.0, e='a,b,c’` into a map of key/value ...
std::string EXPORT_OPT_MANTIDQT_COMMON convertAlgPropsToString(MantidQt::API::IAlgorithmRuntimeProps const &options)
void trimWhitespaceAndQuotes(const QString &valueIn)
std::string EXPORT_OPT_MANTIDQT_COMMON optionsToString(std::map< std::string, std::string > const &options, const bool quoteValues=true, const std::string &separator=", ")
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...