|
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.Collections.Generic; |
|
19 using System.Text; |
|
20 using System.IO; |
|
21 using SymbianUtils; |
|
22 using SymbianUtils.Tracer; |
|
23 using SymbianUtils.Streams; |
|
24 using SymbianStructuresLib.Compression.Common; |
|
25 using SymbianImageLib.Common.Image; |
|
26 using SymbianImageLib.Common.Header; |
|
27 using SymbianImageLib.Common.Streams; |
|
28 using SymbianImageLib.ROM.Content; |
|
29 using SymbianImageLib.ROM.Header; |
|
30 using SymbianImageLib.ROM.Structures; |
|
31 |
|
32 namespace SymbianImageLib.ROM.Image |
|
33 { |
|
34 public class SIROM : SIImage |
|
35 { |
|
36 #region Constructors |
|
37 public SIROM( ITracer aTracer, Stream aStream, string aName ) |
|
38 : base( aTracer, new SIStream( aStream ), aName ) |
|
39 { |
|
40 base.Trace( "[SymbianImageROM] Ctor() - START" ); |
|
41 |
|
42 // Read the header and set base class relocation address |
|
43 iHeader = new SIHeaderROM( this, aStream ); |
|
44 |
|
45 // We treat ourselves as one giant blob |
|
46 SIContentROM file = new SIContentROM( this ); |
|
47 base.RegisterFile( file ); |
|
48 |
|
49 base.Trace( "[SymbianImageROM] Ctor() - END" ); |
|
50 } |
|
51 #endregion |
|
52 |
|
53 #region API |
|
54 public static bool IsROM( Stream aStream ) |
|
55 { |
|
56 bool ret = false; |
|
57 // |
|
58 try |
|
59 { |
|
60 ret = SIHeaderROM.IsROM( aStream ); |
|
61 } |
|
62 catch ( Exception ) |
|
63 { |
|
64 } |
|
65 // |
|
66 return ret; |
|
67 } |
|
68 #endregion |
|
69 |
|
70 #region From SIImage |
|
71 public override SIHeader Header |
|
72 { |
|
73 get { return iHeader; } |
|
74 } |
|
75 #endregion |
|
76 |
|
77 #region Internal methods |
|
78 #endregion |
|
79 |
|
80 #region Data members |
|
81 private readonly SIHeaderROM iHeader; |
|
82 #endregion |
|
83 } |
|
84 } |