9 #ifndef _MummyLineOrientedTextFileReader_h_
10 #define _MummyLineOrientedTextFileReader_h_
14 #include "gxsys/stl/string"
15 #include "gxsys/stl/vector"
27 LineData(
const gxsys_stl::string &line,
const bool isLineComment,
const int btxEtxLevel) :
143 virtual gxsys_stl::string
GetLine(
unsigned int lineNumber);
186 virtual void GetCommentBlockBefore(
unsigned int lineNumber, gxsys_stl::vector<gxsys_stl::string>& block,
unsigned int smallestAcceptableLineNumber);
203 #endif // _MummyLineOrientedTextFileReader_h_
virtual void GetFirstCommentBlock(gxsys_stl::vector< gxsys_stl::string > &block)
Retrieve the first block of comment lines, if any, in the file.
MummyLineOrientedTextFileReader()
virtual void SetFileName(const char *filename)
Set the filename.
virtual int GetBtxEtxLevel(unsigned int lineNumber)
Get the current nesting level at line number 'lineNumber' of "//BTX - //ETX" style wrapper exclusion ...
virtual ~MummyLineOrientedTextFileReader()
virtual bool GetIsLineComment(unsigned int lineNumber)
Query if line number 'lineNumber' is a "line comment." Valid 'lineNumber' values are 1 through GetNum...
virtual void SetEndExcludeRegex(const gxsys_stl::string &endExcludeRegex)
Set the regular expression that delineates a line as the end of a "marked as excluded" block...
virtual gxsys_stl::string GetFileName()
Get the filename.
virtual gxsys_stl::string GetEndExcludeRegex()
Get the regular expression that delineates a line as the end of a "marked as excluded" block...
Internal, implementation detail class that caches information associated with a line in a line orient...
virtual unsigned int GetNumberOfLines()
Retrieve the total number of lines currently cached.
gxsys_stl::string BeginExcludeRegex
LineData(const gxsys_stl::string &line, const bool isLineComment, const int btxEtxLevel)
virtual void SetExcludeMarkedLines(bool excludeMarkedLines)
Set whether to exclude lines between beginExcludeRegex and endExcludeRegex matching lines when consid...
virtual gxsys_stl::string GetBeginExcludeRegex()
Get the regular expression that delineates a line as the beginning of a "marked as excluded" block...
virtual void SetBeginExcludeRegex(const gxsys_stl::string &beginExcludeRegex)
Set the regular expression that delineates a line as the beginning of a "marked as excluded" block...
virtual bool IsLineExcluded(unsigned int lineNumber)
Query whether the given line number should be excluded based on the exclude flag and the line number'...
gxsys_stl::vector< LineData > Lines
Class that reads a text file and caches its lines and information about those lines for quick queries...
gxsys_stl::string FileName
virtual void Update()
Read the current text file and cache its lines for subsequent quick lookup by line number...
virtual void GetCommentBlockBefore(unsigned int lineNumber, gxsys_stl::vector< gxsys_stl::string > &block, unsigned int smallestAcceptableLineNumber)
Retrieve the nearest preceding block of comment lines relative to line number 'lineNumber'. Valid 'lineNumber' values are 2 through GetNumberOfLines inclusive.
gxsys_stl::string EndExcludeRegex
virtual bool GetExcludeMarkedLines()
Get whether to exclude lines between beginExcludeRegex and endExcludeRegex matching lines when consid...
virtual gxsys_stl::string GetLine(unsigned int lineNumber)
Retrieve line number 'lineNumber' as a string from the currently cached text file. Valid 'lineNumber' values are 1 through GetNumberOfLines inclusive.