Show / Hide Table of Contents

Struct ErlBinary

Provides a C# representation of Erlang integer types

Implements
IErlObject<System.Byte[]>
IErlObject
System.IComparable
System.IComparable<IErlObject>
System.IEquatable<IErlObject>
System.ICloneable
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: NFX.Erlang
Assembly: NFX.Erlang.dll
Syntax
public struct ErlBinary : IErlObject<byte[]>, IErlObject, IComparable, IComparable<IErlObject>, IEquatable<IErlObject>, ICloneable

Constructors

ErlBinary(Byte[], Boolean)

Create an Erlang binary from the given value

Declaration
public ErlBinary(byte[] val, bool copy = true)
Parameters
Type Name Description
System.Byte[] val
System.Boolean copy

ErlBinary(Byte[], Int32, Int32)

Create an Erlang binary by copying its value from the given buffer

Declaration
public ErlBinary(byte[] buf, int offset, int count)
Parameters
Type Name Description
System.Byte[] buf
System.Int32 offset
System.Int32 count

Properties

IsScalar

Declaration
public bool IsScalar { get; }
Property Value
Type Description
System.Boolean

Length

Return length of the binary byte array

Declaration
public int Length { get; }
Property Value
Type Description
System.Int32

TypeOrder

Declaration
public ErlTypeOrder TypeOrder { get; }
Property Value
Type Description
ErlTypeOrder

Value

Declaration
public byte[] Value { get; }
Property Value
Type Description
System.Byte[]

ValueAsBool

Declaration
public bool ValueAsBool { get; }
Property Value
Type Description
System.Boolean

ValueAsByteArray

Declaration
public byte[] ValueAsByteArray { get; }
Property Value
Type Description
System.Byte[]

ValueAsChar

Declaration
public char ValueAsChar { get; }
Property Value
Type Description
System.Char

ValueAsDateTime

Declaration
public DateTime ValueAsDateTime { get; }
Property Value
Type Description
System.DateTime

ValueAsDecimal

Declaration
public decimal ValueAsDecimal { get; }
Property Value
Type Description
System.Decimal

ValueAsDouble

Declaration
public double ValueAsDouble { get; }
Property Value
Type Description
System.Double

ValueAsInt

Declaration
public int ValueAsInt { get; }
Property Value
Type Description
System.Int32

ValueAsLong

Declaration
public long ValueAsLong { get; }
Property Value
Type Description
System.Int64

ValueAsObject

Declaration
public object ValueAsObject { get; }
Property Value
Type Description
System.Object

ValueAsString

Declaration
public string ValueAsString { get; }
Property Value
Type Description
System.String

ValueAsTimeSpan

Declaration
public TimeSpan ValueAsTimeSpan { get; }
Property Value
Type Description
System.TimeSpan

Methods

Clone()

Clone an instance of the object (non-scalar immutable objects are copied by reference)

Declaration
public IErlObject Clone()
Returns
Type Description
IErlObject

CompareTo(IErlObject)

Compare this instance to the IErlObject. Negative value means that the value is less than obj, positive - greater than the obj

Declaration
public int CompareTo(IErlObject obj)
Parameters
Type Name Description
IErlObject obj
Returns
Type Description
System.Int32

CompareTo(Object)

Compare this instance to the object. Negative value means that the value is less than obj, positive - greater than the obj

