Go to the documentation of this file.
54 template <
class charT>
122 template <
class charT>
124 :
std::basic_string<charT>(n, c) {
139 template <
class charT>
141 const std::basic_string<charT>& A,
Index pos,
Index numpos) {
145 if (!A.size())
return;
151 assert(
static_cast<typename std::basic_string<charT>::size_type
>(pos) <
157 (
static_cast<typename std::basic_string<charT>::size_type
>(numpos) <=
169 std::basic_string<charT>::operator=(std::basic_string<charT>(A, pos, numpos));
173 template <
class charT>
175 :
std::basic_string<charT>(A) {
183 template <
class charT>
187 size_t searchstr_size = searchstr.size();
188 size_t insstr_size = insstr.size();
189 size_t start_pos = 0;
191 while (start_pos != std::string::npos) {
192 start_pos = this->find(searchstr, start_pos);
193 if (start_pos && start_pos != std::string::npos) {
194 this->insert(start_pos, insstr);
195 start_pos += searchstr_size + insstr_size;
205 template <
class charT>
213 while (oldpos < (
size_t)this->
nelem() &&
214 (pos = this->find(delim, oldpos)) !=
216 if (pos && pos - oldpos) aos.push_back(this->substr(oldpos, pos - oldpos));
217 oldpos = pos + delim.
nelem();
220 if (oldpos < (
size_t)this->
nelem()) aos.push_back(this->substr(oldpos));
224 template <
class charT>
230 while (0 != this_string.
nelem() &&
231 (
' ' == this_string[0] ||
'\t' == this_string[0] ||
232 '\n' == this_string[0] ||
'\r' == this_string[0]))
233 this_string.erase(0, 1);
236 while (0 != this_string.
nelem() &&
237 (
' ' == this_string[this_string.
nelem() - 1] ||
238 '\t' == this_string[this_string.
nelem() - 1] ||
239 '\n' == this_string[this_string.
nelem() - 1] ||
240 '\r' == this_string[this_string.
nelem() - 1]))
241 this_string.erase(this_string.
nelem() - 1);
245 template <
class charT>
247 size_t s = this->size();
248 assert(s < LONG_MAX);
249 return static_cast<long>(s);
258 template <
class charT>
262 return std::basic_string<charT>::operator[](n);
271 template <
class charT>
275 return std::basic_string<charT>::operator[](n);
305 std::istringstream item(line.substr(0, n));
my_basic_string()=default
void transform(VectorView y, double(&my_func)(double), ConstVectorView x)
A generic transform function for vectors, which can be used to implement mathematical functions opera...
char operator[](Index n) const
Constant index operator.
void toupper()
Convert to upper case.
my_basic_string(const std::basic_string< charT > &A, Index pos=0, Index numpos=my_basic_string< charT >::npos)
Construnctor from a basic_string.
my_basic_string(Index n, char c=' ')
Constructor setting size.
void std(VectorView std, const Vector &y, const ArrayOfVector &ys, const Index start=0, const Index end=-1)
Compute the standard deviation of the ranged ys.
Array< Array< String > > ArrayOfArrayOfString
An array of Strings.
This file contains the definition of Array.
my_basic_string toupper() const
void extract(T &x, String &line, Index n)
Extract something from the beginning of a string.
This can be used to make arrays out of anything.
Index nelem(const Lines &l)
Number of lines.
The implementation for String, the ARTS string class.
Array< String > ArrayOfString
An array of Strings.
void insert_substr(const my_basic_string< charT > &searchstr, const my_basic_string< charT > &insstr)
Insert string before all occurrences of the substring.
my_basic_string(const char A[])
Constructor from a C-style char array.
void trim()
Trim leading and trailing whitespace.
void tolower()
Convert to lower case.
constexpr Rational end(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the largest M for a polarization type of this transition.
Index nelem() const
Number of elements.
void split(Array< my_basic_string< charT > > &aos, const my_basic_string< charT > &delim) const
Split string into substrings.
my_basic_string< char > String
The String type for ARTS.
char & operator[](Index n)
Non-constant index operator.
my_basic_string tolower() const
Vector x(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
static const Index npos
Define npos: