crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/Entity/SymbolEntity.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 using System;
       
    18 using System.Collections.Generic;
       
    19 using System.Text;
       
    20 using System.IO;
       
    21 using System.Drawing;
       
    22 using SymbianUtils;
       
    23 using SymbianUtils.Settings;
       
    24 using SymbianUtils.FileSystem;
       
    25 using SymbianDebugLib.Entity;
       
    26 using SymbianDebugLib.Engine;
       
    27 using SymbianDebugLib.Entity.Descriptors;
       
    28 using SymbianDebugLib.PluginAPI;
       
    29 using SymbianDebugLib.PluginAPI.Types;
       
    30 using SymbianDebugLib.PluginAPI.Types.Symbol;
       
    31 using DbgEntSymbol.Descriptor;
       
    32 
       
    33 namespace DbgEntSymbol.Entity
       
    34 {
       
    35     public class SymbolEntity : DbgEntity
       
    36     {
       
    37         #region Static constructors
       
    38         public static SymbolEntity New( DbgEntityDescriptor aDescriptor, FSEntity aFSEntity )
       
    39         {
       
    40             SymbolEntity ret = null;
       
    41 
       
    42             // Validate that it's a supported file
       
    43             if ( aFSEntity.Exists && aFSEntity.IsFile )
       
    44             {
       
    45                 string type = string.Empty;
       
    46                 DbgEngine engine = aDescriptor.Engine;
       
    47                 DbgEngineSymbol symbolEngine = engine.Symbols;
       
    48                 bool supported = symbolEngine.IsSupported( aFSEntity.FullName, out type );
       
    49                 //
       
    50                 if ( supported )
       
    51                 {
       
    52                     ret = new SymbolEntity( aDescriptor, aFSEntity );
       
    53                 }
       
    54             }
       
    55             //
       
    56             return ret;
       
    57         }
       
    58 
       
    59         public static SymbolEntity New( DbgEntityDescriptor aDescriptor, XmlSettingCategory aSettingsCategory )
       
    60         {
       
    61             SymbolEntity ret = null;
       
    62             //
       
    63             if ( aSettingsCategory.Contains( KSettingsKeyFileName ) )
       
    64             {
       
    65                 string fileName = aSettingsCategory[ KSettingsKeyFileName ];
       
    66                 ret = New( aDescriptor, FSEntity.New( fileName ) );
       
    67             }
       
    68             //
       
    69             return ret;
       
    70         }
       
    71         #endregion
       
    72 
       
    73         #region Constants
       
    74         public const string KSettingsKeyFileName = "SymbolFileName";
       
    75         #endregion
       
    76 
       
    77         #region Constructors
       
    78         private SymbolEntity( DbgEntityDescriptor aDescriptor, FSEntity aFSEntity )
       
    79             : base( aDescriptor, aFSEntity )
       
    80         {
       
    81         }
       
    82         #endregion
       
    83 
       
    84         #region From DbgEntity
       
    85         public override void Save( XmlSettingCategory aCategory )
       
    86         {
       
    87             aCategory[ KSettingsKeyFileName ] = base.FSEntity.FullName;
       
    88         }
       
    89 
       
    90         public override DbgPluginEngine PluginEngine
       
    91         {
       
    92             get { return base.Engine.Symbols; }
       
    93         }
       
    94         #endregion
       
    95 
       
    96         #region Properties
       
    97         #endregion
       
    98 
       
    99         #region Internal methods
       
   100         #endregion
       
   101 
       
   102         #region Data members
       
   103         #endregion
       
   104     }
       
   105 }