Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ExpressionNode.cs
Go to the documentation of this file.
5
6namespace System.Data;
7
8internal abstract class ExpressionNode
9{
11
13 {
14 get
15 {
16 if (_table == null)
17 {
19 }
21 }
22 }
23
24 internal virtual bool IsSqlColumn => false;
25
26 protected DataTable table => _table;
27
29 {
30 _table = table;
31 }
32
33 protected void BindTable(DataTable table)
34 {
35 _table = table;
36 }
37
38 internal abstract void Bind(DataTable table, List<DataColumn> list);
39
40 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
41 internal abstract object Eval();
42
43 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
44 internal abstract object Eval(DataRow row, DataRowVersion version);
45
46 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
47 internal abstract object Eval(int[] recordNos);
48
49 internal abstract bool IsConstant();
50
51 internal abstract bool IsTableConstant();
52
53 internal abstract bool HasLocalAggregate();
54
55 internal abstract bool HasRemoteAggregate();
56
57 internal abstract ExpressionNode Optimize();
58
59 internal virtual bool DependsOn(DataColumn column)
60 {
61 return false;
62 }
63
64 internal static bool IsInteger(StorageType type)
65 {
66 if (type != StorageType.Int16 && type != StorageType.Int32 && type != StorageType.Int64 && type != StorageType.UInt16 && type != StorageType.UInt32 && type != StorageType.UInt64 && type != StorageType.SByte)
67 {
68 return type == StorageType.Byte;
69 }
70 return true;
71 }
72
73 internal static bool IsIntegerSql(StorageType type)
74 {
75 if (type != StorageType.Int16 && type != StorageType.Int32 && type != StorageType.Int64 && type != StorageType.UInt16 && type != StorageType.UInt32 && type != StorageType.UInt64 && type != StorageType.SByte && type != StorageType.Byte && type != StorageType.SqlInt64 && type != StorageType.SqlInt32 && type != StorageType.SqlInt16)
76 {
77 return type == StorageType.SqlByte;
78 }
79 return true;
80 }
81
82 internal static bool IsSigned(StorageType type)
83 {
84 if (type != StorageType.Int16 && type != StorageType.Int32 && type != StorageType.Int64 && type != StorageType.SByte)
85 {
86 return IsFloat(type);
87 }
88 return true;
89 }
90
91 internal static bool IsSignedSql(StorageType type)
92 {
93 if (type != StorageType.Int16 && type != StorageType.Int32 && type != StorageType.Int64 && type != StorageType.SByte && type != StorageType.SqlInt64 && type != StorageType.SqlInt32 && type != StorageType.SqlInt16)
94 {
95 return IsFloatSql(type);
96 }
97 return true;
98 }
99
100 internal static bool IsUnsigned(StorageType type)
101 {
102 if (type != StorageType.UInt16 && type != StorageType.UInt32 && type != StorageType.UInt64)
103 {
104 return type == StorageType.Byte;
105 }
106 return true;
107 }
108
109 internal static bool IsUnsignedSql(StorageType type)
110 {
111 if (type != StorageType.UInt16 && type != StorageType.UInt32 && type != StorageType.UInt64 && type != StorageType.SqlByte)
112 {
113 return type == StorageType.Byte;
114 }
115 return true;
116 }
117
118 internal static bool IsNumeric(StorageType type)
119 {
120 if (!IsFloat(type))
121 {
122 return IsInteger(type);
123 }
124 return true;
125 }
126
127 internal static bool IsNumericSql(StorageType type)
128 {
129 if (!IsFloatSql(type))
130 {
131 return IsIntegerSql(type);
132 }
133 return true;
134 }
135
136 internal static bool IsFloat(StorageType type)
137 {
138 if (type != StorageType.Single && type != StorageType.Double)
139 {
140 return type == StorageType.Decimal;
141 }
142 return true;
143 }
144
145 internal static bool IsFloatSql(StorageType type)
146 {
147 if (type != StorageType.Single && type != StorageType.Double && type != StorageType.Decimal && type != StorageType.SqlDouble && type != StorageType.SqlDecimal && type != StorageType.SqlMoney)
148 {
149 return type == StorageType.SqlSingle;
150 }
151 return true;
152 }
153}
IFormatProvider FormatProvider
Definition DataTable.cs:435
static bool IsInteger(StorageType type)
object Eval(DataRow row, DataRowVersion version)
static bool IsNumericSql(StorageType type)
static bool IsSignedSql(StorageType type)
ExpressionNode(DataTable table)
static bool IsUnsignedSql(StorageType type)
static bool IsSigned(StorageType type)
void Bind(DataTable table, List< DataColumn > list)
static bool IsUnsigned(StorageType type)
void BindTable(DataTable table)
static bool IsIntegerSql(StorageType type)
virtual bool DependsOn(DataColumn column)
static bool IsNumeric(StorageType type)
static bool IsFloatSql(StorageType type)
ExpressionNode Optimize()
object Eval(int[] recordNos)
static bool IsFloat(StorageType type)
static CultureInfo CurrentCulture