undoStudio
The IDE of the undoRT ecosystem
Loading...
Searching...
No Matches
undoStudio::core::settings Namespace Reference

Functions

std::string getString (const std::string &file, const std::string &section, const std::string &key, const std::string &def="")
 Read a string.
 
int getInt (const std::string &file, const std::string &section, const std::string &key, int def)
 Read an integer.
 
std::vector< std::string > getList (const std::string &file, const std::string &section, const std::string &key)
 Read every value of a key, in the order they appear.
 
void setString (const std::string &file, const std::string &section, const std::string &key, const std::string &value)
 Store a string, keeping the rest of the file as it is.
 
void setInt (const std::string &file, const std::string &section, const std::string &key, int value)
 Store an integer.
 
void setList (const std::string &file, const std::string &section, const std::string &key, const std::vector< std::string > &values)
 Replace every value of a key, keeping the rest of the file as it is.
 

Variables

const char *const kCoreFile = "undoStudio.ini"
 The file the core keeps its own state in.
 

Function Documentation

◆ getInt()

int undoStudio::core::settings::getInt ( const std::string &  file,
const std::string &  section,
const std::string &  key,
int  def 
)

Read an integer.

Parameters
fileFile to read
sectionSection to look in
keyKey to look for
defValue to return when it is not there or is not a number
Returns
The stored value, or def

◆ getList()

std::vector< std::string > undoStudio::core::settings::getList ( const std::string &  file,
const std::string &  section,
const std::string &  key 
)

Read every value of a key, in the order they appear.

Parameters
fileFile to read
sectionSection to look in
keyKey to collect
Returns
The values, possibly empty

◆ getString()

std::string undoStudio::core::settings::getString ( const std::string &  file,
const std::string &  section,
const std::string &  key,
const std::string &  def = "" 
)

Read a string.

Parameters
fileFile to read
sectionSection to look in
keyKey to look for
defValue to return when it is not there
Returns
The stored value, or def

◆ setInt()

void undoStudio::core::settings::setInt ( const std::string &  file,
const std::string &  section,
const std::string &  key,
int  value 
)

Store an integer.

Parameters
fileFile to write
sectionSection to write into
keyKey to write
valueValue to store

◆ setList()

void undoStudio::core::settings::setList ( const std::string &  file,
const std::string &  section,
const std::string &  key,
const std::vector< std::string > &  values 
)

Replace every value of a key, keeping the rest of the file as it is.

Parameters
fileFile to write
sectionSection to write into
keyKey to write
valuesValues to store, in order

◆ setString()

void undoStudio::core::settings::setString ( const std::string &  file,
const std::string &  section,
const std::string &  key,
const std::string &  value 
)

Store a string, keeping the rest of the file as it is.

Parameters
fileFile to write
sectionSection to write into, created if it is not there
keyKey to write
valueValue to store

Variable Documentation

◆ kCoreFile

const char *const undoStudio::core::settings::kCoreFile = "undoStudio.ini"

The file the core keeps its own state in.