12#include <OpenMS/OpenMSConfig.h>
41 StringView(
const std::string& s) : begin_(s.data()), size_(s.size())
48 if (size_ < other.
size_)
return true;
50 if (size_ > other.
size_)
return false;
54 if (begin_ == other.
begin_)
return false;
56 return strncmp(begin_, other.
begin_, size_) < 0;
61 if (size_ != other.
size_)
return false;
65 if (begin_ == other.
begin_)
return true;
67 return strncmp(begin_, other.
begin_, size_) == 0;
73 if (!size_)
return *
this;
76 sv.
begin_ = begin_ + start;
90 if (!size_)
return String();
91 return String(begin_, begin_ + size_);
StringView provides a non-owning view on an existing string.
Definition StringView.h:28
StringView(const StringView &)=default
StringView substr(Size start, Size length) const
create view that references a substring of the original string
Definition StringView.h:71
const char * begin_
Definition StringView.h:95
bool operator<(const StringView other) const
less operator
Definition StringView.h:46
StringView & operator=(const StringView &)=default
StringView(const std::string &s)
Definition StringView.h:41
Size size() const
size of view
Definition StringView.h:82
String getString() const
create String object from view
Definition StringView.h:88
bool operator==(const StringView other) const
Definition StringView.h:59
Size size_
Definition StringView.h:96
A more convenient string class.
Definition String.h:32
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19