MixedReality-WebRTC MixedReality-WebRTC
Search Results for

    Show / Hide Table of Contents

    Class SdpTokenAttribute

    Attribute for string properties representing an SDP token, which has constraints on the allowed characters it can contain, as defined in the SDP RFC.

    See https://tools.ietf.org/html/rfc4566#page-43 for details.

    Inheritance
    Object
    SdpTokenAttribute
    Namespace: Microsoft.MixedReality.WebRTC.Unity
    Assembly: cs.temp.dll.dll
    Syntax
    public class SdpTokenAttribute : PropertyAttribute

    Constructors

    SdpTokenAttribute(Boolean)

    Declaration
    public SdpTokenAttribute(bool allowEmpty = true)
    Parameters
    Type Name Description
    Boolean allowEmpty

    Value of AllowEmpty.

    Fields

    InvalidCharacters

    Regular expression that matches all characters which can't be used in an SDP token.

    Declaration
    public const string InvalidCharacters = "[^A-Za-z0-9!#$%&'*+-.^_`{|}~]"
    Field Value
    Type Description
    String

    Properties

    AllowEmpty

    Allow empty tokens, that is a string property which is null or an empty string. This is not valid in the RFC, but can be allowed as a property value to represent a default value generated at runtime by the implementation instead of being provided by the user.

    This is typically used as an argument to Validate(String, Boolean).

    Declaration
    public bool AllowEmpty { get; }
    Property Value
    Type Description
    Boolean

    true to allow the property to be null or empty.

    Methods

    Validate(String, Boolean)

    Validate an SDP token name against the list of allowed characters:

    • Symbols [!#$%'*+-.^_`{|}~&]
    • Alphanumerical characters [A-Za-z0-9]

    If the validation fails, the method throws an exception.

    Declaration
    public static void Validate(string name, bool allowEmpty = true)
    Parameters
    Type Name Description
    String name

    The token name to validate.

    Boolean allowEmpty

    true to allow the property to be null or empty without raising an exception.

    Remarks

    See https://tools.ietf.org/html/rfc4566#page-43 for 'token' reference.

    In This Article
    • Constructors
      • SdpTokenAttribute(Boolean)
    • Fields
      • InvalidCharacters
    • Properties
      • AllowEmpty
    • Methods
      • Validate(String, Boolean)
    Back to top Generated by DocFX