Exemplo n.º 1
0
        public IAbcConst ImportConst(IAbcConst c)
        {
            var pool = GetConstPool(c.Kind);

            if (pool != null)
            {
                return(pool.Import(c));
            }
            return(null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Determines whether given constant is defined in current ABC file.
        /// </summary>
        /// <param name="c">constant to test</param>
        /// <returns>true if the constant is defined, otherwise - false</returns>
        public bool IsDefined(IAbcConst c)
        {
            if (c == null)
            {
                return(false);
            }
            var pool = GetConstPool(c.Kind);

            if (pool != null)
            {
                return(pool.IsDefined(c));
            }
            return(false);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Determines whether given constant is defined in this pool.
        /// </summary>
        /// <param name="c">constant to check.</param>
        /// <returns>true if defined; otherwise, false</returns>
        public bool IsDefined(IAbcConst c)
        {
            if (c == null)
            {
                return(false);
            }
            int i = c.Index;

            if (i < 0 || i >= Count)
            {
                return(false);
            }
            return(ReferenceEquals(c, this[i]));
        }
Exemplo n.º 4
0
 internal static void CheckConst(IAbcConst c)
 {
     //if (c.Index == 0)
     //    Debugger.Break();
 }
Exemplo n.º 5
0
 IAbcConst IAbcConstPool.Import(IAbcConst c)
 {
     return(Import((T)c));
 }
Exemplo n.º 6
0
 bool IAbcConstPool.IsDefined(IAbcConst c)
 {
     return(IsDefined((T)c));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Imports given constant.
 /// </summary>
 /// <param name="c">constant to import.</param>
 /// <returns>imported constant.</returns>
 public IAbcConst Import(IAbcConst c)
 {
     return(Import((AbcConst <T>)c));
 }