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

LsgError Struct Reference

Error Message. More...

#include <error.h>

Collaboration diagram for LsgError:

Collaboration graph
[legend]

Data Fields

LsgObject super
char * message
char * file
char * method
int line

Related Functions

(Note that these are not member functions.)

LsgErrorLsgError_create (const char *message, const char *file, const char *method, int line)
void LsgError_init (LsgError *self, const char *message, const char *file, const char *method, int line)
char * LsgError_toString (LsgError *self)
void LsgError_destroy (LsgError *self)
int LsgError_count (void)
void LsgError_add (LsgError *error)
void LsgError_addMessage (const char *file, const char *method, int line, const char *message)
void LsgError_addFormat (const char *file, const char *method, int line, const char *format,...)
const LsgErrorLsgError_get (int num)
void LsgError_clear (void)

Detailed Description

Error Message.

Encapsulate an error message and the location where it has been reported.


Friends And Related Function Documentation

LsgError * LsgError_create const char *  message,
const char *  file,
const char *  method,
int  line
[related]
 

Allocate and initialize a new LsgError instance.

Note:
Use the macros __FILE__ and __LINE__ for file and line respectively.
Parameters:
message The error message
file The source file from where the error is reported
method The method reporting the error
line The line of the source file where the error is reported

void LsgError_init LsgError self,
const char *  message,
const char *  file,
const char *  method,
int  line
[related]
 

Constructor for LsgError.

Parameters:
self The instance variable
message The error message
file The source file from where the error is reported
method The method reporting the error
line The line of the source file where the error is reported

char * LsgError_toString LsgError self  )  [related]
 

Convert the error message to a simple string.

Note:
The generated string has to be free'd by the caller.
Parameters:
self The instance variable
Returns:
a newly allocated string containing the complete error message and the location of the error report

void LsgError_destroy LsgError self  )  [related]
 

Destructor for LsgError.

Parameters:
self The instance variable

int LsgError_count void   )  [related]
 

Return the number of error currently stored in the global error list.

Returns:
the number of errors currently stored

void LsgError_add LsgError error  )  [related]
 

Store an error in the global error list.

Parameters:
error The error to store

void LsgError_addMessage const char *  file,
const char *  method,
int  line,
const char *  message
[related]
 

Create and add an error to the global error list.

Parameters:
file The source file from where the error is reported
method The method reporting the error
line The line of the source file where the error is reported
message The error message

void LsgError_addFormat const char *  file,
const char *  method,
int  line,
const char *  format,
... 
[related]
 

Format an error message and add an error to the global error list with.

Parameters:
file The source file from where the error is reported
method The method reporting the error
line The line of the source file where the error is reported
format The error message template

const LsgError * LsgError_get int  num  )  [related]
 

Return an error from the global error list.

Parameters:
num The index of the error in the global error list
Returns:
the error stored at index num in the global error list or NULL if num is greater than or equal to the value returned by LsgError_count

void LsgError_clear void   )  [related]
 

Empty the global error list.


The documentation for this struct was generated from the following file:
(c) 2003, by Enno Cramer
generated on 13 Jul 2003
lescegra - doxygen