Example #1
0
            internal static long Parse(String src, String fmt)
            {
                Context ctx = tls;

                if (null == ctx)
                {
                    ctx = tls = new Context();
                }

                Debug.Assert(fmt != null);
                ParsedValue value = new ParsedValue();

                value.ResetDt();
                int end = Parse(src, ref value,
                                fmt == ctx.LastDtFmtStr
                                                ? ctx.LastDtTemplate
                                                : ctx.DateTimeParser.GetTemplate(fmt, ctx.DtTemplateCache));

                return(value.GetDt());
            }
Example #2
0
            internal static long Parse(String src, String fmt)
            {
                Context ctx = tls;

                if (null == ctx)
                {
                    ctx = tls = new Context();
                }

                Debug.Assert(fmt != null);
                ParsedValue value = new ParsedValue();

                value.ResetTs();                 // TODO: Remove
                int end = Parse(src, ref value,
                                fmt == ctx.LastTsFmtStr
                                                ? ctx.LastTsTemplate
                                                : ctx.TimeSpanParser.GetTemplate(fmt, ctx.TsTemplateCache));

                return(value.GetTs());
            }
Example #3
0
 public override int Parse(String from, int ofs, ref ParsedValue dst)
 {
     return(Read.Component(from, ofs, length, ref dst, scale));
 }
Example #4
0
 protected static int Parse(String from, ref ParsedValue value, Template t)
 {
     return(t.Parse(from, 0, ref value));
 }
Example #5
0
 public override int Parse(String from, int ofs, ref ParsedValue dst)
 {
     dst.day = Read.DecimalFixed(from, ofs, ofs + 2);
     return(ofs + 2);
 }
Example #6
0
 public override int Parse(String from, int ofs, ref ParsedValue dst)
 {
     // TODO: Range check
     return(Read.Component(from, ofs, 2, ref dst, Convert.NanosInSecond));
 }
Example #7
0
 public override int Parse(String from, int ofs, ref ParsedValue dst)
 {
     // TODO: Rangecheck for length > 5
     return(Read.Component(from, ofs, length, ref dst, Convert.NanosInDay));
 }
Example #8
0
 public override int Parse(String from, int ofs, ref ParsedValue dst)
 {
     dst.x += Convert.NanosInDay * Read.DecimalFixed(from, ofs, ofs + 2);
     return(ofs + 2);
 }
Example #9
0
 public override int Parse(String from, int ofs, ref ParsedValue dst)
 {
     return(Read.Sign(from, ofs, ref dst));
 }
Example #10
0
 public override int Parse(String from, int ofs, ref ParsedValue dst)
 {
     throw new InvalidOperationException(str);
 }
Example #11
0
 public abstract int Parse(String from, int ofs, ref ParsedValue dst);