casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
casacore::SubString Class Reference

SubString help class to be used in at, before,... More...

#include <String.h>

Public Member Functions

 operator const string () const
 Make a string. More...
 
SubStringoperator= (const SubString &str)
 Assignment. More...
 
SubStringoperator= (const String &str)
 
SubStringoperator= (const Char *s)
 
SubStringoperator= (const Char c)
 
const Charchars () const
 Get as (const) C array. More...
 
string::size_type length () const
 Obtain length. More...
 

Private Member Functions

 SubString (const string &str, string::size_type pos, string::size_type len)
 Constructor (there are no public constructors) More...
 

Private Attributes

const string & ref_p
 Referenced string. More...
 
string::size_type pos_p
 Start of sub-string. More...
 
string::size_type len_p
 Length of sub-string. More...
 

Friends

class String
 

Detailed Description

SubString help class to be used in at, before,...

Synopsis

The SubString class can only be used by the String class to be able to operate the Casacore defined replacement operators at, before, after, through, from. The class is used transparently in operations like:

string.at(2,3) = "five";

If the SubString starts at a position outside the length of the original string (like e.g. in after(1000000)), a zero length string is created (not an exception thrown like in standard string operations).

Definition at line 61 of file String.h.

Constructor & Destructor Documentation

casacore::SubString::SubString ( const string &  str,
string::size_type  pos,
string::size_type  len 
)
inlineprivate

Constructor (there are no public constructors)

Definition at line 1014 of file String.h.

Member Function Documentation

const Char * casacore::SubString::chars ( ) const
inline

Get as (const) C array.

Definition at line 1021 of file String.h.

string::size_type casacore::SubString::length ( ) const
inline

Obtain length.

Definition at line 77 of file String.h.

References len_p.

casacore::SubString::operator const string ( ) const
inline

Make a string.

Definition at line 66 of file String.h.

References len_p, pos_p, and ref_p.

SubString& casacore::SubString::operator= ( const SubString str)

Assignment.

SubString& casacore::SubString::operator= ( const String str)
SubString& casacore::SubString::operator= ( const Char s)
SubString& casacore::SubString::operator= ( const Char  c)

Friends And Related Function Documentation

friend class String
friend

Definition at line 64 of file String.h.

Referenced by casacore::String::operator()().

Member Data Documentation

string::size_type casacore::SubString::len_p
private

Length of sub-string.

Definition at line 90 of file String.h.

Referenced by length(), and operator const string().

string::size_type casacore::SubString::pos_p
private

Start of sub-string.

Definition at line 88 of file String.h.

Referenced by operator const string().

const string& casacore::SubString::ref_p
private

Referenced string.

Definition at line 86 of file String.h.

Referenced by operator const string().


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