Rosetta  2019.07
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Types | Private Member Functions | Friends | List of all members
ObjexxFCL::Fsubstring Class Reference

Fsubstring: Fixed-Length Fortran-Compatible Substring. More...

#include <Fstring.hh>

Inheritance diagram for ObjexxFCL::Fsubstring:
Inheritance graph
[legend]

Public Member Functions

 Fsubstring (Fsubstring const &s)
 Copy Constructor. More...
 
virtual ~Fsubstring ()
 Destructor. More...
 
Fsubstringoperator= (Fsubstring const &s)
 Copy Assignment. More...
 
Fsubstringoperator= (Fstring const &s)
 = Fstring More...
 
Fsubstringoperator= (std::string const &s)
 = string More...
 
Fsubstringoperator= (c_cstring const s)
 = cstring More...
 
Fsubstringoperator= (char const c)
 = char More...
 
Fstringref ()
 Reference to Fstring: Can Pass s( i, j ).ref() to an Fstring& Argument. More...
 
- Public Member Functions inherited from ObjexxFCL::Fstring
 Fstring ()
 Default Constructor. More...
 
 Fstring (Fstring const &s)
 Copy Constructor. More...
 
 Fstring (std::string const &s)
 string Constructor More...
 
 Fstring (c_cstring const s)
 cstring Constructor More...
 
 Fstring (char const c)
 char Constructor More...
 
 Fstring (signed char const c)
 signed char Constructor More...
 
 Fstring (unsigned char const c)
 unsigned char Constructor More...
 
 Fstring (short int const len_a)
 Length Constructor. More...
 
 Fstring (int const len_a)
 Length Constructor. More...
 
 Fstring (long int const len_a)
 Length Constructor. More...
 
 Fstring (unsigned short int const len_a)
 Length Constructor. More...
 
 Fstring (unsigned int const len_a)
 Length Constructor. More...
 
 Fstring (unsigned long int const len_a)
 Length Constructor. More...
 
 Fstring (unsigned long long const len_a)
 Length Constructor. More...
 
 Fstring (size_type const len_a, Fstring const &s)
 Length + Fstring Constructor. More...
 
 Fstring (size_type const len_a, std::string const &s)
 Length + string Constructor. More...
 
 Fstring (size_type const len_a, c_cstring const s)
 Length + cstring Constructor. More...
 
 Fstring (size_type const len_a, char const c)
 Length + char Constructor. More...
 
 Fstring (size_type const len_a, initializer_function init)
 Length + Initializer Constructor. More...
 
virtual ~Fstring ()
 Destructor. More...
 
 operator std::string () const
 string Conversion More...
 
Fstringoperator= (Fstring const &s)
 Copy Assignment. More...
 
Fstringoperator= (std::string const &s)
 = string More...
 
Fstringoperator= (c_cstring const s)
 = cstring More...
 
Fstringoperator= (char const c)
 = char More...
 
char operator[] (size_type const i) const
 Constant char: s[ i ]. More...
 
char & operator[] (size_type const i)
 char: s[ i ] More...
 
bool empty () const
 Empty? More...
 
bool is_blank () const
 Blank? More...
 
bool not_blank () const
 Not blank? More...
 
bool is_whitespace () const
 Whitespace? More...
 
bool not_whitespace () const
 Not whitespace? More...
 
bool has (Fstring const &s) const
 Has an Fstring? More...
 
bool has (std::string const &s) const
 Has a string? More...
 
bool has (c_cstring const s) const
 Has a cstring? More...
 
bool has (char const c) const
 Has a Character? More...
 
bool has_any_of (Fstring const &s) const
 Has Any Character of an Fstring? More...
 
bool has_any_of (std::string const &s) const
 Has Any Character of a string? More...
 
bool has_any_of (c_cstring const s) const
 Has Any Character of a cstring? More...
 
bool has_any_of (char const c) const
 Has a Character? More...
 
bool has_prefix (Fstring const &s, bool const exact_case=true) const
 Has a Prefix Case-Optionally? More...
 
bool has_prefix (c_cstring const s, bool const exact_case=true) const
 Has a Prefix Case-Optionally? More...
 
template<typename T >
bool is_type () const
 Fstring is Readable as a Type Supporting Stream Input? More...
 
