<?php

namespace Stimulsoft\Report\Enums;

class StiVariableType
{
    const String = 'String';
    const Boolean = 'Boolean';
    const Byte = 'Byte';
    const ByteArray = 'Byte[]';
    const Char = 'Char';
    const DateTime = 'DateTime';
    const DateTimeOffset = 'DateTimeOffset';
    const TimeSpan = 'TimeSpan';
    const Decimal = 'Decimal';
    const Double = 'Double';
    const Guid = 'Guid';
    const Int = 'Int';
    const Int16 = 'Int16';
    const Short = 'Short';
    const Int32 = 'Int32';
    const Int64 = 'Int64';
    const Long = 'Long';
    const Object = 'Object';
    const SByte = 'SByte';
    const Single = 'Single';
    const UInt16 = 'UInt16';
    const UShort = 'UShort';
    const UInt = 'UInt';
    const UInt32 = 'UInt32';
    const UInt64 = 'UInt64';
    const ULong = 'ULong';
    const Image = 'Image';

    const ByteRange = 'ByteRange';
    const CharRange = 'CharRange';
    const DateTimeRange = 'DateTimeRange';
    const DecimalRange = 'DecimalRange';
    const DoubleRange = 'DoubleRange';
    const FloatRange = 'FloatRange';
    const GuidRange = 'GuidRange';
    const IntRange = 'IntRange';
    const LongRange = 'LongRange';
    const ShortRange = 'ShortRange';
    const StringRange = 'StringRange';
    const TimeSpanRange = 'TimeSpanRange';

    const BoolList = 'BoolList';
    const ByteList = 'ByteList';
    const CharList = 'CharList';
    const DateTimeList = 'DateTimeList';
    const DecimalList = 'DecimalList';
    const DoubleList = 'DoubleList';
    const FloatList = 'FloatList';
    const GuidList = 'GuidList';
    const IntList = 'IntList';
    const LongList = 'LongList';
    const ShortList = 'ShortList';
    const StringList = 'StringList';
    const TimeSpanList = 'TimeSpanList';


### Helpers

    public static function isRange($type): bool
    {
        return $type !== null && strlen($type) > 5 && substr($type, -5) === 'Range';
    }

    public static function isList($type): bool
    {
        return $type !== null && strlen($type) > 4 && substr($type, -4) === 'List';
    }
}