11 #ifndef INCLUDED_GR_PREFS_H
12 #define INCLUDED_GR_PREFS_H
84 bool has_option(
const std::string& section,
const std::string& option);
91 const std::string& option,
92 const std::string& default_val);
99 const std::string& option,
100 const std::string& val);
107 get_bool(
const std::string& section,
const std::string& option,
bool default_val);
112 void set_bool(
const std::string& section,
const std::string& option,
bool val);
119 get_long(
const std::string& section,
const std::string& option,
long default_val);
124 void set_long(
const std::string& section,
const std::string& option,
long val);
131 get_double(
const std::string& section,
const std::string& option,
double default_val);
136 void set_double(
const std::string& section,
const std::string& option,
double val);
142 template <
typename T>
144 const std::string& option,
145 const T& default_val);
146 template <
typename T>
147 void set_general(
const std::string& section,
const std::string& option,
const T& val);
151 std::map<std::string, std::map<std::string, std::string>> d_config_map;
Base class for representing user preferences a la windows INI files.
Definition: prefs.h:30
const std::string get_string(const std::string §ion, const std::string &option, const std::string &default_val)
If option exists return associated value; else default_val.
bool has_section(const std::string §ion)
Does section exist?
prefs()
Creates an object to read preference files.
long get_long(const std::string §ion, const std::string &option, long default_val)
If option exists and value can be converted to long, return it; else default_val.
bool has_option(const std::string §ion, const std::string &option)
Does option exist?
std::string to_string()
Returns the configuration options as a string.
T get_general(const std::string §ion, const std::string &option, const T &default_val)
void set_bool(const std::string §ion, const std::string &option, bool val)
Set or add a bool option to section with value val.
std::vector< std::string > _sys_prefs_filenames()
double get_double(const std::string §ion, const std::string &option, double default_val)
If option exists and value can be converted to double, return it; else default_val.
void set_general(const std::string §ion, const std::string &option, const T &val)
char * option_to_env(std::string section, std::string option)
void set_double(const std::string §ion, const std::string &option, double val)
Set or add a double option to section with value val.
static prefs * singleton()
void set_string(const std::string §ion, const std::string &option, const std::string &val)
Set or add a string option to section with value val.
void _read_files(const std::vector< std::string > &filenames)
void set_long(const std::string §ion, const std::string &option, long val)
Set or add a long option to section with value val.
void add_config_file(const std::string &configfile)
bool get_bool(const std::string §ion, const std::string &option, bool default_val)
If option exists and value can be converted to bool, return it; else default_val.
void save()
Saves the configuration settings to ${HOME}/.gnuradio/config.conf.
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:18
boost::mutex mutex
Definition: thread.h:37
GNU Radio logging wrapper.
Definition: basic_block.h:29