using System;

// Token: 0x02000092 RID: 146
internal class StringSplitter
{
	// Token: 0x06000E2A RID: 3626 RVA: 0x0010FC3F File Offset: 0x0010DE3F
	public StringSplitter(int bufferSize)
	{
		this.buffer = new string[bufferSize];
	}

	// Token: 0x1700001B RID: 27
	// (get) Token: 0x06000E2B RID: 3627 RVA: 0x0010FC53 File Offset: 0x0010DE53
	public string[] Results
	{
		get
		{
			return this.buffer;
		}
	}

	// Token: 0x06000E2C RID: 3628 RVA: 0x0010FC5C File Offset: 0x0010DE5C
	public int Split(string value, char separator)
	{
		int num = 0;
		int num2 = 0;
		for (int i = 0; i < value.Length; i++)
		{
			if (value[i] == separator)
			{
				this.buffer[num] = value.Substring(num2, i - num2);
				num++;
				num2 = i + 1;
			}
		}
		this.buffer[num] = value.Substring(num2, value.Length - num2);
		return num + 1;
	}

	// Token: 0x06000E2D RID: 3629 RVA: 0x0010FCC0 File Offset: 0x0010DEC0
	public int SafeSplit(string value, char separator)
	{
		int num = 0;
		int num2 = 0;
		for (int i = 0; i < value.Length; i++)
		{
			if (value[i] == separator)
			{
				if (this.buffer.Length == num)
				{
					Array.Resize<string>(ref this.buffer, this.buffer.Length * 2);
				}
				this.buffer[num] = value.Substring(num2, i - num2);
				num++;
				num2 = i + 1;
			}
		}
		if (this.buffer.Length == num)
		{
			Array.Resize<string>(ref this.buffer, this.buffer.Length * 2);
		}
		this.buffer[num] = value.Substring(num2, value.Length - num2);
		return num + 1;
	}

	// Token: 0x06000E2E RID: 3630 RVA: 0x0010FD60 File Offset: 0x0010DF60
	public int Split(string value, string separator)
	{
		int num = 0;
		int num2 = 0;
		int num3 = value.Length - separator.Length;
		for (int i = 0; i < num3; i++)
		{
			bool flag = true;
			int num4 = 0;
			while (num4 < separator.Length && num4 + i < value.Length)
			{
				if (value[i + num4] != separator[num4])
				{
					flag = false;
					break;
				}
				num4++;
			}
			if (flag)
			{
				this.buffer[num] = value.Substring(num2, i + separator.Length - num2 - separator.Length);
				num++;
				num2 = i + separator.Length;
				i += separator.Length - 1;
			}
		}
		this.buffer[num] = value.Substring(num2, value.Length - num2);
		return num + 1;
	}

	// Token: 0x06000E2F RID: 3631 RVA: 0x0010FE24 File Offset: 0x0010E024
	public int SafeSplit(string value, string separator)
	{
		int num = 0;
		int num2 = 0;
		int num3 = value.Length - separator.Length;
		for (int i = 0; i < num3; i++)
		{
			bool flag = true;
			int num4 = 0;
			while (num4 < separator.Length && num4 + i < value.Length)
			{
				if (value[i + num4] != separator[num4])
				{
					flag = false;
					break;
				}
				num4++;
			}
			if (flag)
			{
				if (this.buffer.Length == num)
				{
					Array.Resize<string>(ref this.buffer, this.buffer.Length * 2);
				}
				this.buffer[num] = value.Substring(num2, i + separator.Length - num2 - separator.Length);
				num++;
				num2 = i + separator.Length;
				i += separator.Length - 1;
			}
		}
		if (this.buffer.Length == num)
		{
			Array.Resize<string>(ref this.buffer, this.buffer.Length * 2);
		}
		this.buffer[num] = value.Substring(num2, value.Length - num2);
		return num + 1;
	}

