Loading...
Searching...
No Matches
casacore::SubString Class Reference
casa package (libcasa_casa) » BasicSL_module

More...

`#include <String.h>`

## Public Member Functions

| operator const string () const
| Make a string.
| SubString (const SubString &)=default
| Default copy constructor.
SubString & | operator= (const SubString &str)
| Assignment.
SubString & | operator= (const String &str)
SubString & | operator= (const Char *s)
SubString & | operator= (const Char c)
const Char * | chars () 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 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 59 of file String.h.

## Constructor & Destructor Documentation

## SubString() [1/2]

casacore::SubString::SubString | ( | const SubString & |  | ) |

default

Default copy constructor.

References SubString().

Referenced by operator=(), operator=(), operator=(), operator=(), and SubString().

## SubString() [2/2]

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

inline private

Constructor (there are no public constructors).

Definition at line 1013 of file String.h.

References len_p, length(), pos_p, and ref_p.

## Member Function Documentation

## chars()

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

inline

Get as (const) C array.

Definition at line 1020 of file String.h.

References String.

## length()

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

inline

Obtain length.

Definition at line 77 of file String.h.

References len_p.

Referenced by SubString().

## operator const string()

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

inline

Make a string.

Definition at line 64 of file String.h.

References len_p, pos_p, and ref_p.

## operator=() [1/4]

SubString & casacore::SubString::operator= | ( | const Char * | s | ) |

References SubString().

## operator=() [2/4]

SubString & casacore::SubString::operator= | ( | const Char | c | ) |

References SubString().

## operator=() [3/4]

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

References String, and SubString().

## operator=() [4/4]

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

Assignment.

References SubString().

## Friends And Related Symbol Documentation

## String

friend class String

friend

Definition at line 62 of file String.h.

References String.

Referenced by chars(), operator=(), and String.

## Member Data Documentation

## len_p

string::size_type casacore::SubString::len_p

private

Length of sub-string.

Definition at line 90 of file String.h.

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

## pos_p

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(), and SubString().

## ref_p

const string& casacore::SubString::ref_p

private

Referenced string.

Definition at line 86 of file String.h.

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

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

- casa/BasicSL/String.h