Exemplo n.º 1
0
 private static unsafe long ParseNthWeekDay(CronField field, ref char *pointer, int dayOfWeek, ref CronExpressionFlag flags, out byte nthDayOfWeek)
 {
     nthDayOfWeek = (byte)ParseNumber(field, ref pointer, MinNthDayOfWeek, MaxNthDayOfWeek);
     flags       |= CronExpressionFlag.NthDayOfWeek;
     return(GetBit(dayOfWeek));
 }
Exemplo n.º 2
0
        private static StringBuilder AppendFieldValue(StringBuilder expressionBuilder, CronField field, long fieldValue)
        {
            if (field.AllBits == fieldValue)
            {
                return(expressionBuilder.Append('*'));
            }

            // Unset 7 bit for Day of week field because both 0 and 7 stand for Sunday.
            if (field == CronField.DaysOfWeek)
            {
                fieldValue &= ~(1 << field.Last);
            }

            for (var i = GetFirstSet(fieldValue);; i = GetFirstSet(fieldValue >> i << i))
            {
                expressionBuilder.Append(i);
                if (fieldValue >> ++i == 0)
                {
                    break;
                }
                expressionBuilder.Append(',');
            }

            return(expressionBuilder);
        }
Exemplo n.º 3
0
 private static unsafe long ParseStar(CronField field, ref char *pointer)
 {
     return(Accept(ref pointer, '/')
         ? ParseStep(field, ref pointer, field.First, field.Last)
         : field.AllBits);
 }
Exemplo n.º 4
0
 internal CronFormatException(CronField field, string message) : this($"{field}: {message}")
 {
 }