Attribute VB_Name = "modProjGutenberg"
Option Explicit

Private Const GUTENBERG_START As String = _
   "*** START OF THIS PROJECT GUTENBERG EBOOK"
   
'Private Const GUTENBERG_END As String = _
   "*** END OF THIS PROJECT GUTENBERG EBOOK"

Private Const GUTENBERG_END As String = _
   "End of Project Gutenberg's Webster's Unabridged Dictionary"

Function Gutenberg_Copyright(Reader As clsTextReader, _
   FirstLine As Long) As String
   
   Gutenberg_Copyright = _
      Reader.Lines(FirstLine, Reader.LineCount)
      
End Function

Function Gutenberg_Header( _
   Reader As clsTextReader, LastLine As Long) As String
   
   Gutenberg_Header = _
      Reader.Lines(1, LastLine)
   
End Function

Function Gutenberg_Data_FirstLine( _
   Reader As clsTextReader) As Long
   
   Gutenberg_Data_FirstLine = _
      gutenberg_GetLineNo(Reader, GUTENBERG_START)
   
End Function

Function Gutenberg_Data_LastLine( _
   Reader As clsTextReader) As Long
   
   Gutenberg_Data_LastLine = _
      gutenberg_GetLineNo(Reader, GUTENBERG_END) - 1
      
End Function

Private Function gutenberg_GetLineNo( _
   Reader As clsTextReader, Search As String) As Long
   
   Dim iFind As Long
   iFind = Reader.Find(Search)
   
   gutenberg_GetLineNo = _
      Reader.LineNoFromCharPos(iFind)
      
End Function
