#include <ConfigParser.h>

Collaboration diagram for ConfigParser::CfgFile:

Public Member Functions

 CfgFile ()
 ~CfgFile ()
bool isOpen ()
 True if the configuration file is open. More...
bool startParse (char *path)
char * parse (TokenType &type)

Public Attributes

std::string filePath
 The file path. More...
std::string currentLine
 The current line to parse. More...
int lineNo
 Current line number. More...

Private Member Functions

bool getFileLine ()
 Read the next line from the file. More...
char * nextElement (TokenType &type)

Private Attributes

FILE * wordFile
 Pointer to the file. More...
char parseBuffer [CONFIG_LINE_LIMIT]
 Temporary buffer to store data to parse. More...
const char * parsePos
 The next element position in parseBuffer string. More...

Detailed Description

Class used to store required information for the current configuration file.

Definition at line 148 of file ConfigParser.h.

Constructor & Destructor Documentation

◆ CfgFile()

ConfigParser::CfgFile::CfgFile ( )

Definition at line 151 of file ConfigParser.h.

References parseBuffer, and ~CfgFile().

◆ ~CfgFile()

ConfigParser::CfgFile::~CfgFile ( )

Definition at line 602 of file ConfigParser.cc.

Referenced by CfgFile().

Member Function Documentation

◆ getFileLine()

bool ConfigParser::CfgFile::getFileLine ( )

Definition at line 558 of file ConfigParser.cc.


Referenced by isOpen().

◆ isOpen()

bool ConfigParser::CfgFile::isOpen ( )

Definition at line 154 of file ConfigParser.h.

References getFileLine(), nextElement(), NULL, parse(), startParse(), type, and wordFile.

Referenced by ConfigParser::NextToken().

◆ nextElement()

char * ConfigParser::CfgFile::nextElement ( ConfigParser::TokenType type)

Return the body of the next element. If the wasQuoted is given set to true if the element was quoted.

Definition at line 592 of file ConfigParser.cc.

References ConfigParser::FunctionParameters, ConfigParser::PreviewMode_, and ConfigParser::TokenParse().

Referenced by isOpen().

◆ parse()

char * ConfigParser::CfgFile::parse ( ConfigParser::TokenType type)

Do the next parsing step: reads the next line from file if required.

the body of next element or a NULL pointer if there are no more token elements in the file.
typewill be filled with the ConfigParse::TokenType for any element found, or left unchanged if NULL is returned.

Definition at line 575 of file ConfigParser.cc.

References NULL.

Referenced by isOpen(), and ConfigParser::NextToken().

◆ startParse()

bool ConfigParser::CfgFile::startParse ( char *  path)

Open the file given by 'path' and initializes the CfgFile object to start parsing

Definition at line 540 of file ConfigParser.cc.

References assert, DBG_CRITICAL, debugs, NULL, and O_TEXT.

Referenced by isOpen(), and ConfigParser::NextToken().

Member Data Documentation

◆ currentLine

std::string ConfigParser::CfgFile::currentLine

Definition at line 182 of file ConfigParser.h.

Referenced by ConfigParser::destruct().

◆ filePath

std::string ConfigParser::CfgFile::filePath

Definition at line 181 of file ConfigParser.h.

Referenced by ConfigParser::destruct(), and ConfigParser::NextToken().

◆ lineNo

int ConfigParser::CfgFile::lineNo

Definition at line 183 of file ConfigParser.h.

Referenced by ConfigParser::destruct().

◆ parseBuffer

char ConfigParser::CfgFile::parseBuffer[CONFIG_LINE_LIMIT]

Definition at line 178 of file ConfigParser.h.

Referenced by CfgFile().

◆ parsePos

const char* ConfigParser::CfgFile::parsePos

Definition at line 179 of file ConfigParser.h.

◆ wordFile

FILE* ConfigParser::CfgFile::wordFile

Definition at line 177 of file ConfigParser.h.

Referenced by isOpen().

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






Web Site Translations