private void _ReadLine() { List <ByteSection> list = null; for (int i = 0; i < TABLE_LINE_SEPARATOR.Length; i++) { list = _SeparateString(this.m_ReadBuffer, 0, this.m_ReadBuffer.Length, TABLE_LINE_SEPARATOR[i], true); if (list.Count >= 2) { break; } } if ((list == null) || (list.Count < 2)) { ToolFunctions.LogError(string.Concat(new object[] { "table [", this.m_FileName, "], line count[", list.Count, "]" })); } else { int num2 = 0; ByteSection section = list[num2]; ByteSection section2 = list[num2]; List <ByteSection> columnField = _SeparateString(this.m_ReadBuffer, section.m_SectionBeginPos, section2.m_SectionLength, "\t", false); this.m_PreprocessData.m_ColumnName = new TableLine(list[num2], columnField); this.m_PreprocessData.m_ColumnCount = this.m_PreprocessData.m_ColumnName.m_ColumnField.Count; num2++; ByteSection section3 = list[num2]; ByteSection section4 = list[num2]; List <ByteSection> list3 = _SeparateString(this.m_ReadBuffer, section3.m_SectionBeginPos, section4.m_SectionLength, "\t", false); this.m_PreprocessData.m_ColumnType = new TableLine(list[num2], list3); int count = this.m_PreprocessData.m_ColumnType.m_ColumnField.Count; if (count != this.m_PreprocessData.m_ColumnCount) { ToolFunctions.LogError(string.Concat(new object[] { this.m_FileName, " ColumnNameCount[", this.m_PreprocessData.m_ColumnCount, "], ColumnTypeCount[", count, "]" })); } else { num2++; this.m_PreprocessData.m_Data = new List <TableLine>(); while (num2 < list.Count) { ByteSection section5 = list[num2]; if (this.m_ReadBuffer[section5.m_SectionBeginPos] != 0x23) { ByteSection section6 = list[num2]; ByteSection section7 = list[num2]; List <ByteSection> list4 = _SeparateString(this.m_ReadBuffer, section6.m_SectionBeginPos, section7.m_SectionLength, "\t", false); if (list4.Count != this.m_PreprocessData.m_ColumnCount) { ToolFunctions.LogError(string.Concat(new object[] { this.m_FileName, " ColumnNameCount[", this.m_PreprocessData.m_ColumnCount, "], ColumnCount of line[", num2, "] is [", list4.Count, "]" })); } else { this.m_PreprocessData.m_Data.Add(new TableLine(list[num2], list4)); } } num2++; } } } }
private EM_TYPE_COLUMN _ParseColumnType(ByteSection fieldSection) { string str = this._GetSubString(this.m_ReadBuffer, 0, this.m_ReadBuffer.Length, fieldSection); for (int i = 0; i < 9; i++) { if (COLUMN_TYPE_TO_STRING[i] == str) { return((EM_TYPE_COLUMN)i); } } return(EM_TYPE_COLUMN.INVALID); }
private string _GetSubString(byte[] sourceString, int off, int length, ByteSection section) { return(this._GetSubString(sourceString, off, length, section.m_SectionBeginPos, section.m_SectionLength)); }