using System;
namespace System.Text
{
/// Provides a failure-handling mechanism, called a fallback, for an encoded input byte sequence that cannot be converted to an output character. The fallback emits a user-specified replacement string instead of a decoded input byte sequence. This class cannot be inherited.
/// 2
// Token: 0x020005E7 RID: 1511
[Serializable]
public sealed class DecoderReplacementFallback : DecoderFallback
{
/// Initializes a new instance of the class.
// Token: 0x060036FD RID: 14077 RVA: 0x000BC85C File Offset: 0x000BAA5C
public DecoderReplacementFallback()
: this("?")
{
}
/// Initializes a new instance of the class using a specified replacement string.
/// A string that is emitted in a decoding operation in place of an input byte sequence that cannot be decoded.
///
/// is null.
///
/// contains an invalid surrogate pair. In other words, the surrogate pair does not consist of one high surrogate component followed by one low surrogate component.
// Token: 0x060036FE RID: 14078 RVA: 0x000BC86C File Offset: 0x000BAA6C
[MonoTODO]
public DecoderReplacementFallback(string replacement)
{
if (replacement == null)
{
throw new ArgumentNullException();
}
this.replacement = replacement;
}
/// Gets the replacement string that is the value of the object.
/// A substitute string that is emitted in place of an input byte sequence that cannot be decoded.
/// 2
// Token: 0x17000AC0 RID: 2752
// (get) Token: 0x060036FF RID: 14079 RVA: 0x000BC888 File Offset: 0x000BAA88
public string DefaultString
{
get
{
return this.replacement;
}
}
/// Gets the number of characters in the replacement string for the object.
/// The number of characters in the string that is emitted in place of a byte sequence that cannot be decoded, that is, the length of the string returned by the property.
/// 2
// Token: 0x17000AC1 RID: 2753
// (get) Token: 0x06003700 RID: 14080 RVA: 0x000BC890 File Offset: 0x000BAA90
public override int MaxCharCount
{
get
{
return this.replacement.Length;
}
}
/// Creates a object that is initialized with the replacement string of this object.
/// A object that specifies a string to use instead of the original decoding operation input.
/// 2
// Token: 0x06003701 RID: 14081 RVA: 0x000BC8A0 File Offset: 0x000BAAA0
public override DecoderFallbackBuffer CreateFallbackBuffer()
{
return new DecoderReplacementFallbackBuffer(this);
}
/// Indicates whether the value of a specified object is equal to the object.
/// true if is a object having a property that is equal to the property of the current object; otherwise, false.
/// A object.
/// 2
// Token: 0x06003702 RID: 14082 RVA: 0x000BC8A8 File Offset: 0x000BAAA8
public override bool Equals(object value)
{
DecoderReplacementFallback decoderReplacementFallback = value as DecoderReplacementFallback;
return decoderReplacementFallback != null && this.replacement == decoderReplacementFallback.replacement;
}
/// Retrieves the hash code for the value of the object.
/// The hash code of the value of the object.
/// 2
// Token: 0x06003703 RID: 14083 RVA: 0x000BC8D8 File Offset: 0x000BAAD8
public override int GetHashCode()
{
return this.replacement.GetHashCode();
}
// Token: 0x04001672 RID: 5746
private string replacement;
}
}