|
1 |
|
2 /* |
|
3 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 * All rights reserved. |
|
5 * This component and the accompanying materials are made available |
|
6 * under the terms of "Eclipse Public License v1.0" |
|
7 * which accompanies this distribution, and is available |
|
8 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 * |
|
10 * Initial Contributors: |
|
11 * Nokia Corporation - initial contribution. |
|
12 * |
|
13 * Contributors: |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 using System; |
|
19 using System.Collections.Generic; |
|
20 using System.Text; |
|
21 using System.IO; |
|
22 using SymbianUtils.Tracer; |
|
23 using SymbianUtils.Streams; |
|
24 using SymbianStructuresLib.Uids; |
|
25 using SymbianImageLib.E32Image.Image; |
|
26 using SymbianImageLib.Common.Image; |
|
27 using SymbianImageLib.Common.Streams; |
|
28 using SymbianImageLib.Common.Content; |
|
29 using SymbianImageLib.ROFS.Image; |
|
30 |
|
31 namespace SymbianImageLib.ROFS.Content |
|
32 { |
|
33 internal static class SIContentFactoryROFS |
|
34 { |
|
35 public static SIContent New( SIROFS aImage, string aName, uint aSize, long aPosition, TCheckedUid aUids ) |
|
36 { |
|
37 SIContent ret = null; |
|
38 // |
|
39 bool isImage = SymbianImageE32.IsImageFile( (Stream) aImage.Stream, aPosition ); |
|
40 if ( !isImage ) |
|
41 { |
|
42 // We create either a code file (binary) or data file depending on the type of file at the specified location. |
|
43 ret = new SIContentROFSData( aImage, aName, aSize, aPosition, aUids ); |
|
44 } |
|
45 else |
|
46 { |
|
47 ret = new SIContentROFSCode( aImage, aName, aSize, aPosition ); |
|
48 } |
|
49 // |
|
50 return ret; |
|
51 } |
|
52 } |
|
53 } |