Exemplo n.º 1
0
        internal ROFSEngine(ITracer aTracer)
            : base(aTracer)
        {
            iEngineMap           = new MapFileEngineCollection(this);
            iEngineMap.Observer += new SymbianUtils.AsyncReaderBase.Observer(MapEngine_Observer);

            iEngineSymbol           = new SymbolFileEngineCollection(this, SymbolFileEngine.TActivationType.EOnDemand, true);
            iEngineSymbol.Observer += new SymbianUtils.AsyncReaderBase.Observer(SymbolEngine_Observer);
        }
Exemplo n.º 2
0
        public static TFileType IsSupported(string aFileName)
        {
            TFileType ret = TFileType.EFileNotSupported;

            //
            try
            {
                string extension = Path.GetExtension(aFileName).ToLower();
                if (extension == ".symbol")
                {
                    bool sawSomeValidContent = false;
                    //
                    SymbolFileEngine tempEngine = new SymbolFileEngine(null, SymbolFileEngine.TActivationType.EOnDemand, true);
                    SymbolsForBinary symbols    = tempEngine.ReadFirstCollection(aFileName, out sawSomeValidContent);

                    // For a valid ROFS symbol file, the first symbol should have an address of zero.
                    bool valid = (symbols != null && symbols.Count > 0 && symbols[0].Address == 0);
                    if (valid)
                    {
                        ret = TFileType.EFileRofsSymbol;
                    }
                    else if (sawSomeValidContent)
                    {
                        // Probably just a file containing data files rather than code, but that's okay.
                        ret = TFileType.EFileRofsSymbol;
                    }
                }
                else if (extension == ".map")
                {
                    ret = MapFileEngineCollection.IsSupported(aFileName);
                }
            }
            catch (Exception)
            {
            }
            //
            return(ret);
        }