ConfigDataGroup class Store the configuration for a group from the config file. the logic of groups is handled by the Group class the logic of the layout of a group is handled in a sub class of LayoutManager class e.g. TreeLayoutManager.
More...
#include <ConfigDataGroup.hpp>
ConfigDataGroup class Store the configuration for a group from the config file. the logic of groups is handled by the Group class the logic of the layout of a group is handled in a sub class of LayoutManager class e.g. TreeLayoutManager.
◆ ConfigDataGroup()
ConfigDataGroup::ConfigDataGroup |
( |
| ) |
|
int groupBorderSize_
Definition: ConfigDataGroup.hpp:65
unsigned long groupActiveColor_
Definition: ConfigDataGroup.hpp:64
std::string groupName_
Definition: ConfigDataGroup.hpp:61
unsigned long groupInactiveColor_
Definition: ConfigDataGroup.hpp:63
std::string groupLayout_
Definition: ConfigDataGroup.hpp:62
int groupGap_
Definition: ConfigDataGroup.hpp:66
References groupActiveColor_, groupBorderSize_, groupGap_, groupInactiveColor_, groupLayout_, and groupName_.
◆ ~ConfigDataGroup()
ConfigDataGroup::~ConfigDataGroup |
( |
| ) |
|
|
overridedefault |
◆ configInit()
void ConfigDataGroup::configInit |
( |
const Json::Value & |
root | ) |
|
|
overridevirtual |
Initialize the configuration for a group from the config file. must be called after instanciating the object. Parse the Json::Value root and store the values in the object.
- Parameters
-
Implements ConfigDataBase.
42 if (root.empty() || !root.isObject()) {
43 throw std::runtime_error(
"ConfigDataGroup::configInit root is empty or not an object");
45 if (root[
"Name"].empty() || !root[
"Name"].isString()) {
50 if (root[
"Layout"].empty() || !root[
"Layout"].isString()) {
55 if (root[
"Inactive_Color"].empty() || !root[
"Inactive_Color"].isString()) {
61 if (root[
"Active_Color"].empty() || !root[
"Active_Color"].isString()) {
67 if (root[
"Border_Size"].empty() || !root[
"Border_Size"].isInt()) {
72 if (root[
"Gap"].empty() || !root[
"Gap"].isInt()) {
77 std::ostringstream msg;
80 <<
"\tInactive_Color [#" << std::hex << std::setw(6) << std::setfill(
'0') <<
groupInactiveColor_ << std::dec <<
"]"
81 <<
"\tActive_Color [#" << std::hex << std::setw(6) << std::setfill(
'0') <<
groupActiveColor_ << std::dec <<
"]"
84 <<
"-> loaded\t\t[✓]";
@ L_ERROR
Definition: Logger.hpp:51
@ L_INFO
Definition: Logger.hpp:49
static unsigned long colorCodeToULong(const std::string &colorCode)
Convert a string containing a color code to unsigned long.
Definition: ConfigHandler.cpp:94
virtual void Log(const std::string &message, LogLevel level) const
Log a message This method logs a message to the log file or stream. The message is only logged if the...
Definition: Logger.cpp:73
static Logger * GetInstance()
Get the Logger object.
Definition: Logger.cpp:41
References ConfigHandler::colorCodeToULong(), Logger::GetInstance(), groupActiveColor_, groupBorderSize_, groupGap_, groupInactiveColor_, groupLayout_, groupName_, L_ERROR, L_INFO, and Logger::Log().
◆ configSave()
Json::Value ConfigDataGroup::configSave |
( |
| ) |
|
|
overridevirtual |
Build a Json::Value object with the configuration.
- Returns
- Json::Value Object with the current runtime configuration
Implements ConfigDataBase.
◆ getGroupActiveColor()
unsigned long ConfigDataGroup::getGroupActiveColor |
( |
| ) |
const |
◆ getGroupBorderWidth()
int ConfigDataGroup::getGroupBorderWidth |
( |
| ) |
const |
◆ getGroupGap()
int ConfigDataGroup::getGroupGap |
( |
| ) |
const |
◆ getGroupInactiveColor()
unsigned long ConfigDataGroup::getGroupInactiveColor |
( |
| ) |
const |
◆ getGroupLayout()
const std::string & ConfigDataGroup::getGroupLayout |
( |
| ) |
const |
◆ getGroupName()
const std::string & ConfigDataGroup::getGroupName |
( |
| ) |
const |
◆ groupActiveColor_
unsigned long ConfigDataGroup::groupActiveColor_ {} |
|
private |
◆ groupBorderSize_
int ConfigDataGroup::groupBorderSize_ {} |
|
private |
◆ groupGap_
int ConfigDataGroup::groupGap_ {} |
|
private |
◆ groupInactiveColor_
unsigned long ConfigDataGroup::groupInactiveColor_ {} |
|
private |
◆ groupLayout_
std::string ConfigDataGroup::groupLayout_ |
|
private |
◆ groupName_
std::string ConfigDataGroup::groupName_ |
|
private |
The documentation for this class was generated from the following files: