crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractedData.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.Text.RegularExpressions;
       
    20 using System.Collections.Generic;
       
    21 using EM=DExcPlugin.ExpressionManager.DExcExpressionManager;
       
    22 
       
    23 namespace DExcPlugin.Extractor
       
    24 {
       
    25 	internal class DExcExtractedData
       
    26 	{
       
    27         #region Constructors
       
    28         public DExcExtractedData()
       
    29 		{
       
    30         }
       
    31 		#endregion
       
    32 
       
    33         #region API
       
    34         public void Add( DExcExtractorList aList )
       
    35         {
       
    36             iLists.Add( aList.Type, aList );
       
    37         }
       
    38         #endregion
       
    39 
       
    40         #region Properties
       
    41         public long LineNumber
       
    42         {
       
    43             get { return iLineNumber; }
       
    44             set { iLineNumber = value; }
       
    45         }
       
    46 
       
    47         public DExcExtractorList this[ DExcExtractorListType aType ]
       
    48         {
       
    49             get
       
    50             {
       
    51                 DExcExtractorList ret = null;
       
    52                 //
       
    53                 if ( iLists.ContainsKey( aType ) )
       
    54                 {
       
    55                     ret = iLists[ aType ];
       
    56                 }
       
    57                 //
       
    58                 return ret;
       
    59             }
       
    60         }
       
    61         #endregion
       
    62 
       
    63         #region From System.Object
       
    64         public override string ToString()
       
    65         {
       
    66             StringBuilder ret = new StringBuilder();
       
    67             //
       
    68             foreach ( KeyValuePair<DExcExtractorListType, DExcExtractorList> kvp in iLists )
       
    69             {
       
    70                 DExcExtractorList list = kvp.Value;
       
    71                 string lines = list.ToString();
       
    72                 if ( lines.Length > 0 )
       
    73                 {
       
    74                     ret.AppendLine( lines );
       
    75                 }
       
    76             }
       
    77             //
       
    78             return ret.ToString();
       
    79         }
       
    80         #endregion
       
    81 
       
    82 		#region Data members
       
    83         private long iLineNumber = 0;
       
    84         private Dictionary<DExcExtractorListType, DExcExtractorList> iLists = new Dictionary<DExcExtractorListType, DExcExtractorList>();
       
    85 		#endregion
       
    86 	}
       
    87 }