crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Plugin/DExcPluginImp.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.Text;
       
    19 using System.IO;
       
    20 using System.Collections.Generic;
       
    21 using CrashItemLib.PluginAPI;
       
    22 using DExcPlugin.Descriptor;
       
    23 using DExcPlugin.Reader;
       
    24 
       
    25 namespace DExcPlugin.Plugin
       
    26 {
       
    27 	public class DExcPluginImp : CFFPlugin
       
    28 	{
       
    29 		#region Constructors
       
    30         public DExcPluginImp( CFFDataProvider aDataProvider )
       
    31 		:   base( aDataProvider )
       
    32 		{
       
    33         }
       
    34         #endregion
       
    35 
       
    36         #region From CFFEngine
       
    37         public override CFFSourceAndConfidence GetConfidence( FileInfo aFile, CFFFileList aOtherFiles )
       
    38         {
       
    39             DExcDescriptor ret = new DExcDescriptor( aFile );
       
    40             //
       
    41             if ( ret.Exists )
       
    42             {
       
    43                 string extension = ret.Extension.ToLower();
       
    44                 //
       
    45                 if ( ret.IsTraceExtension )
       
    46                 {
       
    47                     ret.Level = int.MaxValue / 2;
       
    48                     ret.OpType = CFFSource.TReaderOperationType.EReaderOpTypeTrace;
       
    49                 }
       
    50 
       
    51                 // If confidence indicates we can handle the file, then make a reader
       
    52                 if ( ret.OpType != CFFSource.TReaderOperationType.EReaderOpTypeNotSupported )
       
    53                 {
       
    54                     ret.Reader = new DExcReader( this, ret );
       
    55 
       
    56                     // Remove any stack file if present
       
    57                     string stackFile = ret.StackFileName;
       
    58                     if ( ret.StackFileExists )
       
    59                     {
       
    60                         aOtherFiles.Remove( stackFile );
       
    61                     }
       
    62                 }
       
    63             }
       
    64             //
       
    65             return ret;
       
    66         }
       
    67 
       
    68         public override void GetSupportedFileTypes( List<CFFFileSpecification> aFileTypes )
       
    69         {
       
    70             aFileTypes.Add( CFFFileSpecification.TraceFiles() );
       
    71             aFileTypes.Add( CFFFileSpecification.AllFiles() );
       
    72         }
       
    73 
       
    74         public override string Name
       
    75         {
       
    76             get
       
    77             {
       
    78                 return "D_EXC Plugin";
       
    79             }
       
    80         }
       
    81         #endregion
       
    82 
       
    83         #region Internal constants
       
    84         #endregion
       
    85 
       
    86         #region Data members
       
    87 		#endregion
       
    88 	}
       
    89 }