bool is_bool () const
 Fstring is Readable as a bool? More...
 
bool is_short () const
 Fstring is Readable as a short int? More...
 
bool is_int () const
 Fstring is Readable as an int? More...
 
bool is_long () const
 Fstring is Readable as a long int? More...
 
bool is_ushort () const
 Fstring is Readable as a unsigned short int? More...
 
bool is_uint () const
 Fstring is Readable as an unsigned int? More...
 
bool is_ulong () const
 Fstring is Readable as a unsigned long int? More...
 
bool is_float () const
 Fstring is Readable as a float? More...
 
bool is_double () const
 Fstring is Readable as a double? More...
 
bool is_longdouble () const
 Fstring is Readable as a long double? More...
 
bool is_char () const
 Fstring is Readable as a char? More...
 
bool is_string () const
 Fstring is Readable as a string? More...
 
size_type size () const
 Size. More...
 
size_type length () const
 Length. More...
 
size_type len () const
 Length. More...
 
size_type len_trim () const
 Length Space-Trimmed. More...
 
size_type len_trim_whitespace () const
 Length Whitespace-Trimmed. More...
 
size_type find_whitespace () const
 Find First Occurrence of a Whitespace Character. More...
 
size_type find_non_whitespace () const
 Find First Occurrence of a Non-Whitespace Character. More...
 
size_type find_last_whitespace () const
 Find Last Occurrence of a Whitespace Character. More...
 
size_type find_last_non_whitespace () const
 Find Last Occurrence of a Non-Whitespace Character. More...
 
size_type trimmed_whitespace_range (size_type &b, size_type &e) const
 Get Range of Whitespace-Trimmed Portion and Return its Length. More...
 
size_type find (Fstring const &s) const
 Find First Occurrence of an Fstring. More...
 
size_type find (std::string const &s) const
 Find First Occurrence of a string. More...
 
size_type find (c_cstring const s) const
 Find First Occurrence of a cstring. More...
 
size_type find (char const c) const
 Find First Occurrence of a Character. More...
 
size_type find_last (Fstring const &s) const
 Find Last Occurrence of an Fstring. More...
 
size_type find_last (std::string const &s) const
 Find Last Occurrence of a string. More...
 
size_type find_last (c_cstring const s) const
 Find Last Occurrence of a cstring. More...
 
size_type find_last (char const c) const
 Find Last Occurrence of a Character. More...
 
size_type find_first_of (Fstring const &s) const
 Find First Occurrence of Any Character of an Fstring. More...
 
size_type find_first_of (std::string const &s) const
 Find First Occurrence of Any Character of a string. More...
 
size_type find_first_of (c_cstring const s) const
 Find First Occurrence of Any Character of a cstring. More...
 
size_type find_first_of (char const c) const
 Find First Occurrence of a Character. More...
 
size_type find_first_not_of (Fstring const &s) const
 Find First Occurrence of Any Character not of an Fstring. More...
 
size_type find_first_not_of (std::string const &s) const
 Find First Occurrence of Any Character not of a string. More...
 
size_type find_first_not_of (c_cstring const s) const
 Find First Occurrence of Any Character not of a cstring. More...
 
size_type find_first_not_of (char const c) const
 Find First Occurrence of not a Character. More...
 
size_type find_last_of (Fstring const &s) const
 Find Last Occurrence of Any Character of an Fstring. More...
 
size_type find_last_of (std::string const &s) const
 Find Last Occurrence of Any Character of a string. More...
 
size_type find_last_of (c_cstring const s) const
 Find Last Occurrence of Any Character of a cstring. More...
 
size_type find_last_of (char const c) const
 Find Last Occurrence of a Character. More...
 
size_type find_last_not_of (Fstring const &s) const
 Find Last Occurrence of Any Character not of an Fstring. More...
 
size_type find_last_not_of (std::string const &s) const
 Find Last Occurrence of Any Character not of a string. More...
 
size_type find_last_not_of (c_cstring const s) const
 Find Last Occurrence of Any Character not of a cstring. More...
 
size_type find_last_not_of (char const c) const
 Find Last Occurrence not of a Character. More...
 
template<typename T >
T type_of () const
 Type of an Fstring for Type Supporting Stream Input. More...
 
