Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Chars Class Reference

Chars is a char* which knows its length, wrapped up as a user class. More...

#include <Chars.h>

Inheritance diagram for Chars::

ObjectOf Margin List of all members.

Public Methods

 Chars ()
 Gives empty string.

 Chars (const char *s)
 Creates a string from 's'.

 Chars (const char c)
 Creates a string from 'c'.

 Chars (int num)
 Creates an empty string of length 'num'.

int length () const
 Returns length of the string.

bool operator== (const char *s) const
 Returns true if the string is equal to 's', false otherwise.

Chars operator+ (const Chars &) const
 Returns a concatenation of *this with a string.

Chars operator+ (const char *) const
 Returns a concatenation of *this with a string.

Chars operator+ (char) const
 Returns concatenation of *this with a character.

Chars& operator+= (const Chars &)
 Concatenate a string.

Chars& operator+= (const char *)
 Concatenate a string.

Chars& operator+= (char)
 Concatenate a character.

 operator const char * () const
 Convertion operator.

char operator[] (int i) const
 Returns the i'th character in the string.

char& operator[] (int i)
 Returns a reference to the i'th character in the string.


Friends

int operator== (const Chars &l, const Chars &r)
 Returns true if two strings are equal, false otherwise.

int operator!= (const Chars &l, const Chars &r)
 Returns false if two strings are equal.

int operator!= (const Chars &l, const char *r)
 Returns false if two strings are equal.

ostream& operator<< (ostream &ostr, const Chars &C)
 Output string.

istream& operator>> (istream &istr, Chars &C)
 This reads a whitespace-delimited string which cannot be longer than 2^15.

ostream& operator< (ostream &ostr, const Chars &c)
 IPC tools:.

istream& operator> (istream &istr, Chars &c)
 IPC tools:.


Detailed Description

Chars is a char* which knows its length, wrapped up as a user class.

Definition at line 143 of file Chars.h.


Constructor & Destructor Documentation

Chars::Chars ( ) [inline]
 

Gives empty string.

Definition at line 155 of file Chars.h.

Chars::Chars ( const char * s ) [inline]
 

Creates a string from 's'.

Definition at line 158 of file Chars.h.

Chars::Chars ( const char c ) [inline]
 

Creates a string from 'c'.

Definition at line 161 of file Chars.h.

Chars::Chars ( int num ) [inline]
 

Creates an empty string of length 'num'.

Definition at line 164 of file Chars.h.


Member Function Documentation

int Chars::length ( ) const [inline]
 

Returns length of the string.

Definition at line 175 of file Chars.h.

Referenced by WhiteheadExperiment::WhiteheadExperiment(), and File::setColor().

bool Chars::operator== ( const char * s ) const [inline]
 

Returns true if the string is equal to 's', false otherwise.

Definition at line 191 of file Chars.h.

Chars Chars::operator+ ( const Chars & ) const
 

Returns a concatenation of *this with a string.

Chars Chars::operator+ ( const char * ) const
 

Returns a concatenation of *this with a string.

Chars Chars::operator+ ( char ) const
 

Returns concatenation of *this with a character.

Chars & Chars::operator+= ( const Chars & )
 

Concatenate a string.

Chars & Chars::operator+= ( const char * )
 

Concatenate a string.

Chars & Chars::operator+= ( char )
 

Concatenate a character.

Chars::operator const char * ( ) const [inline]
 

Convertion operator.

Definition at line 225 of file Chars.h.

char Chars::operator[] ( int i ) const [inline]
 

Returns the i'th character in the string.

Definition at line 228 of file Chars.h.

char & Chars::operator[] ( int i ) [inline]
 

Returns a reference to the i'th character in the string.

Definition at line 231 of file Chars.h.


Friends And Related Function Documentation

int operator== ( const Chars & l,
const Chars & r ) [friend]
 

Returns true if two strings are equal, false otherwise.

Definition at line 186 of file Chars.h.

int operator!= ( const Chars & l,
const Chars & r ) [friend]
 

Returns false if two strings are equal.

Definition at line 196 of file Chars.h.

int operator!= ( const Chars & l,
const char * r ) [friend]
 

Returns false if two strings are equal.

Definition at line 201 of file Chars.h.

ostream & operator<< ( ostream & ostr,
const Chars & C ) [friend]
 

Output string.

Definition at line 234 of file Chars.h.

istream & operator>> ( istream & istr,
Chars & C ) [friend]
 

This reads a whitespace-delimited string which cannot be longer than 2^15.

Definition at line 240 of file Chars.h.

ostream & operator< ( ostream & ostr,
const Chars & c ) [friend]
 

IPC tools:.

Definition at line 253 of file Chars.h.

istream & operator> ( istream & istr,
Chars & c ) [friend]
 

IPC tools:.

Definition at line 260 of file Chars.h.


The documentation for this class was generated from the following file:
Generated at Tue Jun 19 09:49:48 2001 for Magnus Classes by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001