casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes | Friends
casa::SubString Class Reference

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

#include <String.h>

List of all members.

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

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 aips++ 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

casa::SubString::SubString ( const string &  str,
string::size_type  pos,
string::size_type  len 
) [inline, private]

Constructor (there are no public constructors)

Definition at line 986 of file String.h.


Member Function Documentation

const Char * casa::SubString::chars ( ) const [inline]

Get as (const) C array.

Definition at line 993 of file String.h.

string::size_type casa::SubString::length ( ) const [inline]

Obtain length.

Definition at line 77 of file String.h.

References len_p.

casa::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& casa::SubString::operator= ( const SubString str)

Assignment.

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

Friends And Related Function Documentation

friend class String [friend]

Definition at line 64 of file String.h.

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


Member Data Documentation

string::size_type casa::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 casa::SubString::pos_p [private]

Start of sub-string.

Definition at line 88 of file String.h.

Referenced by operator const string().

const string& casa::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: