Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FoldXsltConvert()

QilNode System.Xml.Xsl.IlGen.XmlILOptimizerVisitor.FoldXsltConvert ( QilNode ndLiteral,
XmlQueryType typTarget )
inlineprivate

Definition at line 3019 of file XmlILOptimizerVisitor.cs.

3020 {
3021 try
3022 {
3023 if (typTarget.IsAtomicValue)
3024 {
3027 if (typTarget == XmlQueryTypeFactory.StringX)
3028 {
3029 return f.LiteralString(value.Value);
3030 }
3031 if (typTarget == XmlQueryTypeFactory.IntX)
3032 {
3033 return f.LiteralInt32(value.ValueAsInt);
3034 }
3035 if (typTarget == XmlQueryTypeFactory.IntegerX)
3036 {
3037 return f.LiteralInt64(value.ValueAsLong);
3038 }
3039 if (typTarget == XmlQueryTypeFactory.DecimalX)
3040 {
3041 return f.LiteralDecimal((decimal)value.ValueAs(XsltConvert.DecimalType));
3042 }
3043 if (typTarget == XmlQueryTypeFactory.DoubleX)
3044 {
3045 return f.LiteralDouble(value.ValueAsDouble);
3046 }
3047 if (typTarget == XmlQueryTypeFactory.BooleanX)
3048 {
3049 return value.ValueAsBoolean ? f.True() : f.False();
3050 }
3051 }
3052 }
3053 catch (OverflowException)
3054 {
3055 }
3056 catch (FormatException)
3057 {
3058 }
3060 }
QilLiteral LiteralDecimal(decimal value)
QilLiteral LiteralString(string value)
QilLiteral LiteralInt32(int value)
QilLiteral LiteralDouble(double value)
QilLiteral LiteralInt64(long value)
QilTargetType XsltConvert(QilNode expr, XmlQueryType xmlType)
Definition QilFactory.cs:76
static XmlAtomicValue ConvertToType(XmlAtomicValue value, XmlQueryType destinationType)
static readonly Type DecimalType

References System.Xml.Xsl.XmlQueryTypeFactory.BooleanX, System.Xml.Xsl.Runtime.XsltConvert.ConvertToType(), System.Xml.Xsl.Runtime.XsltConvert.DecimalType, System.Xml.Xsl.XmlQueryTypeFactory.DecimalX, System.Xml.Dictionary, System.Xml.Xsl.XmlQueryTypeFactory.DoubleX, System.Xml.Xsl.IlGen.XmlILOptimizerVisitor.ExtractLiteralValue(), System.Xml.Xsl.Qil.QilReplaceVisitor.f, System.Xml.Xsl.Qil.QilFactory.False(), System.Xml.Xsl.XmlQueryTypeFactory.IntegerX, System.Xml.Xsl.XmlQueryTypeFactory.IntX, System.Xml.Xsl.Qil.QilFactory.LiteralDecimal(), System.Xml.Xsl.Qil.QilFactory.LiteralDouble(), System.Xml.Xsl.Qil.QilFactory.LiteralInt32(), System.Xml.Xsl.Qil.QilFactory.LiteralInt64(), System.Xml.Xsl.Qil.QilFactory.LiteralString(), System.Xml.Xsl.XmlQueryTypeFactory.StringX, System.Xml.Xsl.Qil.QilFactory.True(), System.value, and System.Xml.Xsl.Qil.QilFactory.XsltConvert().

Referenced by System.Xml.Xsl.IlGen.XmlILOptimizerVisitor.CanFoldXsltConvert(), System.Xml.Xsl.IlGen.XmlILOptimizerVisitor.CanFoldXsltConvertNonLossy(), System.Xml.Xsl.IlGen.XmlILOptimizerVisitor.VisitEq(), System.Xml.Xsl.IlGen.XmlILOptimizerVisitor.VisitGe(), System.Xml.Xsl.IlGen.XmlILOptimizerVisitor.VisitGt(), System.Xml.Xsl.IlGen.XmlILOptimizerVisitor.VisitLe(), System.Xml.Xsl.IlGen.XmlILOptimizerVisitor.VisitLt(), System.Xml.Xsl.IlGen.XmlILOptimizerVisitor.VisitNe(), and System.Xml.Xsl.IlGen.XmlILOptimizerVisitor.VisitXsltConvert().