short int short_of () const
 short int of the Fstring More...
 
int int_of () const
 int of the Fstring More...
 
long int long_of () const
 long int of the Fstring More...
 
unsigned short int ushort_of () const
 unsigned short int of the Fstring More...
 
unsigned int uint_of () const
 unsigned int of the Fstring More...
 
unsigned long int ulong_of () const
 unsigned long int of the Fstring More...
 
float float_of () const
 float of the Fstring More...
 
double double_of () const
 double of the Fstring More...
 
long double longdouble_of () const
 long double of the Fstring More...
 
char char_of () const
 char of the Fstring More...
 
std::string string_of () const
 string of the Fstring More...
 
Fstringlowercase ()
 Lowercase. More...
 
Fstringuppercase ()
 Uppercase. More...
 
Fstringleft_justify ()
 Left Justify. More...
 
Fstringright_justify ()
 Right Justify. More...
 
Fstringcenter ()
 Center. More...
 
Fstringcompress ()
 Compress Out Whitespace. More...
 
Fstringtrim ()
 Trim Trailing Space. More...
 
Fstringtrim_whitespace ()
 Trim Trailing Whitespace Replacing it with Space. More...
 
Fstringstrip (std::string const &chars)
 Strip Specified Characters from an Fstring's Tails. More...
 
Fstringlstrip (std::string const &chars)
 Strip Specified Characters from an Fstring's Left Tail. More...
 
Fstringrstrip (std::string const &chars)
 Strip Specified Characters from an Fstring's Right Tail. More...
 
Fstringstrip ()
 Strip Space from an Fstring's Tails. More...
 
Fstringlstrip ()
 Strip Space from an Fstring's Left Tail. More...
 
Fstringrstrip ()
 Strip Space from an Fstring's Right Tail. More...
 
Fstringstrip_whitespace ()
 Strip Whitespace from an Fstring's Tails. More...
 
Fstringlstrip_whitespace ()
 Strip Whitespace from an Fstring's Left Tail. More...
 
Fstringrstrip_whitespace ()
 Strip Whitespace from an Fstring's Right Tail. More...
 
Fstringclear ()
 Clear. More...
 
Fstringoverlay (Fstring const &s, size_type const pos=1)
 Overlay an Fstring. More...
 
Fstringoverlay (std::string const &s, size_type const pos=1)
 Overlay a string. More...
 
Fstringoverlay (c_cstring const s, size_type const pos=1)
 Overlay a cstring. More...
 
Fstring left_justified () const
 Left-Justified Copy. More...
 
Fstring right_justified () const
 Right-Justified Copy. More...
 
Fstring centered () const
 Centered Copy. More...
 
Fstring compressed () const
 Compressed Copy. More...
 
Fstring lowercased () const
 Lowercased Copy. More...
 
Fstring uppercased () const
 Uppercased Copy. More...
 
Fstring trimmed () const
 Trailing Space Trimmed Copy. More...
 
Fstring trimmed_whitespace () const
 Trailing Whitespace Trimmed Copy. More...
 
Fstring stripped (std::string const &chars) const
 Specified Characters Stripped from Tails Copy. More...
 
Fstring lstripped (std::string const &chars) const
 Specified Characters Stripped from Left Tail Copy. More...
 
Fstring rstripped (std::string const &chars) const
 Specified Characters Stripped from Right Tail Copy. More...
 
Fstring stripped () const
 Space Stripped from Tails Copy. More...
 
Fstring lstripped () const
 Space Stripped from Left Tail Copy. More...
 
Fstring rstripped () const
 Space Stripped from Right Tail Copy. More...
 
Fstring stripped_whitespace () const
 Whitespace Stripped from Tails Copy. More...
 
Fstring lstripped_whitespace () const
 Whitespace Stripped from Left Tail Copy. More...
 
Fstring rstripped_whitespace () const
 Whitespace Stripped from Right Tail Copy. More...
 
c_cstring c_str () const
 Null-Terminated cstring Copy of the Fstring that is Owned by the Fstring. More...
 
c_cstring t_str () const
 Whitespace-Trimmed Null-Terminated cstring Copy of the Fstring that is Owned by the Fstring. More...
 
