Hosting courtesy of Sourceforge

SourceForge Logo
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Util Namespace Reference

An assortment of fairly general functions and classes. More...


Compounds

class  Util::GeneralException
class  Util::Matrix

Functions

template<class T> void operator>> (std::istream &instream, Matrix< T > &mat)
template<class T> T min (const T &a, const T &b)
template<class T> ListOpResult safeIteratorRemove (list< T > &l, list< T >::iterator &i)
template<class T> ListOpResult safeIteratorSwap (list< T > &src, list< T > &dst, list< T >::iterator &i)
template<class container> void freeDynamicContainer (container &c)
string getNextIdentifier (istream &input, set< char > &terminatingSet)
void makeLowercase (string &str)
template<class T> std::string toString (const T &val)
void eraseSpaces (string &str)


Enumeration Type Documentation

enum Util::ListOpResult
 

Enumeration values:
LIST_END 
LIST_MIDDLE 

Definition at line 9 of file STL_Helper.h.


Function Documentation

void Util::eraseSpaces string &    str
 

Removes all spaces from a string

Definition at line 45 of file StringUtil.cpp.

template<class container>
void Util::freeDynamicContainer container &    c
 

Deletes all values of an STL style container of pointers, and clears the container

Definition at line 55 of file STL_Helper.h.

string Util::getNextIdentifier istream &    input,
set< char > &    terminatingSet
 

Function used in parsing an input stream.
Accumulates characters to a string from an istream until characters in the terminating set are found, or until end of input.
If a terminating char is read, the char is put back into the input, so caller can find what char caused the termination

Parameters:
input  the input stream to be read from
terminatingSet  set containing chars that terminate the reading
Returns:
the data in input before the terminating char, not including the terminating char

Definition at line 22 of file StringUtil.cpp.

void Util::makeLowercase string &    str
 

Replaces all upper case characters in string with lowercase characters

Definition at line 39 of file StringUtil.cpp.

template<class T>
T Util::min const T &    a,
const T &    b
 

Returns minimum of any two objects with < overloaded

Definition at line 37 of file STL_Helper.h.

template<class T>
void Util::operator>> std::istream &    instream,
Matrix< T > &    mat
 

Reads a space delimited input stream of mat.numRows() * mat.numCols() of T. Requires that T has operator>> (std::istream, T&) overloaded

Definition at line 98 of file Matrix.h.

template<class T>
ListOpResult Util::safeIteratorRemove list< T > &    l,
list< T >::iterator &    i
 

Removes (does NOT delete) the object pointed by an iterator from a list, increments iterator after removal

Parameters:
l  list from which to remove the object from
i  iterator to list l that points to object to be removed. i is valid iterator after this call
Returns:
LIST_END iff i == l.end() after removal, else LIST_MIDDLE

Definition at line 42 of file STL_Helper.h.

template<class T>
ListOpResult Util::safeIteratorSwap list< T > &    src,
list< T > &    dst,
list< T >::iterator &    i
 

Parameters:
src  list from which to remove i from
dst  list from which to add the value pointed by i the back of
i  iterator from list src, will be incremented after removal, so that i is valid iterator after this call
Returns:
LIST_END iff i == src.end(), else LIST_MIDDLE

Definition at line 50 of file STL_Helper.h.

template<class T>
std::string toString const T &    val
 

Converts any type T to string if it has operator<< (std::ostream&, const T&) defined

Definition at line 52 of file StringUtil.h.


Generated on Tue May 21 07:26:58 2002 for BomberLAN by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001