	// Token: 0x06000E30 RID: 3632 RVA: 0x0010FF28 File Offset: 0x0010E128
	public int Split(string value, char[] separators)
	{
		int num = 0;
		int num2 = 0;
		for (int i = 0; i < value.Length; i++)
		{
			bool flag = false;
			for (int j = 0; j < separators.Length; j++)
			{
				if (value[i] == separators[j])
				{
					flag = true;
					break;
				}
			}
			if (flag)
			{
				this.buffer[num] = value.Substring(num2, i - num2);
				num++;
				num2 = i + 1;
			}
		}
		this.buffer[num] = value.Substring(num2, value.Length - num2);
		return num + 1;
	}

	// Token: 0x06000E31 RID: 3633 RVA: 0x0010FFA8 File Offset: 0x0010E1A8
	public int SafeSplit(string value, char[] separators)
	{
		int num = 0;
		int num2 = 0;
		for (int i = 0; i < value.Length; i++)
		{
			bool flag = false;
			for (int j = 0; j < separators.Length; j++)
			{
				if (value[i] == separators[j])
				{
					flag = true;
					break;
				}
			}
			if (flag)
			{
				if (this.buffer.Length == num)
				{
					Array.Resize<string>(ref this.buffer, this.buffer.Length * 2);
				}
				this.buffer[num] = value.Substring(num2, i - num2);
				num++;
				num2 = i + 1;
			}
		}
		if (this.buffer.Length == num)
		{
			Array.Resize<string>(ref this.buffer, this.buffer.Length * 2);
		}
		this.buffer[num] = value.Substring(num2, value.Length - num2);
		return num + 1;
	}

	// Token: 0x06000E32 RID: 3634 RVA: 0x00110068 File Offset: 0x0010E268
	public int Split(string value, char separator, StringSplitOptions options)
	{
		int num = 0;
		int num2 = 0;
		for (int i = 0; i < value.Length; i++)
		{
			if (value[i] == separator)
			{
				if (options == StringSplitOptions.None || i - num2 > 0)
				{
					this.buffer[num] = value.Substring(num2, i - num2);
					num++;
				}
				num2 = i + 1;
			}
		}
		if (options == StringSplitOptions.None || value.Length - num2 > 0)
		{
			this.buffer[num] = value.Substring(num2, value.Length - num2);
			num++;
		}
		return num;
	}

	// Token: 0x06000E33 RID: 3635 RVA: 0x001100E4 File Offset: 0x0010E2E4
	public int SafeSplit(string value, char separator, StringSplitOptions options)
	{
		int num = 0;
		int num2 = 0;
		for (int i = 0; i < value.Length; i++)
		{
			if (value[i] == separator)
			{
				if (options == StringSplitOptions.None || i - num2 > 0)
				{
					if (this.buffer.Length == num)
					{
						Array.Resize<string>(ref this.buffer, this.buffer.Length * 2);
					}
					this.buffer[num] = value.Substring(num2, i - num2);
					num++;
				}
				num2 = i + 1;
			}
		}
		if (options == StringSplitOptions.None || value.Length - num2 > 0)
		{
			if (this.buffer.Length == num)
			{
				Array.Resize<string>(ref this.buffer, this.buffer.Length * 2);
			}
			this.buffer[num] = value.Substring(num2, value.Length - num2);
			num++;
		}
		return num;
	}

	// Token: 0x06000E34 RID: 3636 RVA: 0x001101A0 File Offset: 0x0010E3A0
	public int Split(string value, string separator, StringSplitOptions options)
	{
		int num = 0;
		int num2 = 0;
		int num3 = value.Length - separator.Length;
		for (int i = 0; i < num3; i++)
		{
			bool flag = true;
			int num4 = 0;
			while (num4 < separator.Length && num4 + i < value.Length)
			{
				if (value[i + num4] != separator[num4])
				{
					flag = false;
					break;
				}
				num4++;
			}
			if (flag)
			{
				if (options == StringSplitOptions.None || i + separator.Length - num2 - separator.Length > 0)
				{
					this.buffer[num] = value.Substring(num2, i + separator.Length - num2 - separator.Length);
					num++;
				}
				num2 = i + separator.Length;
				i += separator.Length - 1;
			}
		}
		if (options == StringSplitOptions.None || value.Length - num2 > 0)
		{
			this.buffer[num] = value.Substring(num2, value.Length - num2);
			num++;
		}
		return num;
	}

