|
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.Text.RegularExpressions; |
|
21 using System.Reflection; |
|
22 using SymbianParserLib.Enums; |
|
23 using SymbianParserLib.BaseStructures; |
|
24 |
|
25 namespace SymbianParserLib.Elements.SubFields |
|
26 { |
|
27 internal class ParserFieldFormatSpecifier |
|
28 { |
|
29 #region Constructors |
|
30 public ParserFieldFormatSpecifier( ParserField aField ) |
|
31 { |
|
32 iField = aField; |
|
33 iFieldName.Name = aField.Name; |
|
34 } |
|
35 |
|
36 public ParserFieldFormatSpecifier( ParserField aField, ParserFieldFormatSpecifier aCopy ) |
|
37 : this( aField ) |
|
38 { |
|
39 OriginalLocation = aCopy.OriginalLocation; |
|
40 OriginalLength = aCopy.OriginalLength; |
|
41 RegularExpressionString = aCopy.RegularExpressionString; |
|
42 NumberBase = aCopy.NumberBase; |
|
43 ExpectedType = aCopy.ExpectedType; |
|
44 } |
|
45 #endregion |
|
46 |
|
47 #region API |
|
48 #endregion |
|
49 |
|
50 #region Properties |
|
51 public ParserFieldName Name |
|
52 { |
|
53 get { return iFieldName; } |
|
54 } |
|
55 |
|
56 public int OriginalLocation |
|
57 { |
|
58 get { return iOriginalLocation; } |
|
59 set { iOriginalLocation = value; } |
|
60 } |
|
61 |
|
62 public int OriginalLength |
|
63 { |
|
64 get { return iOriginalLength; } |
|
65 set { iOriginalLength = value; } |
|
66 } |
|
67 |
|
68 public string RegularExpressionString |
|
69 { |
|
70 get { return iRegexString; } |
|
71 set { iRegexString = value; } |
|
72 } |
|
73 |
|
74 public int NumberBase |
|
75 { |
|
76 get { return iNumberBase; } |
|
77 set { iNumberBase = value; } |
|
78 } |
|
79 |
|
80 public Regex RegularExpression |
|
81 { |
|
82 get { return new Regex( iRegexString ); } |
|
83 } |
|
84 |
|
85 public TParserValueType ExpectedType |
|
86 { |
|
87 get { return iExpectedType; } |
|
88 set { iExpectedType = value; } |
|
89 } |
|
90 |
|
91 internal ParserField Field |
|
92 { |
|
93 get { return iField; } |
|
94 } |
|
95 #endregion |
|
96 |
|
97 #region Internal methods |
|
98 #endregion |
|
99 |
|
100 #region Internal constants |
|
101 #endregion |
|
102 |
|
103 #region From System.Object |
|
104 public override string ToString() |
|
105 { |
|
106 return base.ToString(); |
|
107 } |
|
108 #endregion |
|
109 |
|
110 #region Data members |
|
111 private readonly ParserField iField; |
|
112 private ParserFieldName iFieldName = new ParserFieldName(); |
|
113 private int iOriginalLocation = -1; |
|
114 private int iOriginalLength = -1; |
|
115 private string iRegexString = null; |
|
116 private int iNumberBase = 10; |
|
117 private TParserValueType iExpectedType = TParserValueType.EValueTypeByte; |
|
118 #endregion |
|
119 } |
|
120 } |