crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SourceManagement/Provisioning/SymSourceProvider.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2004-2008 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 
       
    18 using System;
       
    19 using System.Collections.Generic;
       
    20 using System.Text;
       
    21 using System.IO;
       
    22 using SymbianUtils;
       
    23 using SymbianUtils.Tracer;
       
    24 using SymbianUtils.FileTypes;
       
    25 using SymbianStructuresLib.Debug.Common.Id;
       
    26 using SymbianStructuresLib.Debug.Common.Interfaces;
       
    27 using SymbianSymbolLib.DbgEnginePlugin;
       
    28 using SymbianSymbolLib.SourceManagement.Source;
       
    29 
       
    30 namespace SymbianSymbolLib.SourceManagement.Provisioning
       
    31 {
       
    32     // <summary>
       
    33     // A source provider is an entity that understands how to read a certain
       
    34     // format of file that contains symbolic information.
       
    35     // 
       
    36     // The provider's purpose is to read a specified source and transform it
       
    37     // into generic symbol data.
       
    38     // </summary>
       
    39     public abstract class SymSourceProvider
       
    40     {
       
    41         #region Constructors
       
    42         protected SymSourceProvider( SymSourceProviderManager aManager )
       
    43         {
       
    44             iManager = aManager;
       
    45         }
       
    46         #endregion
       
    47 
       
    48         #region Framework API
       
    49         public virtual bool IsSupported( string aFileName )
       
    50         {
       
    51             SymFileTypeList fileTypes = FileTypes;
       
    52             string extension = Path.GetExtension( aFileName );
       
    53             //
       
    54             bool ret = fileTypes.IsSupported( extension );
       
    55             return ret;
       
    56         }
       
    57 
       
    58         public virtual SymSourceCollection CreateSources( string aName )
       
    59         {
       
    60             throw new NotSupportedException( "Support not implemented by " + this.GetType().ToString() );
       
    61         }
       
    62 
       
    63         public virtual void ReadSource( SymSource aSource, TSynchronicity aSynchronicity )
       
    64         {
       
    65             throw new NotSupportedException();
       
    66         }
       
    67 
       
    68         public abstract SymFileTypeList FileTypes
       
    69         {
       
    70             get;
       
    71         }
       
    72 
       
    73         public abstract string Name
       
    74         {
       
    75             get;
       
    76         }
       
    77 
       
    78         public virtual string GetFileName( SymSource aSource )
       
    79         {
       
    80             string ret = aSource.URI;
       
    81             return ret;
       
    82         }
       
    83 
       
    84         public virtual void PrepareToCreateSources()
       
    85         {
       
    86         }
       
    87         #endregion
       
    88 
       
    89         #region Properties
       
    90         public ITracer Tracer
       
    91         {
       
    92             get { return iManager; }
       
    93         }
       
    94 
       
    95         public IPlatformIdAllocator IdAllocator
       
    96         {
       
    97             get { return iManager.IdAllocator; }
       
    98         }
       
    99 
       
   100         protected SymSourceProviderManager ProvisioningManager
       
   101         {
       
   102             get { return iManager; }
       
   103         }
       
   104         #endregion
       
   105 
       
   106         #region Data members
       
   107         private readonly SymSourceProviderManager iManager;
       
   108         #endregion
       
   109     }
       
   110 }