crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/Operations/CSROpScanDirectory.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.IO;
       
    19 using System.Threading;
       
    20 using System.Text;
       
    21 using System.Text.RegularExpressions;
       
    22 using System.Collections.Specialized;
       
    23 using System.Collections.Generic;
       
    24 using System.ComponentModel;
       
    25 using SymbianUtils;
       
    26 using SymbianUtils.SerializedOperations;
       
    27 using SymbolLib.Sources.Map.Parser;
       
    28 
       
    29 namespace SymbolLib.CodeSegDef
       
    30 {
       
    31     internal class CSROpScanDirectory : CodeSegResolverOperation
       
    32 	{
       
    33 		#region Constructors
       
    34         public CSROpScanDirectory( CodeSegResolver aResolver, bool aResetResolver, DirectoryInfo aDirectory )
       
    35             : base( aResolver, aResetResolver )
       
    36 		{
       
    37             iDirectory = aDirectory;
       
    38 		}
       
    39 		#endregion
       
    40 
       
    41         #region From CodeSegResolverOperation
       
    42         protected override void Scan()
       
    43         {
       
    44             base.DriveLetter = Path.GetPathRoot( iDirectory.FullName );
       
    45             if ( iDirectory.Exists )
       
    46             {
       
    47                 // Locate all the map files in the directory
       
    48                 FileInfo[] fileInfoList = iDirectory.GetFiles( "*" + CodeSegResolver.KMapFileExtension );
       
    49                 foreach ( FileInfo file in fileInfoList )
       
    50                 {
       
    51                     string pcFileName = file.FullName;
       
    52 
       
    53                     // Remove .map extension in order to get back to the pure binary dll/exe/etc name.
       
    54                     pcFileName = RemoveMapExtension( pcFileName );
       
    55 
       
    56                     // Prepare phone binary name by merging the PC-side filename with Z:\Sys\Bin
       
    57                     string phoneFileName = GeneratePhoneBinaryNameAndPath( pcFileName );
       
    58 
       
    59                     // Make entry
       
    60                     CodeSegResolverEntry entry = new CodeSegResolverEntry( pcFileName, phoneFileName );
       
    61 
       
    62                     base.Add( entry );
       
    63                 }
       
    64             }
       
    65         }
       
    66         #endregion
       
    67 
       
    68         #region API
       
    69         #endregion
       
    70 
       
    71         #region Properties
       
    72         #endregion
       
    73 
       
    74         #region Internal methods
       
    75         #endregion
       
    76         
       
    77         #region Internal constants
       
    78         private const string KRomDriveFileLetter = "Z:\\";
       
    79 		#endregion
       
    80 
       
    81         #region Data members
       
    82         private readonly DirectoryInfo iDirectory;
       
    83 		#endregion
       
    84 	}
       
    85 }