#if !defined( _IOAERROR_H )
#define _IOAERROR_H

#define ThrowIoAError throw IoAError( __FILE__, __LINE__ )

#define ThrowIoAErrorNumber( n ) throw IoAError( __FILE__, __LINE__, n )

class IoAError
{
public:
    IoAError( const char* File, int Line, int Number = 0 ) : m_File( File ), m_Line( Line ), m_Number( Number ) { }
    IoAError( int Number = 0 ) : m_File( NULL ), m_Line( 0 ), m_Number( Number ) { }

    const char *File( ) const { return m_File; }

    int Line( ) const { return m_Line; }

    int Number( ) const { return m_Number; }

    operator int( ) const { return Number( ); }

private:
    const char * m_File;
    int          m_Line;
    int          m_Number;
};

#endif
