/// <summary>
///
/// </summary>
/// <param name="abc"></param>
public void Verify( AbcFile abc )
{
//
// _Name must be a multiname of type QName
// _Supername must be a multiname
// _ProtectedNs if _FlagClassProtectedNs must point to namespace
// _Interface is multiname index
// _Iinit is index into method array
//
if ( !abc.VerifyMultinameIndex( _Name ) )
{
AbcVerifierException ave = new AbcVerifierException( "Invalid Name: " + _Name.ToString( "d" ) );
Log.Error(this, ave );
throw ave;
}
if ( abc.ConstantPool.Multinames[ (int)_Name ].Type != MultinameType.QName )
{
AbcVerifierException ave = new AbcVerifierException( "Name: " + _Name.ToString( "d" ) + " is not of type QName" );
Log.Error(this, ave );
throw ave;
}
if ( _FlagClassProtectedNs )
{
if ( !abc.VerifyMultinameIndex( _ProtectedNs ) )
{
AbcVerifierException ave = new AbcVerifierException( "Invalid ProtectedNs: " + _ProtectedNs.ToString( "d" ) );
Log.Error(this, ave );
throw ave;
}
}
if ( !abc.VerifyMultinameIndex( _Supername ) )
{
AbcVerifierException ave = new AbcVerifierException( "Invalid SuperName: " + _Supername.ToString( "d" ) );
Log.Error(this, ave );
throw ave;
}
for ( int i = 0; i < _Interface.Count; i++ )
{
if ( !abc.VerifyMultinameIndex( _Interface[i] ) )
{
AbcVerifierException ave = new AbcVerifierException( "Invalid interface: " + _Interface[i].ToString( "d" ) );
Log.Error(this, ave );
throw ave;
}
if ( 0 == _Interface[ i ] )
{
AbcVerifierException ave = new AbcVerifierException( "Invalid interface, being 0" );
Log.Error(this, ave );
throw ave;
}
}
if ( _Iinit >= abc.Methods.Count )
{
AbcVerifierException ave = new AbcVerifierException( "Iinit does not point into method array: " + _Iinit.ToString( "d" ) );
Log.Error(this, ave );
throw ave;
}
foreach ( Traits_info ti in _Trait )
{
ti.Verify( abc );
}
}