Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

debuget.h File Reference


Detailed Description

Defines several debugging functions and macros, including ASSERT (and variations).

Author:
ejt (Creator)
Author
alokl
Name
tekkotsu-1_4_1
Revision
1.1.1.1
State
Exp
Date
2002/09/30 18:19:48

Definition in file debuget.h.

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <fstream>

Include dependency graph for debuget.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define ASSERT(b, str)   {if(!(b)) std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl;}
 if the bool b is false, std::cout the string

#define ASSERTRET(b, str)   {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; return; }}
 if the bool b is false, std::cout the string and return

#define ASSERTRETVAL(b, str, v)   {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; return v; }}
 if the bool b is false, std::cout the string and return the value

#define ASSERTFATAL(b, str, x)   {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; exit(x); }}
 if the bool b is false, std::cout the string and exit(x)


Functions

const char * _extractFilename (const char *path)
 for historical reasons - the previous compiler give the entire path for __FILE__, for display, just use the filename

char hexdigit (int c)
 returns the hex char that corresponds to c, which should be 0-16 (returns '.' otherwise)

void charhexout (char c)
 printf's the two hex digits coresponding to a byte

void hexout (const void *p, size_t n)
 charhexout's n bytes starting at p


Define Documentation

#define ASSERT b,
str   )     {if(!(b)) std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl;}
 

if the bool b is false, std::cout the string

Definition at line 19 of file debuget.h.

#define ASSERTFATAL b,
str,
 )     {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; exit(x); }}
 

if the bool b is false, std::cout the string and exit(x)

Definition at line 25 of file debuget.h.

#define ASSERTRET b,
str   )     {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; return; }}
 

if the bool b is false, std::cout the string and return

Definition at line 21 of file debuget.h.

#define ASSERTRETVAL b,
str,
 )     {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; return v; }}
 

if the bool b is false, std::cout the string and return the value

Definition at line 23 of file debuget.h.


Function Documentation

const char* _extractFilename const char *  path  )  [inline]
 

for historical reasons - the previous compiler give the entire path for __FILE__, for display, just use the filename

Definition at line 11 of file debuget.h.

void charhexout char  c  )  [inline]
 

printf's the two hex digits coresponding to a byte

Definition at line 50 of file debuget.h.

References hexdigit().

char hexdigit int  c  )  [inline]
 

returns the hex char that corresponds to c, which should be 0-16 (returns '.' otherwise)

Definition at line 39 of file debuget.h.

void hexout const void *  p,
size_t  n
[inline]
 

charhexout's n bytes starting at p

Definition at line 55 of file debuget.h.

References charhexout().


Tekkotsu v1.4
Generated Sat Jul 19 00:06:58 2003 by Doxygen 1.3.2