Declaration
public int CompareTo(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Int32

Equals(ErlBinary)

Determine if two instances are equal

Declaration
public bool Equals(ErlBinary rhs)
Parameters
Type Name Description
ErlBinary rhs
Returns
Type Description
System.Boolean

Equals(IErlObject)

Determine if two instances are equal

Declaration
public bool Equals(IErlObject o)
Parameters
Type Name Description
IErlObject o
Returns
Type Description
System.Boolean

Equals(Object)

Determine if this instance equals to the object

Declaration
public override bool Equals(object o)
Parameters
Type Name Description
System.Object o
Returns
Type Description
System.Boolean
Overrides
System.ValueType.Equals(System.Object)

GetHashCode()

Get internal hash code

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.ValueType.GetHashCode()

Match(IErlObject)

Perform pattern match on this Erlang term returning null if match fails or a dictionary of matched variables bound in the pattern

Declaration
public ErlVarBind Match(IErlObject pattern)
Parameters
Type Name Description
IErlObject pattern
Returns
Type Description
ErlVarBind

Match(IErlObject, ErlVarBind)

Perform pattern match on this Erlang term, storing matched variables found in the pattern into the binding.

Declaration
public bool Match(IErlObject pattern, ErlVarBind binding)
Parameters
Type Name Description
IErlObject pattern
ErlVarBind binding
Returns
Type Description
System.Boolean

Matches(IErlObject)

Perform pattern match on this Erlang term without binding any variables

Declaration
public bool Matches(IErlObject pattern)
Parameters
Type Name Description
IErlObject pattern
Returns
Type Description
System.Boolean

Subst(ref IErlObject, ErlVarBind)

Declaration
public bool Subst(ref IErlObject term, ErlVarBind binding)
Parameters
Type Name Description
IErlObject term
ErlVarBind binding
Returns
Type Description
System.Boolean

ToBinaryString(Byte[], Int32, Int32, Int32)

Convert a byte buffer to printable binary representation (i.e. <<131,15,12,...>>)

Declaration
public static string ToBinaryString(byte[] buf, int offset, int count, int maxLen = 0)
Parameters
Type Name Description
System.Byte[] buf

Buffer to convert

System.Int32 offset

Offset in the buffer

System.Int32 count

Number of bytes to convert

System.Int32 maxLen

Maximum allowed length of returned string. If given, and resulting string exceeds this value, it'll be trimmed to this length ending with "...>>"

Returns
Type Description
System.String

ToBinaryString(Int32)

Returns binary representation of the string encoded as <<...>>

Declaration
public string ToBinaryString(int maxLen = 0)
Parameters
Type Name Description
System.Int32 maxLen
Returns
Type Description
System.String

ToPrintableString(Byte[], Int32, Int32, Int32)

Convert a byte buffer to printable binary representation (i.e. <<"abc...">>)

Declaration
public static string ToPrintableString(byte[] buf, int offset, int count, int maxLen = 0)
Parameters
Type Name Description
System.Byte[] buf
System.Int32 offset
System.Int32 count
System.Int32 maxLen
Returns
Type Description
System.String

ToPrintableString(Int32)

Returns printable binary representation of the string encoded as <<"abc...">>

Declaration
public string ToPrintableString(int maxLen = 0)
Parameters
Type Name Description
System.Int32 maxLen
Returns
Type Description
System.String

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.ValueType.ToString()

ToString(Encoding)

Declaration
public string ToString(Encoding encoding)
Parameters
Type Name Description
System.Text.Encoding encoding
Returns
Type Description
System.String

Visit<TAccumulate>(TAccumulate, Func<TAccumulate, IErlObject, TAccumulate>)

Execute fun for every nested term

Declaration
public TAccumulate Visit<TAccumulate>(TAccumulate acc, Func<TAccumulate, IErlObject, TAccumulate> fun)
Parameters
Type Name Description
TAccumulate acc
System.Func<TAccumulate, IErlObject, TAccumulate> fun
Returns
Type Description
TAccumulate
Type Parameters
Name Description
TAccumulate

Operators

Equality(ErlBinary, ErlBinary)

Declaration
public static bool operator ==(ErlBinary lhs, ErlBinary rhs)
Parameters
Type Name Description
ErlBinary lhs
ErlBinary rhs
Returns
Type Description
System.Boolean

Implicit(ErlBinary to Byte[])

Implicit conversion of ErlBinary to byte[]

Declaration
public static implicit operator byte[](ErlBinary t)
Parameters
Type Name Description
ErlBinary t
Returns
Type Description
System.Byte[]

Inequality(ErlBinary, ErlBinary)

Declaration
public static bool operator !=(ErlBinary lhs, ErlBinary rhs)
Parameters
Type Name Description
ErlBinary lhs
ErlBinary rhs
Returns
Type Description
System.Boolean

Explicit Interface Implementations

ICloneable.Clone()

Declaration
object ICloneable.Clone()
Returns
Type Description
System.Object

Implements

IErlObject<T>
IErlObject
System.IComparable
System.IComparable<T>
System.IEquatable<T>
System.ICloneable

Extension Methods

ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.IsNull(IErlObject)
ErlObject.IsInt(IErlObject)
ErlObject.Subst(IErlObject, ErlVarBind)
ErlObject.Visit<TAccumulate>(IErlObject, TAccumulate, Func<TAccumulate, IErlObject, TAccumulate>)
ErlObject.AsType(IErlObject, Type)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX