crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Symbols/CXmlSymbolSet.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.Collections.Generic;
       
    20 using CrashItemLib.Crash.Base;
       
    21 using CrashItemLib.Crash.Symbols;
       
    22 using SymbianStructuresLib.Debug.Symbols;
       
    23 using CrashXmlPlugin.FileFormat.Node;
       
    24 
       
    25 namespace CrashXmlPlugin.FileFormat.Segment.Entries.Symbols
       
    26 {
       
    27     internal class CXmlSymbolSet : CXmlNode
       
    28 	{
       
    29 		#region Constructors
       
    30         public CXmlSymbolSet( SymbolCollection aCollection )
       
    31             : base( SegConstants.Symbols_SymbolSet )
       
    32 		{
       
    33             iCollection = aCollection;
       
    34 		}
       
    35 		#endregion
       
    36 
       
    37         #region API
       
    38         public void Add( CISymbol aSymbol )
       
    39         {
       
    40             if ( !iSymbols.ContainsKey( aSymbol.Id ) )
       
    41             {
       
    42                 iSymbols.Add( aSymbol.Id, aSymbol );
       
    43             }
       
    44         }
       
    45         #endregion
       
    46 
       
    47         #region From CXmlNode
       
    48         protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters )
       
    49         {
       
    50             aParameters.Writer.WriteElementString( SegConstants.Symbols_SymbolSet_Source, iCollection.FileName.FileNameInHost );
       
    51         }
       
    52 
       
    53         protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters )
       
    54         {
       
    55             foreach ( KeyValuePair<CIElementId, CISymbol> kvp in iSymbols )
       
    56             {
       
    57                 CXmlSymbol xmlSymbol = new CXmlSymbol( kvp.Value );
       
    58                 xmlSymbol.XmlSerialize( aParameters );
       
    59             }
       
    60         }
       
    61         #endregion
       
    62 
       
    63         #region Properties
       
    64         #endregion
       
    65 
       
    66         #region Data members
       
    67         private readonly SymbolCollection iCollection;
       
    68         private Dictionary<CIElementId, CISymbol> iSymbols = new Dictionary<CIElementId, CISymbol>();
       
    69 		#endregion
       
    70 	}
       
    71 }