Miscellaneous Tools

Located in stechec/misc directory.There is Coordinates, a tiny Point class, that should be useful everywhere... More...

Classes

class  Coordinates
 Handy class to describe a coordinates.It is just a point, with a set of methods that makes it useful. More...
class  Exception
class  TPoint< T >
 Handy class to describe a point in x-y coordinates, for GUIs.Conversion from/to Coordinates and Position are made implicit, to avoid mistake. More...
class  Position
 Handy class to describe a position.It is just a point, with a set of methods that makes it useful. More...
class  Rect
 A rectangle class.Warning: w and h should _never_ be negative. More...
struct  Deleter
struct  ArrayDeleter
class  Timer
 Implement a passive timer, with time accuracy in seconds.You have to start, stop, restart, and check the remaining time yourself. The timer can be paused, then re-started. More...

Files

file  ExceptionDefine.hh
 

Add few macro helpers for Exception.

This file is included after logger, but before the rest of the world.


Typedefs

typedef std::deque< CoordinatesCoordList
typedef CoordList::const_iterator CoordIter
typedef TPoint< int > Point
typedef TPoint< double > DPoint
typedef std::deque< PositionPosList
typedef PosList::const_iterator PosIter

Functions

std::string trim (const std::string &s)
 Remove white spaces and tabulations from the beginning and the end of the string.
void trimAll (std::string &s)
 Remove all white spaces from the string.
void toLower (std::string &s)
 Convert all characters to lower if possible.
template<typename Collection , typename Function >
Function for_all (Collection &c, const Function &f)
 Implements std::for_each with less typing.



#define THROW(Excpt, Msg)
#define PRINT_AND_THROW(Excpt, Msg)

Detailed Description

Located in stechec/misc directory.

There is Coordinates, a tiny Point class, that should be useful everywhere...


Define Documentation

#define PRINT_AND_THROW ( Excpt,
Msg   ) 
Value:
do {                                            \
  std::ostringstream os;                        \
  os << Msg;                                    \
  Excpt e(os.rdbuf()->str());                   \
  ERR("Throwing " #Excpt ": %1", e.what());     \
  throw e;                                      \
} while (0)
#define THROW ( Excpt,
Msg   ) 
Value:
do {                                            \
  std::ostringstream os;                        \
  os << Msg;                                    \
  throw Excpt(os.rdbuf()->str());               \
} while (0)

Function Documentation

void toLower ( std::string &  s  )  [inline]

Convert all characters to lower if possible.

Parameters:
s String to lower.
std::string trim ( const std::string &  s  )  [inline]

Remove white spaces and tabulations from the beginning and the end of the string.

Parameters:
s String to trim.

Referenced by ConsoleInput::processCommand().

void trimAll ( std::string &  s  )  [inline]

Remove all white spaces from the string.

Parameters:
s String to trim.
Generated on Mon Apr 5 21:17:25 2010 for Stechec/TBT by  doxygen 1.6.3