IniFile
Loading...
Searching...
No Matches
ini::LineFactory Class Reference

This class turns lines of an INI file into objects of the types Line, Section or Key. More...

#include <IniLineFactory.h>

Public Member Functions

 LineFactory ()
 
virtual ~LineFactory ()
 
int getIniLine (Line *&prIniLine, std::string sCharLine) const
 
void trim (std::string &rsCharLine) const
 
LINE_TYPE getLineType (std::string sCharLine) const
 

Private Member Functions

 LineFactory (const LineFactory &)
 
bool isComment (std::string sCharLine) const
 
bool isSection (std::string sCharLine) const
 
bool isKey (std::string sCharLine) const
 
LineFactoryoperator= (const LineFactory &)
 

Detailed Description

This class turns lines of an INI file into objects of the types Line, Section or Key.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ LineFactory() [1/2]

ini::LineFactory::LineFactory ( )

Standard constructor.

◆ ~LineFactory()

virtual ini::LineFactory::~LineFactory ( )
virtual

Destructor.

◆ LineFactory() [2/2]

ini::LineFactory::LineFactory ( const LineFactory & )
inlineprivate

The copy constructor is not available.

Member Function Documentation

◆ getIniLine()

int ini::LineFactory::getIniLine ( Line *& prIniLine,
std::string sCharLine ) const

This method returns a pointer to an Line or subclass of Line in the reference 'prIniLine'.

Parameters
[in,out]prIniLinePointer to a newly instantiated Line or subclass.
[in]sCharLineThe line from an ini file as string. The text line is evaluated accordingly.
Returns
A return < 0 indicates an error.
Attention
The calling instance must remove a supplied valid Line or subclass from memory.

◆ getLineType()

LINE_TYPE ini::LineFactory::getLineType ( std::string sCharLine) const

Returns the type of the entry.

Parameters
[in]sCharLineLine to be analyzed as string.
Returns
The determined type of the entry line.

◆ isComment()

bool ini::LineFactory::isComment ( std::string sCharLine) const
private

Checks if the transferred entry is an INI comment.

Parameters
[in]sCharLineLine to be analyzed as string.
Returns
Returns true if the passed entry is an INI comment, otherwise false.

◆ isKey()

bool ini::LineFactory::isKey ( std::string sCharLine) const
private

Checks whether the transferred entry is an INI key.

Parameters
[in]sCharLineLine to be analyzed as string.
Returns
Returns true, if passed entry is an INI key, otherwise false.

◆ isSection()

bool ini::LineFactory::isSection ( std::string sCharLine) const
private

Checks whether the transferred entry is an INI section.

Parameters
[in]sCharLineLine to be analyzed as string.
Returns
Returns true if the given entry is an INI section, otherwise false.

◆ operator=()

LineFactory & ini::LineFactory::operator= ( const LineFactory & )
inlineprivate

The assignment operator is not available.

◆ trim()

void ini::LineFactory::trim ( std::string & rsCharLine) const

Removes leading and trailing spaces {0x20} and TABs {0x09} in the passed string.

Parameters
[in,out]rsCharLineReference to string to be processed.

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