|
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 |
|
19 namespace StackLib |
|
20 { |
|
21 public class ParsedDataItem |
|
22 { |
|
23 #region Constructors & destructor |
|
24 public ParsedDataItem( long aAddress, long aReversedData, long aOriginalData, string aCharacterisedData ) |
|
25 { |
|
26 iAddress = aAddress; |
|
27 iData = aReversedData; |
|
28 iOriginalData = aOriginalData; |
|
29 iCharacterisedData = aCharacterisedData; |
|
30 } |
|
31 #endregion |
|
32 |
|
33 #region Properties |
|
34 public long Address |
|
35 { |
|
36 get { return iAddress; } |
|
37 set { iAddress = value; } |
|
38 } |
|
39 |
|
40 public long Data |
|
41 { |
|
42 get { return iData; } |
|
43 set { iData = value; } |
|
44 } |
|
45 |
|
46 public long OriginalData |
|
47 { |
|
48 get { return iOriginalData; } |
|
49 set { iOriginalData = value; } |
|
50 } |
|
51 |
|
52 public string CharacterisedData |
|
53 { |
|
54 get { return iCharacterisedData; } |
|
55 set { iCharacterisedData = value; } |
|
56 } |
|
57 |
|
58 public string OriginalCharacterisedData |
|
59 { |
|
60 get |
|
61 { |
|
62 char[] reversedCharacterisedData = new char[iCharacterisedData.Length]; |
|
63 for (int i = 0; i < iCharacterisedData.Length; i+=4) |
|
64 { |
|
65 string bytes = iCharacterisedData.Substring(i, 4); |
|
66 reversedCharacterisedData[i] = bytes[3]; |
|
67 reversedCharacterisedData[i+1] = bytes[2]; |
|
68 reversedCharacterisedData[i+2] = bytes[1]; |
|
69 reversedCharacterisedData[i+3] = bytes[0]; |
|
70 } |
|
71 // |
|
72 string characterisedData = new string(reversedCharacterisedData); |
|
73 return characterisedData; |
|
74 } |
|
75 } |
|
76 |
|
77 public object Tag |
|
78 { |
|
79 get { return iTag; } |
|
80 set { iTag = value; } |
|
81 } |
|
82 #endregion |
|
83 |
|
84 #region Data members |
|
85 private object iTag; |
|
86 private long iAddress; |
|
87 private long iData; |
|
88 private long iOriginalData; |
|
89 private string iCharacterisedData; |
|
90 #endregion |
|
91 } |
|
92 } |