ARTS 2.5.4 (git: 31ce4f0e)
my_basic_string< charT > Class Template Reference

The implementation for String, the ARTS string class. More...

#include <mystring.h>

Inheritance diagram for my_basic_string< charT >:

Public Types

using size_type = Index
 

Public Member Functions

 my_basic_string ()=default
 
 my_basic_string (Index n, char c=' ')
 
 my_basic_string (const std::basic_string< charT > &A, Index pos=0, Index numpos=my_basic_string< charT >::npos)
 
 my_basic_string (const char *A)
 
 my_basic_string (const std::string_view &sv)
 
void insert_substr (const my_basic_string< charT > &searchstr, const my_basic_string< charT > &insstr)
 
void split (Array< my_basic_string< charT > > &aos, const my_basic_string< charT > &delim) const
 
void toupper ()
 Convert to upper case. More...
 
my_basic_string toupper () const
 
void tolower ()
 Convert to lower case. More...
 
my_basic_string tolower () const
 
void trim ()
 Trim leading and trailing whitespace. More...
 
Index nelem () const
 
char operator[] (Index n) const
 
char & operator[] (Index n)
 

Static Public Attributes

static const Index npos = static_cast<Index>(std::basic_string<charT>::npos)
 Define npos: More...
 

Detailed Description

template<class charT>
class my_basic_string< charT >

The implementation for String, the ARTS string class.

This adds some additional functionality to the standard stl string class, notably:

a) Range checking by assert

b) nelem() member function, return the size of the String of type Index.

The type string is just a typedef for basic_string<char>. Therefore, to make everything work correctly, we have to derive our own class from basic_string, not from string directly.

Definition at line 61 of file mystring.h.

Member Typedef Documentation

◆ size_type

template<class charT >
using my_basic_string< charT >::size_type = Index

Definition at line 211 of file mystring.h.

Constructor & Destructor Documentation

◆ my_basic_string() [1/5]

template<class charT >
my_basic_string< charT >::my_basic_string ( )
default

◆ my_basic_string() [2/5]

template<class charT >
my_basic_string< charT >::my_basic_string ( Index  n,
char  c = ' ' 
)
inlineexplicit

Definition at line 66 of file mystring.h.

◆ my_basic_string() [3/5]

template<class charT >
my_basic_string< charT >::my_basic_string ( const std::basic_string< charT > &  A,
Index  pos = 0,
Index  numpos = my_basic_string<charT>::npos 
)
inline

Definition at line 69 of file mystring.h.

References ARTS_ASSERT.

◆ my_basic_string() [4/5]

template<class charT >
my_basic_string< charT >::my_basic_string ( const char *  A)
inline

Definition at line 104 of file mystring.h.

◆ my_basic_string() [5/5]

template<class charT >
my_basic_string< charT >::my_basic_string ( const std::string_view &  sv)
inline

Definition at line 108 of file mystring.h.

Member Function Documentation

◆ insert_substr()

template<class charT >
void my_basic_string< charT >::insert_substr ( const my_basic_string< charT > &  searchstr,
const my_basic_string< charT > &  insstr 
)
inline

Definition at line 113 of file mystring.h.

Referenced by write_method_header_documentation().

◆ nelem()

◆ operator[]() [1/2]

template<class charT >
char & my_basic_string< charT >::operator[] ( Index  n)
inline

Definition at line 202 of file mystring.h.

References ARTS_ASSERT, and my_basic_string< charT >::nelem().

◆ operator[]() [2/2]

template<class charT >
char my_basic_string< charT >::operator[] ( Index  n) const
inline

Definition at line 196 of file mystring.h.

References ARTS_ASSERT, and my_basic_string< charT >::nelem().

◆ split()

template<class charT >
void my_basic_string< charT >::split ( Array< my_basic_string< charT > > &  aos,
const my_basic_string< charT > &  delim 
) const
inline

◆ tolower() [1/2]

template<class charT >
void my_basic_string< charT >::tolower ( )
inline

Convert to lower case.

Definition at line 158 of file mystring.h.

References Zeeman::end(), my_basic_string< charT >::tolower(), and transform().

Referenced by time_stepper_selection(), and my_basic_string< charT >::tolower().

◆ tolower() [2/2]

template<class charT >
my_basic_string my_basic_string< charT >::tolower ( ) const
inline

Definition at line 162 of file mystring.h.

References my_basic_string< charT >::tolower().

◆ toupper() [1/2]

template<class charT >
void my_basic_string< charT >::toupper ( )
inline

◆ toupper() [2/2]

template<class charT >
my_basic_string my_basic_string< charT >::toupper ( ) const
inline

Definition at line 151 of file mystring.h.

References my_basic_string< charT >::toupper().

◆ trim()

template<class charT >
void my_basic_string< charT >::trim ( )
inline

Trim leading and trailing whitespace.

Definition at line 169 of file mystring.h.

References my_basic_string< charT >::nelem().

Member Data Documentation

◆ npos

template<class charT >
const Index my_basic_string< charT >::npos = static_cast<Index>(std::basic_string<charT>::npos)
static

Define npos:

Definition at line 209 of file mystring.h.

Referenced by ArrayOfSpeciesTag::ArrayOfSpeciesTag(), and replace_all().


The documentation for this class was generated from the following file: