ABA_STRING Class Reference

class ABA_STRING implements are very simple class for the representation of character strings. More...

#include <string.h>

Inheritance diagram for ABA_STRING:

ABA_ABACUSROOT List of all members.

Public Member Functions

 ABA_STRING (ABA_GLOBAL *glob, const char *cString="")
 ABA_STRING (ABA_GLOBAL *glob, const char *cString, int index)
 ABA_STRING (const ABA_STRING &rhs)
 ~ABA_STRING ()
 The destructor.
const ABA_STRINGoperator= (const ABA_STRING &rhs)
 The assignment operator makes a copy of the right hand side and reallocates memory if required.
const ABA_STRINGoperator= (const char *rhs)
 The assignment operator is overloaded for character strings.
char & operator[] (int i)
 With the subscript operator a single character of the string can be accessed or modified.
const char & operator[] (int i) const
 The subscript operator is overloaded for constant use.

Friends

int operator== (const ABA_STRING &lhs, const ABA_STRING &rhs)
int operator== (const ABA_STRING &lhs, const char *rhs)
 The comparison operator is overloaded for character strings on the right hand side.
int operator!= (const ABA_STRING &lhs, const ABA_STRING &rhs)
int operator!= (const ABA_STRING &lhs, const char *rhs)
 The not-equal operator is overloaded for character strings on the right hand side.
ostream & operator<< (ostream &out, const ABA_STRING &rhs)

Detailed Description

class ABA_STRING implements are very simple class for the representation of character strings.

Definition at line 45 of file string.h.


Constructor & Destructor Documentation

ABA_STRING::ABA_STRING ( ABA_GLOBAL glob,
const char *  cString = "" 
)

The constructor.

Parameters:
glob A pointer to the corresponding global object.
cString The initializing string, by default the empty string.

ABA_STRING::ABA_STRING ( ABA_GLOBAL glob,
const char *  cString,
int  index 
)

A constructor building a string from a string and an integer.

This constructor is especially useful for building variable or constraint names like { con18}.

Parameters:
glob A pointer to the corresponding global object.
cString The initializing string.
index The integer value appending to the cString (must be less than { MAX}).

ABA_STRING::ABA_STRING ( const ABA_STRING rhs  ) 

The copy constructor.

Parameters:
rhs The string that is copied.

ABA_STRING::~ABA_STRING (  ) 

The destructor.


Member Function Documentation

const ABA_STRING& ABA_STRING::operator= ( const ABA_STRING rhs  ) 

The assignment operator makes a copy of the right hand side and reallocates memory if required.

Returns:
A reference to the object.
Parameters:
rhs The right hand side of the assignment.

const ABA_STRING& ABA_STRING::operator= ( const char *  rhs  ) 

The assignment operator is overloaded for character strings.

char& ABA_STRING::operator[] ( int  i  ) 

With the subscript operator a single character of the string can be accessed or modified.

If the class is compiled with the preprocessor flag -DABACUSSAFE, then a range check is performed.

Returns:
A reference to the i-th character of the string.
Parameters:
i The number of the character that should be accessed or modified. The first character has number 0.

const char& ABA_STRING::operator[] ( int  i  )  const

The subscript operator is overloaded for constant use.


Friends And Related Function Documentation

int operator== ( const ABA_STRING lhs,
const ABA_STRING rhs 
) [friend]

The comparison operator.

Note:
the C-library function strcmp() returns 0 if both strings equal.
Returns:
0 If both strings are not equal,

1 otherwise.

Parameters:
lhs The left hand side of the comparison.
rhs The right hand side of the comparison.

int operator== ( const ABA_STRING lhs,
const char *  rhs 
) [friend]

The comparison operator is overloaded for character strings on the right hand side.

int operator!= ( const ABA_STRING lhs,
const ABA_STRING rhs 
) [friend]

The not-equal operator.

Note:
the C-library function strcmp() returns 0 if both strings equal.
Returns:
0 If both strings are equal,

1 otherwise.

Parameters:
lhs The left hand side of the comparison.
rhs The right hand side of the comparison.

int operator!= ( const ABA_STRING lhs,
const char *  rhs 
) [friend]

The not-equal operator is overloaded for character strings on the right hand side.

ostream& operator<< ( ostream &  out,
const ABA_STRING rhs 
) [friend]

The output operator.

Returns:
A reference to the output stream.
Parameters:
out The output stream.
rhs The string being output.


The documentation for this class was generated from the following file:
Generated on Tue Aug 14 18:09:59 2007 for ABACUS by  doxygen 1.5.1