Recurity.Swf.AVM2.ABC.AbcFile.VerifyNameIndex C# (CSharp) Method

VerifyNameIndex() public method

Checks if a name can be found at specific position in the constant pool.
public VerifyNameIndex ( uint nindex ) : bool
nindex uint The constant pool index
return bool
        public bool VerifyNameIndex(uint nindex)
        {
            string testname;
            try
            {
                testname = this.ConstantPool.Strings[(int)nindex];
            }
            catch (IndexOutOfRangeException)
            {
                Log.Error(this, "Constant pool index is out of range.");
                return false;
            }

            if (!AbcFile.IsValidIdentifier(testname))
            {
                Log.Error(this, "\"" + testname + "\" is not valid identifier");
                return false;
            }

            return true;
        }

Usage Example

 /// <summary>
 /// 
 /// </summary>
 /// <param name="abc"></param>
 public void Verify( AbcFile abc )
 {
     if ( ( !abc.VerifyNameIndex( _Key ) ) || ( !abc.VerifyNameIndex( _Value ) ) )
     {
         AbcVerifierException ave = new AbcVerifierException( "Invalid Key/Value pair: " + _Key.ToString( "d" ) + "/" + _Value.ToString( "d" ) );
        Log.Error(this,  ave );
         throw ave;
     }
 }
All Usage Examples Of Recurity.Swf.AVM2.ABC.AbcFile::VerifyNameIndex