	// Token: 0x06000E35 RID: 3637 RVA: 0x0011028C File Offset: 0x0010E48C
	public int SafeSplit(string value, string separator, StringSplitOptions options)
	{
		int num = 0;
		int num2 = 0;
		int num3 = value.Length - separator.Length;
		for (int i = 0; i < num3; i++)
		{
			bool flag = true;
			int num4 = 0;
			while (num4 < separator.Length && num4 + i < value.Length)
			{
				if (value[i + num4] != separator[num4])
				{
					flag = false;
					break;
				}
				num4++;
			}
			if (flag)
			{
				if (options == StringSplitOptions.None || i + separator.Length - num2 - separator.Length > 0)
				{
					if (this.buffer.Length == num)
					{
						Array.Resize<string>(ref this.buffer, this.buffer.Length * 2);
					}
					this.buffer[num] = value.Substring(num2, i + separator.Length - num2 - separator.Length);
					num++;
				}
				num2 = i + separator.Length;
				i += separator.Length - 1;
			}
		}
		if (options == StringSplitOptions.None || value.Length - num2 > 0)
		{
			if (this.buffer.Length == num)
			{
				Array.Resize<string>(ref this.buffer, this.buffer.Length * 2);
			}
			this.buffer[num] = value.Substring(num2, value.Length - num2);
			num++;
		}
		return num;
	}

	// Token: 0x06000E36 RID: 3638 RVA: 0x001103B8 File Offset: 0x0010E5B8
	public int Split(string value, char[] separators, StringSplitOptions options)
	{
		int num = 0;
		int num2 = 0;
		for (int i = 0; i < value.Length; i++)
		{
			bool flag = false;
			for (int j = 0; j < separators.Length; j++)
			{
				if (value[i] == separators[j])
				{
					flag = true;
					break;
				}
			}
			if (flag)
			{
				if (options == StringSplitOptions.None || i - num2 > 0)
				{
					this.buffer[num] = value.Substring(num2, i - num2);
					num++;
				}
				num2 = i + 1;
			}
		}
		if (options == StringSplitOptions.None || value.Length - num2 > 0)
		{
			this.buffer[num] = value.Substring(num2, value.Length - num2);
			num++;
		}
		return num;
	}

	// Token: 0x06000E37 RID: 3639 RVA: 0x00110450 File Offset: 0x0010E650
	public int SafeSplit(string value, char[] separators, StringSplitOptions options)
	{
		int num = 0;
		int num2 = 0;
		for (int i = 0; i < value.Length; i++)
		{
			bool flag = false;
			for (int j = 0; j < separators.Length; j++)
			{
				if (value[i] == separators[j])
				{
					flag = true;
					break;
				}
			}
			if (flag)
			{
				if (options == StringSplitOptions.None || i - num2 > 0)
				{
					if (this.buffer.Length == num)
					{
						Array.Resize<string>(ref this.buffer, this.buffer.Length * 2);
					}
					this.buffer[num] = value.Substring(num2, i - num2);
					num++;
				}
				num2 = i + 1;
			}
		}
		if (options == StringSplitOptions.None || value.Length - num2 > 0)
		{
			if (this.buffer.Length == num)
			{
				Array.Resize<string>(ref this.buffer, this.buffer.Length * 2);
			}
			this.buffer[num] = value.Substring(num2, value.Length - num2);
			num++;
		}
		return num;
	}

	// Token: 0x0400168F RID: 5775
	public string[] buffer;
}
