Table of Contents

Class Radix

Namespace
L5Sharp.Enums
Assembly
L5Sharp.dll

Represents a number base for a given value type or atomic type.

public abstract class Radix : LogixEnum<Radix, string>, IEquatable<LogixEnum<Radix, string>>, IComparable<LogixEnum<Radix, string>>
Inheritance
Radix
Implements
Inherited Members

Fields

Ascii

Represents a Ascii number base format.

public static readonly Radix Ascii

Field Value

Radix

Binary

Represents a Binary number base format.

public static readonly Radix Binary

Field Value

Radix

DateTime

Represents a DateTime number base format.

public static readonly Radix DateTime

Field Value

Radix

DateTimeNs

Represents a DateTimeNs number base format.

public static readonly Radix DateTimeNs

Field Value

Radix

Decimal

Represents a Decimal number base format.

public static readonly Radix Decimal

Field Value

Radix

Exponential

Represents a Exponential number base format.

public static readonly Radix Exponential

Field Value

Radix

Float

Represents a Float number base format.

public static readonly Radix Float

Field Value

Radix

Hex

Represents a Hexadecimal number base format.

public static readonly Radix Hex

Field Value

Radix

Null

Represents a Null radix, or absence of a Radix value.

public static readonly Radix Null

Field Value

Radix

Remarks

Only AtomicType types have non-null Radix. StructureType types all have null Radix.

Octal

Represents a Octal number base format.

public static readonly Radix Octal

Field Value

Radix

Properties

Specifier

The specifier prefix of the Radix string format.

protected abstract string Specifier { get; }

Property Value

string

A string representing the text that identifies the format of the Radix.

Remarks

Most Radix will have a specifier prefix, such as '#2' for Binary, '#16' for Hex, and so on. By default this property is used by HasFormat(string) to determine if an input string has the specified Radix format, and further by Infer(string) to determine a Radix from a string value. However, some Radix options are overriden as they do not have specifiers (e.g. Decimal, Float).

Methods

Default(LogixType)

Gets the default Radix value for the provided logix type.

public static Radix Default(LogixType type)

Parameters

type LogixType

The logix type to evaluate.

Returns

Radix

Null for all non atomic types. Float for REAL types. Decimal for all other atomic types.

Format(AtomicType)

Converts an atomic value to the current radix base format.

public abstract string Format(AtomicType atomic)

Parameters

atomic AtomicType

The current atomic type to convert.

Returns

string

A string that represents the value of the atomic type in the current radix base number style.

HasFormat(string)

Returns an indication as to whether the current string input value has the format of the current Radix type.

protected virtual bool HasFormat(string input)

Parameters

input string

The input text value to examine.

Returns

bool

true if input qualifies as a valid format for the Radix type; otherwise, false.

Infer(string)

Determines the radix format from a string representing a formatted atomic value.

public static Radix Infer(string input)

Parameters

input string

The string for which to infer the format.

Returns

Radix

A Radix format enum value.

Exceptions

FormatException

A radix can not be determined from the format of value.

Parse(string)

Parses a string input of a given Radix formatted value into an atomic value type.

public abstract AtomicType Parse(string input)

Parameters

input string

The string value to parse.

Returns

AtomicType

An AtomicType representing the value of the formatted string.

SupportsType(LogixType)

Determines if the current Radix supports the provided data type instance.

public bool SupportsType(LogixType type)

Parameters

type LogixType

The logix type instance to evaluate.

Returns

bool

true if the current radix value is valid for the given data type instance; otherwise, false.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.