Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

ID3_Error Class Reference

When id3lib encounters a nasty error, it thros an exception of type ID3_Error. More...

#include <error.h>

List of all members.

Public Methods

ID3_Err GetErrorID () const
 Returns the ID3_Err value, which represents the ID of the error that caused the exception. More...

const char * GetErrorType () const
 Returns the English string that defines the error type. More...

const char * GetErrorDesc () const
 Returns a string that gives more explanation as to what caused the exception, if enabled by the code that caused the exception. More...

const char * GetErrorFile () const
 Returns a pointer to a string of characters that is the name of the id3lib source file that generated the exception. More...

size_t GetErrorLine () const
 Returns the line number in the id3lib source file that threw the exception. More...

 ID3_Error ()
 ID3_Error (ID3_Err, const char *, size_t, const char *)
 Constructor. More...

 ID3_Error (const ID3_Error &)
 ~ID3_Error ()


Detailed Description

When id3lib encounters a nasty error, it thros an exception of type ID3_Error.

A function that calls an id3lib routine can place the call in a try block and provide an appropriate catch block.

 try
 {
   // call some id3lib routine
   ID3_Tag myTag("mySong.mp3");
   ID3_Frame *myFrame = NULL;
   
   // this will generate an exception
   myTag << myFrame;
 }
 catch (ID3_Error err)
 {
   // handle the error
   ...
 }


Constructor & Destructor Documentation

ID3_Error::ID3_Error [inline]
 

ID3_Error::ID3_Error ID3_Err eCode,
const char * sFileName,
size_t nLine,
const char * sDesc
 

Constructor.

Parameters:
eID   Erroy id
sFileName   Filename where error occurred
nLineNum   Linenumber where error occurred
sDescription   Description of error

ID3_Error::ID3_Error const ID3_Error & Error
 

ID3_Error::~ID3_Error
 


Member Function Documentation

const char * ID3_Error::GetErrorDesc const
 

Returns a string that gives more explanation as to what caused the exception, if enabled by the code that caused the exception.

const char * ID3_Error::GetErrorFile const
 

Returns a pointer to a string of characters that is the name of the id3lib source file that generated the exception.

When submitting bug reports, it is useful to include the following.

 cout << "Exception in file '" << err.GetErrorFile() << "'" << endl;

ID3_Err ID3_Error::GetErrorID const
 

Returns the ID3_Err value, which represents the ID of the error that caused the exception.

size_t ID3_Error::GetErrorLine const
 

Returns the line number in the id3lib source file that threw the exception.

cout << "Line #" << err.GetErrorLine() << endl;

const char * ID3_Error::GetErrorType const
 

Returns the English string that defines the error type.

Each error ID has a set string error type.


The documentation for this class was generated from the following files:
Generated at Wed Sep 5 16:53:38 2001 for id3lib by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001