ToolMap
Loading...
Searching...
No Matches
TextParser Class Reference

Super-class for parsing different file. More...

#include <textparser.h>

Inheritance diagram for TextParser:
TextParserTxtFile TextParserTxtFileComma TextParserTxtFileTab

Public Member Functions

wxString GetParserType ()
 
void SetParseFileName (const wxString &myFileName)
 
void SetParseFileName (const wxFileName &myFileName)
 
virtual bool OpenParseFile (bool bCreate=FALSE)
 
virtual int ParseNextLine (wxArrayString &myValues)
 
virtual bool WriteNextLine (const wxArrayString &myValues)
 
virtual bool CloseParseFile ()
 
int GetActualLineNumber ()
 
void InitActualLineNumber ()
 
void IncrementActualLineNumber (int iIncrement=1)
 
int GetLineCount ()
 
virtual bool CheckFileToParse ()
 
void SetNumberOfFields (int inbfield)
 Set the number of fields we are looking for.
 

Static Public Member Functions

static wxString GetAllSupportedParserWildCards ()
 
static TextParserCreateParserBasedOnType (const int &textparser_index, const wxFileName &filename)
 

Protected Member Functions

bool CheckParseFileExist ()
 

Protected Attributes

wxString m_ParseFileType
 
wxFileName m_ParseFileName
 
int m_LineCount
 
int m_NbFieldToParse
 

Static Protected Attributes

static int m_iActualLine = 0
 

Detailed Description

Super-class for parsing different file.

Mainly used for parsing list of values. Actually, only comma separated file (TextParserComma) and point-comma files with the derived class (TextParser...). But it could be easily enhanced in the future with for exemple the DBase support

Author
Lucien Schreiber (c) CREALP 2007
Date
11 December 2007

Member Function Documentation

◆ CheckFileToParse()

virtual bool TextParser::CheckFileToParse ( )
inlinevirtual

Reimplemented in TextParserTxtFile.

◆ SetNumberOfFields()

void TextParser::SetNumberOfFields ( int  inbfield)

Set the number of fields we are looking for.

This function must be called for letting the parser know how many fields must been found in the file. This number is used for checking the file.

Note
If this function isn't called, a message is issued in debug mode
Parameters
inbfieldThe number of fields whom must been present in the file
Author
Lucien Schreiber (c) CREALP 2008
Date
19 May 2008

The documentation for this class was generated from the following files: