|
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.IO; |
|
20 using System.Collections; |
|
21 using System.Collections.Generic; |
|
22 using CrashItemLib.Crash; |
|
23 using CrashItemLib.Crash.Base; |
|
24 using CrashItemLib.Crash.Container; |
|
25 |
|
26 namespace CrashItemLib.Crash.Source |
|
27 { |
|
28 public class CISourceElement : CIElement, IEnumerable<FileInfo> |
|
29 { |
|
30 #region Constructors |
|
31 public CISourceElement( CIContainer aContainer, CISource aSource ) |
|
32 : base( aContainer ) |
|
33 { |
|
34 iSource = aSource; |
|
35 } |
|
36 #endregion |
|
37 |
|
38 #region API |
|
39 public void InputDataClear() |
|
40 { |
|
41 iInputData.Clear(); |
|
42 } |
|
43 |
|
44 public void InputDataAdd( byte[] aRawData ) |
|
45 { |
|
46 iInputData.AddRange( aRawData ); |
|
47 } |
|
48 #endregion |
|
49 |
|
50 #region Properties |
|
51 public byte[] InputData |
|
52 { |
|
53 get { return iInputData.ToArray(); } |
|
54 } |
|
55 |
|
56 public string MasterFileName |
|
57 { |
|
58 get { return iSource.MasterFileName; } |
|
59 } |
|
60 |
|
61 public FileInfo[] AllFiles |
|
62 { |
|
63 get { return iSource.AllFiles; } |
|
64 } |
|
65 |
|
66 public bool IsLineNumberAvailable |
|
67 { |
|
68 get { return iSource.IsLineNumberAvailable; } |
|
69 } |
|
70 |
|
71 public long LineNumber |
|
72 { |
|
73 get { return iSource.LineNumber; } |
|
74 } |
|
75 #endregion |
|
76 |
|
77 #region Operators |
|
78 public static implicit operator CISource( CISourceElement aSource ) |
|
79 { |
|
80 return aSource.iSource; |
|
81 } |
|
82 #endregion |
|
83 |
|
84 #region From IEnumerable<FileInfo> |
|
85 public new IEnumerator<FileInfo> GetEnumerator() |
|
86 { |
|
87 return iSource.GetEnumerator(); |
|
88 } |
|
89 |
|
90 IEnumerator IEnumerable.GetEnumerator() |
|
91 { |
|
92 return iSource.GetEnumerator(); |
|
93 } |
|
94 #endregion |
|
95 |
|
96 #region Data members |
|
97 private readonly CISource iSource; |
|
98 private List<byte> iInputData = new List<byte>(); |
|
99 #endregion |
|
100 } |
|
101 } |