Tinker9 70bd052 (Thu Nov 9 12:11:35 2023 -0800)
Loading...
Searching...
No Matches
Classes | Typedefs
Fortran String View

Classes

class  tinker::FortranStringView
 Reference to the non-NULL-terminated Fortran strings. Provides a few std::string-style methods to handle the fortran strings. More...
 

Typedefs

using tinker::FstrView = FortranStringView
 An alias of FortranStringView. More...
 

Detailed Description


Class Documentation

◆ tinker::FortranStringView

class tinker::FortranStringView

Reference to the non-NULL-terminated Fortran strings. Provides a few std::string-style methods to handle the fortran strings.

Public Member Functions

size_t len_trim () const
 Returns the length of string, ignoring the trailing whitespaces. More...
 
std::string trim () const
 Returns a string without the trailing whitespaces. More...
 
FortranStringView operator() (int begin1, int back1) const
 Analogous to Fortran str(x:y) syntax. More...
 
FortranStringView operator() (int begin1) const
 Analogous to Fortran str(x:) syntax. More...
 
template<size_t Len>
 FortranStringView (char(&src)[Len])
 Constructs with a char pointer and the reserved length of the Fortran string. More...
 
 FortranStringView (char *src, size_t len)
 Constructs with a char pointer and the reserved length of the Fortran string. More...
 
template<size_t Len>
FortranStringViewoperator= (const char(&src)[Len])
 Assigned by a C/C++ style string. Ignores the trailing characters if the source is too long. More...
 
FortranStringViewoperator= (const char *src)
 Assigned by a C/C++ style string. Ignores the trailing characters if the source is too long. More...
 
FortranStringViewoperator= (const std::string &src)
 Assigned by a C/C++ style string. Ignores the trailing characters if the source is too long. More...
 
template<size_t Len>
bool operator== (const char(&src)[Len]) const
 Returns true if two strings are equal. More...
 
bool operator== (const char *src) const
 Returns true if two strings are equal. More...
 
bool operator== (const std::string &src) const
 Returns true if two strings are equal. More...
 
bool operator== (const FortranStringView &src) const
 Returns true if two strings are equal. More...
 

Constructor & Destructor Documentation

◆ FortranStringView() [1/2]

template<size_t Len>
tinker::FortranStringView::FortranStringView ( char(&)  src[Len])
inline

Constructs with a char pointer and the reserved length of the Fortran string.

◆ FortranStringView() [2/2]

tinker::FortranStringView::FortranStringView ( char *  src,
size_t  len 
)

Constructs with a char pointer and the reserved length of the Fortran string.

Member Function Documentation

◆ len_trim()

size_t tinker::FortranStringView::len_trim ( ) const

Returns the length of string, ignoring the trailing whitespaces.

◆ operator()() [1/2]

FortranStringView tinker::FortranStringView::operator() ( int  begin1) const

Analogous to Fortran str(x:) syntax.

Parameters
begin1One-based index for the beginning index.
Returns
A new FortranStringView object

◆ operator()() [2/2]

FortranStringView tinker::FortranStringView::operator() ( int  begin1,
int  back1 
) const

Analogous to Fortran str(x:y) syntax.

Parameters
begin1One-based index for the beginning index.
back1One-based index for the inclusive ending index.
Returns
A new FortranStringView object.

◆ operator=() [1/3]

FortranStringView & tinker::FortranStringView::operator= ( const char *  src)

Assigned by a C/C++ style string. Ignores the trailing characters if the source is too long.

◆ operator=() [2/3]

template<size_t Len>
FortranStringView & tinker::FortranStringView::operator= ( const char(&)  src[Len])
inline

Assigned by a C/C++ style string. Ignores the trailing characters if the source is too long.

◆ operator=() [3/3]

FortranStringView & tinker::FortranStringView::operator= ( const std::string &  src)

Assigned by a C/C++ style string. Ignores the trailing characters if the source is too long.

◆ operator==() [1/4]

bool tinker::FortranStringView::operator== ( const char *  src) const

Returns true if two strings are equal.

◆ operator==() [2/4]

template<size_t Len>
bool tinker::FortranStringView::operator== ( const char(&)  src[Len]) const
inline

Returns true if two strings are equal.

◆ operator==() [3/4]

bool tinker::FortranStringView::operator== ( const FortranStringView src) const

Returns true if two strings are equal.

◆ operator==() [4/4]

bool tinker::FortranStringView::operator== ( const std::string &  src) const

Returns true if two strings are equal.

◆ trim()

std::string tinker::FortranStringView::trim ( ) const

Returns a string without the trailing whitespaces.

Typedef Documentation

◆ FstrView

An alias of FortranStringView.