biffrecordreader.cs

来自「Excel的操作,其中可以读取及写入Excel 文件」· CS 代码 · 共 63 行

CS
63
字号
using System;

namespace Microsoft.Fawvw.Components.NExcel.Read.Biff
{
	
	/// <summary> Serves up Record objects from a biff file.  This object is used by the
	/// demo programs BiffDump and ... only and has no influence whatsoever on
	/// the JExcelApi reading and writing of excel sheets
	/// </summary>
	public class BiffRecordReader
	{
		/// <summary> Gets the position of the current record in the biff file
		/// 
		/// </summary>
		/// <returns> the position
		/// </returns>
		virtual public int Pos
		{
			get
			{
				return file.Pos - record.Length - 4;
			}
			
		}
		/// <summary> The biff file</summary>
		private File file;
		
		/// <summary> The current record retrieved</summary>
		private Record record;
		
		/// <summary> Constructor
		/// 
		/// </summary>
		/// <param name="f">the biff file
		/// </param>
		public BiffRecordReader(File f)
		{
			file = f;
		}
		
		/// <summary> Sees if there are any more records to read
		/// 
		/// </summary>
		/// <returns> TRUE if there are more records, FALSE otherwise
		/// </returns>
		public virtual bool hasNext()
		{
			return file.hasNext();
		}
		
		/// <summary> Gets the next record
		/// 
		/// </summary>
		/// <returns> the next record
		/// </returns>
		public virtual Record next()
		{
			record = file.next();
			return record;
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?