Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::IniProfile::Section Class Reference

Internal storage class for sections. More...

#include <IniProfile.h>

Collaboration diagram for sf::IniProfile::Section:

Public Member Functions

 Section ()
 Default constructor.
 
 ~Section ()
 Destructor.
 
IniProfile::EntryVector::size_type findEntry (const std::string &key)
 Finds an entry by key value.
 
int setEntry (const std::string &key, const std::string &value)
 Sets sections value by key name.
 
std::string getEntry (const std::string &key, const std::string &defValue)
 Gets an entry string and returns a default when it does not exist.
 
bool removeEntry (EntryVector::size_type index)
 Removes an entry from an index position.
 
bool insertComment (const std::string &key, const std::string &comment)
 Adds comment to before entry specified by the key.
 
std::ostream & write (std::ostream &os)
 Streams section to an output stream.
 
bool read (std::istream &is)
 Read section from an input stream.
 

Public Attributes

std::string _name
 Holds the name of the section.
 
EntryVector _entries
 Holds the key value pairs.
 

Detailed Description

Internal storage class for sections.

Constructor & Destructor Documentation

◆ Section()

sf::IniProfile::Section::Section ( )
inline

Default constructor.

◆ ~Section()

sf::IniProfile::Section::~Section ( )

Destructor.

Member Function Documentation

◆ findEntry()

IniProfile::EntryVector::size_type sf::IniProfile::Section::findEntry ( const std::string &  key)

Finds an entry by key value.

Parameters
keyName of the key
Returns
npos if not found.

◆ getEntry()

std::string sf::IniProfile::Section::getEntry ( const std::string &  key,
const std::string &  defValue 
)

Gets an entry string and returns a default when it does not exist.

Parameters
keyKey name.
defValueDefault string value.
Returns
Found value or default when not found.

◆ insertComment()

bool sf::IniProfile::Section::insertComment ( const std::string &  key,
const std::string &  comment 
)

Adds comment to before entry specified by the key.

Parameters
keyKey name
commentComment added before the name entry.
Returns
True when successful.

◆ read()

bool sf::IniProfile::Section::read ( std::istream &  is)

Read section from an input stream.

Parameters
isInput stream.
Returns
True on success.

◆ removeEntry()

bool sf::IniProfile::Section::removeEntry ( EntryVector::size_type  index)

Removes an entry from an index position.

Parameters
indexPosition of the entry.
Returns
True on success.

◆ setEntry()

int sf::IniProfile::Section::setEntry ( const std::string &  key,
const std::string &  value 
)

Sets sections value by key name.

Parameters
keyName of the key
valueString value.
Returns
-1 on failure and 1 on change and 0 on no change.

◆ write()

std::ostream & sf::IniProfile::Section::write ( std::ostream &  os)

Streams section to an output stream.

Parameters
osOutput stream.
Returns
The passed output stream.

Member Data Documentation

◆ _entries

EntryVector sf::IniProfile::Section::_entries

Holds the key value pairs.

◆ _name

std::string sf::IniProfile::Section::_name

Holds the name of the section.


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