#pragma once

#using <mscorlib.dll>
#include "error.h"


namespace p4dn {

    enum ErrorSeverity {
        Empty,
        Info,
        Warning,
        Failed,
        Fatal
    };

    __gc public class Error
    {

    public:

        Error( void );
        ~Error( void );

        void Clear();

        bool Test();
        bool IsInfo();
        bool IsWarning();
        bool IsFatal();
        
        System::String* Fmt();

        __property p4dn::ErrorSeverity get_Severity() {
             return static_cast< p4dn::ErrorSeverity >( _err->GetSeverity() );
        }

    private:          
        ::Error* _err;
        bool _requiresFree;

    public private:        
        Error( ::Error* e ) : _err(e) { 
            _requiresFree = false;
        }
        __property ::Error* get_InternalError() {
            return _err;
        }
    };

} // end namespace