c_cstring data () const
 Non-Null-Terminated cstring Copy of the Fstring Data. More...
 
size_type copy (cstring str, size_type const len_a, size_type const off=0) const
 Copy to a Pre-Allocated String. More...
 
bool equal (Fstring const &s, Fstring const &t, bool const exact_case=true)
 Fstring == Fstring Case-Optionally? More...
 
bool equal (Fstring const &s, char const c, bool const exact_case=true)
 Fstring == char Case-Optionally? More...
 
bool equal (char const c, Fstring const &s, bool const exact_case=true)
 char == Fstring Case-Optionally? More...
 
Fsubstring const operator() (size_type const i, size_type const j) const
 Constant Substring: s( i, j ) More...
 
Fsubstring operator() (size_type const i, size_type const j)
 Substring: s( i, j ) More...
 
Fstring const operator() (size_type const i) const
 Constant Tail Substring: s( i ) More...
 
Fsubstring operator() (size_type const i)
 Tail Substring: s( i ) More...
 
Fsubstring const head () const
 Space-Free Head Constant Substring. More...
 
Fsubstring head ()
 Space-Free Head Substring. More...
 
Fsubstring tail ()
 Space Tail Substring. More...
 
Fsubstring const tail () const
 Space Tail Constant Substring. More...
 
template<>
bool is_type () const
 Fstring is Readable as a char Supporting Stream Input? More...
 
template<>
char type_of () const
 char of an Fstring More...
 

Private Types

typedef Fstring Super
 

Private Member Functions

 Fsubstring (Fstring const &s, size_type const i, size_type const j)
 Fstring Range Constructor. More...
 
 Fsubstring (Fstring const &s, size_type const i)
 Fstring Tail Constructor. More...
 

Friends

class Fstring
 

Additional Inherited Members

- Public Types inherited from ObjexxFCL::Fstring
typedef std::size_t size_type
 
typedef void(* initializer_function )(Fstring &)
 
typedef std::size_t Size
 
typedef void(* InitializerFunction )(Fstring &)
 
- Protected Member Functions inherited from ObjexxFCL::Fstring
 Fstring (Fstring const &s, size_type const i, size_type const j)
 Substring Range Constructor. More...
 
 Fstring (Fstring const &s, size_type const i)
 Substring Tail Constructor. More...
 

Detailed Description

Fsubstring: Fixed-Length Fortran-Compatible Substring.

Remarks
  • Subscripts run from 1 to the length
  • Space-padding is used in comparisons and assignments
  • Internal string rep is not null-terminated
  • Zero-length Fsubstrings are supported but cannot be indexed into (no valid indices)
  • Fsubstring not for explicit use in client code: Client code uses Fstring::operator () to get substrings
  • Pass s( i, j ).ref() to a non-const Fstring& argument
  • Don't return a substring of a local as an Fsubstring since its copy ctor uses ref semantics: Return as an Fstring to get a copy

Member Typedef Documentation

Constructor & Destructor Documentation

ObjexxFCL::Fsubstring::Fsubstring ( Fsubstring const &  s)
inline

Copy Constructor.

virtual ObjexxFCL::Fsubstring::~Fsubstring ( )
inlinevirtual

Destructor.

ObjexxFCL::Fsubstring::Fsubstring ( Fstring const &  s,
size_type const  i,
size_type const  j 
)
inlineprivate

Fstring Range Constructor.

ObjexxFCL::Fsubstring::Fsubstring ( Fstring const &  s,
size_type const  i 
)
inlineprivate

Fstring Tail Constructor.

Member Function Documentation

Fsubstring & ObjexxFCL::Fsubstring::operator= ( Fsubstring const &  s)
Fsubstring & ObjexxFCL::Fsubstring::operator= ( Fstring const &  s)
Fsubstring & ObjexxFCL::Fsubstring::operator= ( std::string const &  s)
Fsubstring & ObjexxFCL::Fsubstring::operator= ( c_cstring const  s)
Fsubstring & ObjexxFCL::Fsubstring::operator= ( char const  c)
Fstring& ObjexxFCL::Fsubstring::ref ( )
inline

Reference to Fstring: Can Pass s( i, j ).ref() to an Fstring& Argument.

Friends And Related Function Documentation

friend class Fstring
friend

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