Humble Framework for SkyOS


Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

HDebug Class Reference
[Debugging]

#include <HDebug.h>

Inheritance diagram for HDebug:

HObjNoCopy HObj

Detailed Description

The HDebug class provides the ability to log debug output to a text file. This class is declared very early so that other classes can take advantage of the debugging macros and logger. For that reason, this class should not depend on any other classes, and should be as self-contained as possible.

Definition at line 44 of file HDebug.h.

Public Member Functions

void Close (void)
 Closes the log file.
void Flush (void) const
 Flushes the log file.
void Log (StringPtr pstr) const
 Writes printf()-style text out to a log file.
void LogHex (uint8 const *pData, uint32 uBytes) const
 Writes a hex dump of binary data to the log file.
void LogMsg (StringPtr pstrClass, HANDLE hWnd, const s_gi_msg *pMsg) const
 Writes out a s_gi_msg structure to a log file.
void LogV (StringPtr pstr,...) const
 Writes printf()-style text out to a log file.
bool Open (StringPtr pstrLogFile)
 Opens the log file.
bool IsOpen (void) const
 Evaluates to true if the file is open.

Static Public Member Functions

static void Check (bool bPassed, StringPtr pstrTest, StringPtr pstrFile, uint32 uLine)
 Checks a value and requires user's approval to continue.
static HDebugGetLog (void)
 Returns a static HDebug object.

Protected Attributes

FILE * m_pfLog
 Ptr to stdio output file.


Member Function Documentation

static void HDebug::Check bool  bPassed,
StringPtr  pstrTest,
StringPtr  pstrFile,
uint32  uLine
[static]
 

Parameters:
bPassed True if check passed, false otherwise
pstrTest Ptr to string describing the test
pstrFile Ptr to source file (__FILE__)
uLine Source line number (__LINE__)

Definition at line 76 of file HDebug.h.

void HDebug::Log StringPtr  pstr  )  const
 

Writes a line of text out to the log file, which is flushed after every write so that buffered information isn't lost if the application crashes unexpectedly. (Is there any other kind of crash?)

Parameters:
pstr Message text with optional printf-style arguments

Definition at line 125 of file HDebug.h.

void HDebug::LogHex uint8 const *  pData,
uint32  uBytes
const
 

Writes out a sequence of bytes to the log file in the format 0x0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Only the first Kb is dumped, even if the byte count exceeds 1KB.

Parameters:
pData Ptr to data
uBytes Count of bytes

Definition at line 155 of file HDebug.h.

void HDebug::LogMsg StringPtr  pstrClass,
HANDLE  hWnd,
const s_gi_msg *  pMsg
const
 

Writes out an s_gi_msg structure to the log file for debugging purposes. Some messages are suppressed to avoid unecessary log entries, and a few key messages—such as MSG_COMMAND—include parameter information as well.

Parameters:
pstrClass window class (defined in the BEGIN_MSG_MAP macro
hWnd handle to the window that recieved the message
pMsg pointer to the s_gi_msg structure

Definition at line 186 of file HDebug.h.

void HDebug::LogV StringPtr  pstr,
  ...
const
 

Writes a line of text out to the log file, which is flushed after every write so that buffered information isn't lost if the application crashes unexpectedly. (Is there any other kind of crash?)

Parameters:
pstr Message text with optional printf-style arguments

Definition at line 334 of file HDebug.h.

bool HDebug::Open StringPtr  pstrLogFile  ) 
 

This method attempts to open the requested log file for output, deleting any existing content.

Returns:
TRUE on success, FALSE otherwise
Parameters:
pstrLogFile Fully qualified name of log file

Definition at line 359 of file HDebug.h.

static HDebug& HDebug::GetLog void   )  [static]
 

Returns:
Reference to object

Definition at line 375 of file HDebug.h.

bool HDebug::IsOpen void   )  const
 

Returns:
True if log is open for writing, false otherwise

Definition at line 385 of file HDebug.h.


The documentation for this class was generated from the following file:
 

2006.01.09-16:37