Menu - Top - Home - Donate to Me

PeterO.Cbor.CBORTypeFilter

PeterO.Cbor.CBORTypeFilter

public sealed class CBORTypeFilter

Deprecated. May be removed without replacement.

Specifies what kinds of CBOR objects a tag can be. This class is used when a CBOR object is being read from a data stream. This class can't be inherited; this is a change in version 2.0 from previous versions, where the class was inadvertently left inheritable.

Member Summary

Any

public static readonly PeterO.Cbor.CBORTypeFilter Any;

A filter that allows any CBOR object.

ByteString

public static readonly PeterO.Cbor.CBORTypeFilter ByteString;

A filter that allows byte strings.

NegativeInteger

public static readonly PeterO.Cbor.CBORTypeFilter NegativeInteger;

A filter that allows negative integers.

None

public static readonly PeterO.Cbor.CBORTypeFilter None;

A filter that allows no CBOR types.

TextString

public static readonly PeterO.Cbor.CBORTypeFilter TextString;

A filter that allows text strings.

UnsignedInteger

public static readonly PeterO.Cbor.CBORTypeFilter UnsignedInteger;

A filter that allows unsigned integers.

ArrayIndexAllowed

public bool ArrayIndexAllowed(
    int index);

Determines whether this type filter allows CBOR arrays and the given array index is allowed under this type filter.

Parameters:

Return Value:

true if this type filter allows CBOR arrays and the given array index is allowed under this type filter; otherwise, false .

ArrayLengthMatches

public bool ArrayLengthMatches(
    int length);

Returns whether an array's length is allowed under this filter.

Parameters:

Return Value:

true if this filter allows CBOR arrays and an array's length is allowed under this filter; otherwise, false .

ArrayLengthMatches

public bool ArrayLengthMatches(
    long length);

Returns whether an array's length is allowed under a filter.

Parameters:

Return Value:

true if this filter allows CBOR arrays and an array's length is allowed under a filter; otherwise, false .

ArrayLengthMatches

public bool ArrayLengthMatches(
    PeterO.Numbers.EInteger bigLength);

Returns whether an array's length is allowed under a filter.

Parameters:

Return Value:

true if this filter allows CBOR arrays and an array's length is allowed under a filter; otherwise, false .

Exceptions:

GetSubFilter

public PeterO.Cbor.CBORTypeFilter GetSubFilter(
    int index);

Gets the type filter for this array filter by its index.

Parameters:

Return Value:

Returns None if the index is out of range, or Any if this filter doesn't filter an array. Returns the appropriate filter for the array index otherwise.

GetSubFilter

public PeterO.Cbor.CBORTypeFilter GetSubFilter(
    long index);

Gets the type filter for this array filter by its index.

Parameters:

Return Value:

Returns None if the index is out of range, or Any if this filter doesn't filter an array. Returns the appropriate filter for the array index otherwise.

MajorTypeMatches

public bool MajorTypeMatches(
    int type);

Returns whether the given CBOR major type matches a major type allowed by this filter.

Parameters:

Return Value:

true if the given CBOR major type matches a major type allowed by this filter; otherwise, false .

NonFPSimpleValueAllowed

public bool NonFPSimpleValueAllowed();

Returns whether this filter allows simple values that are not floating-point numbers.

Return Value:

true if this filter allows simple values that are not floating-point numbers; otherwise, false .

TagAllowed

public bool TagAllowed(
    int tag);

Gets a value indicating whether CBOR objects can have the given tag number.

Parameters:

Return Value:

true if CBOR objects can have the given tag number; otherwise, false .

TagAllowed

public bool TagAllowed(
    long longTag);

Gets a value indicating whether CBOR objects can have the given tag number.

Parameters:

Return Value:

true if CBOR objects can have the given tag number; otherwise, false .

TagAllowed

public bool TagAllowed(
    PeterO.Numbers.EInteger bigTag);

Gets a value indicating whether CBOR objects can have the given tag number.

Parameters:

Return Value:

true if CBOR objects can have the given tag number; otherwise, false .

Exceptions:

WithArrayAnyLength

public PeterO.Cbor.CBORTypeFilter WithArrayAnyLength();

Copies this filter and includes arrays of any length in the new filter.

Return Value:

A CBORTypeFilter object.

WithArrayExactLength

public PeterO.Cbor.CBORTypeFilter WithArrayExactLength(
    int arrayLength,
    params PeterO.Cbor.CBORTypeFilter[] elements);

Copies this filter and includes CBOR arrays with an exact length to the new filter.

Parameters:

Return Value:

A CBORTypeFilter object.

Exceptions:

WithArrayMinLength

public PeterO.Cbor.CBORTypeFilter WithArrayMinLength(
    int arrayLength,
    params PeterO.Cbor.CBORTypeFilter[] elements);

Copies this filter and includes CBOR arrays with at least a given length to the new filter.

Parameters:

Return Value:

A CBORTypeFilter object.

Exceptions:

WithByteString

public PeterO.Cbor.CBORTypeFilter WithByteString();

Copies this filter and includes byte strings in the new filter.

Return Value:

A CBORTypeFilter object.

WithFloatingPoint

public PeterO.Cbor.CBORTypeFilter WithFloatingPoint();

Copies this filter and includes floating-point numbers in the new filter.

Return Value:

A CBORTypeFilter object.

WithMap

public PeterO.Cbor.CBORTypeFilter WithMap();

Copies this filter and includes maps in the new filter.

Return Value:

A CBORTypeFilter object.

WithNegativeInteger

public PeterO.Cbor.CBORTypeFilter WithNegativeInteger();

Copies this filter and includes negative integers in the new filter.

Return Value:

A CBORTypeFilter object.

WithTags

public PeterO.Cbor.CBORTypeFilter WithTags(
    params int[] tags);

Copies this filter and includes a set of valid CBOR tags in the new filter.

 <b>Parameters:</b>

Return Value:

A CBORTypeFilter object.

Exceptions:

WithTextString

public PeterO.Cbor.CBORTypeFilter WithTextString();

Copies this filter and includes text strings in the new filter.

Return Value:

A CBORTypeFilter object.

WithUnsignedInteger

public PeterO.Cbor.CBORTypeFilter WithUnsignedInteger();

Copies this filter and includes unsigned integers in the new filter.

Return Value:

A CBORTypeFilter object.

Back to CBOR start page.