Mantid
Loading...
Searching...
No Matches
RegexStrings.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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#include "MantidKernel/DllConfig.h"
10#ifndef Q_MOC_RUN
11#include <boost/regex.hpp>
12#endif
13
14namespace Mantid {
15namespace Kernel {
16namespace Strings {
18template <typename T> MANTID_KERNEL_DLL int StrComp(const char *, const boost::regex &, T &, const int = 0);
19
21template <typename T> MANTID_KERNEL_DLL int StrComp(const std::string &, const boost::regex &, T &, const int = 0);
22
24MANTID_KERNEL_DLL int StrLook(const std::string &, const boost::regex &);
25
27MANTID_KERNEL_DLL std::vector<std::string> StrParts(std::string, const boost::regex &);
28
30template <typename T> int StrFullSplit(const std::string &, const boost::regex &, std::vector<T> &);
32template <typename T> int StrFullSplit(const char *, const boost::regex &, std::vector<T> &);
34template <typename T> int StrSingleSplit(const std::string &, const boost::regex &, std::vector<T> &);
36template <typename T> int StrSingleSplit(const char *, const boost::regex &, std::vector<T> &);
37
39template <typename T> int StrFullCut(std::string &, const boost::regex &, T &, const int = -1);
41template <typename T> int StrFullCut(std::string &, const boost::regex &, std::vector<T> &);
42
44template <typename T> MANTID_KERNEL_DLL int findComp(std::istream &, const boost::regex &, T &);
45
47MANTID_KERNEL_DLL int findPattern(std::istream &, const boost::regex &, std::string &);
48
49} // NAMESPACE Strings
50
51} // NAMESPACE Kernel
52
53} // NAMESPACE Mantid
Holds support functions for strings.
Definition: RegexStrings.h:16
MANTID_KERNEL_DLL int findPattern(std::istream &, const boost::regex &, std::string &)
Finds a pattern in a file.
MANTID_KERNEL_DLL int findComp(std::istream &, const boost::regex &, T &)
Find a compmonent in a Regex in a file.
MANTID_KERNEL_DLL int StrComp(const char *, const boost::regex &, T &, const int=0)
Find if a pattern matches a string.
int StrSingleSplit(const std::string &, const boost::regex &, std::vector< T > &)
Split a line searched parts.
int StrFullCut(std::string &, const boost::regex &, T &, const int=-1)
Cut out the searched section and returns component.
int StrFullSplit(const std::string &, const boost::regex &, std::vector< T > &)
Split a line searched parts.
MANTID_KERNEL_DLL int StrLook(const std::string &, const boost::regex &)
Find is a pattern matches.
MANTID_KERNEL_DLL std::vector< std::string > StrParts(std::string, const boost::regex &)
Split a line into component parts.
Helper class which provides the Collimation Length for SANS instruments.