|
/********************************************************************\
created: 2001/03/04
created: 4:3:2001 13:10
filename: .\Parser\prsSingle.h
file path: Parser
file base: prsSingle
file ext: h
author: Alex Kucherenko
purpose:
\********************************************************************/
#ifndef _PARSER_TODO_SINGLE_H_
#define _PARSER_TODO_SINGLE_H_
#include "prsExceptions.h"
#include "prsBase.h"
//////////////////////////////////////////////////////////////////////////
// Class for parsing only one file with one search criterion (NOTE: low perfomance)
class CToDoSingleParse :
public CToDoIterator< TLineMapperIter > ,
public CToDoBaseParser
{
friend class CToDoMultiParse;
public:
CToDoSingleParse();
CToDoSingleParse( const string FileName );
CToDoSingleParse( const string FileName, const string SearchWord );
~CToDoSingleParse();
// BaseParser
virtual void ClearAllElements( void )
{
m_mapLines.clear();
m_lCounter = 0;
}
// Iterator
virtual TLineMapperIter * First() throw( CToDoNoElements );
virtual TLineMapperIter * Last() throw( CToDoNoElements );
virtual TLineMapperIter * Next() throw( CToDoNoElements, CToDoLastRiched );
virtual TLineMapperIter * Prev() throw( CToDoNoElements, CToDoFirstRiched );
// Properties
string GetSearchWord( void ) const
{
return m_strSearchWord;
};
void SetSearchWord( const string SearchWord )
{
m_strSearchWord = SearchWord;
};
long GetElementsQuantity( void ) const
{
return m_lCounter;
}
protected:
CToDoSingleParse &operator+( CToDoSingleParse &twice );
void Merge( CToDoSingleParse &twice );
virtual long ParseEngine( void ) throw( CToDoFileWork );
void SetElementsQuatity( const long Quantity )
{
m_lCounter = Quantity;
}
TLineMapper &GetMap( void )
{
return m_mapLines;
}
private:
long m_lCounter;
TLineMapper m_mapLines;
string m_strSearchWord;
TLineMapperIter m_mapIter;
};
#endif /* _PARSER_TODO_SINGLE_H_ */
//:> End of file
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.