Conf v1.5.0
Writer Class Referencefinal

Conf writer instance handle. More...

#include <writer.hpp>

Public Member Functions

 Writer (const filesystem::path &filePath)
 Creates a new Conf file writer instance.
 
 ~Writer ()
 Destroys Conf writer instance.
 
void writeComment (const string &comment)
 Writes a comment to the config.
 
void writeNewLine ()
 Writes a new line to the config. ('\n')
 
void write (const string &key, int64_t value)
 Writes an integer value to the config. (int64)
 
void write (const string &key, int32_t value)
 Writes an integer value to the config. (int32)
 
void write (const string &key, uint32_t value)
 Writes an integer value to the config. (uint32)
 
void write (const string &key, int16_t value)
 Writes an integer value to the config. (int16)
 
void write (const string &key, uint16_t value)
 Writes an integer value to the config. (uint16)
 
void write (const string &key, int8_t value)
 Writes an integer value to the config. (int8)
 
void write (const string &key, uint8_t value)
 Writes an integer value to the config. (uint8)
 
void write (const string &key, double value, uint8_t precision=0)
 Writes a floating value to the config. (double)
 
void write (const string &key, float value, uint8_t precision=0)
 Writes a floating value to the config. (float)
 
void write (const string &key, bool value)
 Writes a boolean value to the config.
 
void write (const string &key, string_view value)
 Writes a string value to the config.
 

Detailed Description

Conf writer instance handle.

See the writer.h

Constructor & Destructor Documentation

◆ Writer()

Writer ( const filesystem::path & filePath)
inline

Creates a new Conf file writer instance.

See the createFileConfWriter().

Parameters
[in]filePathtarget Conf file path string
Exceptions
Errorwith a ConfResult string on failure.

◆ ~Writer()

~Writer ( )
inline

Destroys Conf writer instance.

See the destroyConfReader().

Member Function Documentation

◆ writeComment()

void writeComment ( const string & comment)
inline

Writes a comment to the config.

See the writeConfComment().

Parameters
[in]commenttarget comment string
Exceptions
Erroron a comment write failure.

◆ writeNewLine()

void writeNewLine ( )
inline

Writes a new line to the config. ('\n')

See the writeConfNewLine().

Exceptions
Erroron a new line write failure.

◆ write() [1/11]

void write ( const string & key,
int64_t value )
inline

Writes an integer value to the config. (int64)

See the writeConfInt().

Parameters
[in]keytarget item key string
valueinteger item value
Exceptions
Erroron a write failure.

◆ write() [2/11]

void write ( const string & key,
int32_t value )
inline

Writes an integer value to the config. (int32)

See the writeConfInt().

Parameters
[in]keytarget item key string
valueinteger item value
Exceptions
Erroron a write failure.

◆ write() [3/11]

void write ( const string & key,
uint32_t value )
inline

Writes an integer value to the config. (uint32)

See the writeConfInt().

Parameters
[in]keytarget item key string
valueinteger item value
Exceptions
Erroron a write failure.

◆ write() [4/11]

void write ( const string & key,
int16_t value )
inline

Writes an integer value to the config. (int16)

See the writeConfInt().

Parameters
[in]keytarget item key string
valueinteger item value
Exceptions
Erroron a write failure.

◆ write() [5/11]

void write ( const string & key,
uint16_t value )
inline

Writes an integer value to the config. (uint16)

See the writeConfInt().

Parameters
[in]keytarget item key string
valueinteger item value
Exceptions
Erroron a write failure.

◆ write() [6/11]

void write ( const string & key,
int8_t value )
inline

Writes an integer value to the config. (int8)

See the writeConfInt().

Parameters
[in]keytarget item key string
valueinteger item value
Exceptions
Erroron a write failure.

◆ write() [7/11]

void write ( const string & key,
uint8_t value )
inline

Writes an integer value to the config. (uint8)

See the writeConfInt().

Parameters
[in]keytarget item key string
valueinteger item value
Exceptions
Erroron a write failure.

◆ write() [8/11]

void write ( const string & key,
double value,
uint8_t precision = 0 )
inline

Writes a floating value to the config. (double)

See the writeConfFloat().

Parameters
[in]keytarget item key string
valuefloating item value
precisionnumber of digits after the decimal point, or 0 (auto detect).
Exceptions
Erroron a write failure.

◆ write() [9/11]

void write ( const string & key,
float value,
uint8_t precision = 0 )
inline

Writes a floating value to the config. (float)

See the writeConfFloat().

Parameters
[in]keytarget item key string
valuefloating item value
precisionnumber of digits after the decimal point, or 0 (auto detect).
Exceptions
Erroron a write failure.

◆ write() [10/11]

void write ( const string & key,
bool value )
inline

Writes a boolean value to the config.

See the writeConfBool().

Parameters
[in]keytarget item key string
valueboolean item value
Exceptions
Erroron a write failure.

◆ write() [11/11]

void write ( const string & key,
string_view value )
inline

Writes a string value to the config.

See the writeConfString().

Parameters
[in]keytarget item key string
[in]valuestring item value
Exceptions
Erroron a write failure.