Internal storage class for sections.
More...
#include <IniProfile.h>
|
| 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.
|
|
Internal storage class for sections.
◆ Section()
sf::IniProfile::Section::Section |
( |
| ) |
|
|
inline |
◆ ~Section()
sf::IniProfile::Section::~Section |
( |
| ) |
|
◆ findEntry()
Finds an entry by key value.
- Parameters
-
- 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
-
key | Key name. |
defValue | Default 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
-
key | Key name |
comment | Comment 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
-
- Returns
- True on success.
◆ removeEntry()
Removes an entry from an index position.
- Parameters
-
index | Position 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
-
key | Name of the key |
value | String 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
-
- Returns
- The passed output stream.
◆ _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: