using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace System
{
/// Supports iterating over a object and reading its individual characters. This class cannot be inherited.
/// 2
// Token: 0x02000644 RID: 1604
[ComVisible(true)]
[Serializable]
public sealed class CharEnumerator : IEnumerator, IDisposable, ICloneable, IEnumerator
{
// Token: 0x06003B6F RID: 15215 RVA: 0x000CA7CC File Offset: 0x000C89CC
internal CharEnumerator(string s)
{
this.str = s;
this.index = -1;
this.length = s.Length;
}
/// Gets the currently referenced character in the string enumerated by this object. For a description of this member, see .
/// The boxed Unicode character currently referenced by this object.
/// Enumeration has not started.-or-Enumeration has ended.
// Token: 0x17000B5B RID: 2907
// (get) Token: 0x06003B70 RID: 15216 RVA: 0x000CA7FC File Offset: 0x000C89FC
object IEnumerator.Current
{
get
{
return this.Current;
}
}
/// Releases all resources used by the class.
// Token: 0x06003B71 RID: 15217 RVA: 0x000CA80C File Offset: 0x000C8A0C
void IDisposable.Dispose()
{
}
/// Gets the currently referenced character in the string enumerated by this object.
/// The Unicode character currently referenced by this object.
/// The index is invalid; that is, it is before the first or after the last character of the enumerated string.
/// 2
// Token: 0x17000B5C RID: 2908
// (get) Token: 0x06003B72 RID: 15218 RVA: 0x000CA810 File Offset: 0x000C8A10
public char Current
{
get
{
if (this.index == -1 || this.index >= this.length)
{
throw new InvalidOperationException(Locale.GetText("The position is not valid."));
}
return this.str[this.index];
}
}
/// Creates a copy of the current object.
/// An that is a copy of the current object.
/// 2
// Token: 0x06003B73 RID: 15219 RVA: 0x000CA85C File Offset: 0x000C8A5C
public object Clone()
{
return new CharEnumerator(this.str)
{
index = this.index
};
}
/// Increments the internal index of the current object to the next character of the enumerated string.
/// true if the index is successfully incremented and within the enumerated string; otherwise, false.
/// 2
// Token: 0x06003B74 RID: 15220 RVA: 0x000CA884 File Offset: 0x000C8A84
public bool MoveNext()
{
this.index++;
if (this.index >= this.length)
{
this.index = this.length;
return false;
}
return true;
}
/// Initializes the index to a position logically before the first character of the enumerated string.
/// 2
// Token: 0x06003B75 RID: 15221 RVA: 0x000CA8C0 File Offset: 0x000C8AC0
public void Reset()
{
this.index = -1;
}
// Token: 0x040017C6 RID: 6086
private string str;
// Token: 0x040017C7 RID: 6087
private int index;
// Token: 0x040017C8 RID: 6088
private int length;
}
}