Skip to content

Commit

Permalink
include/nutconf.hpp: add BoolInt constructors from supported data typ…
Browse files Browse the repository at this point in the history
…es [networkupstools#2294]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Apr 25, 2024
1 parent 3e35a6d commit fec94d3
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions include/nutconf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,47 @@ class BoolInt

/** Leave all contents un-set */
BoolInt() {}

BoolInt(const bool val) {
*this = val;
}
BoolInt(const bool val, bool newBool01) {
this->bool01 = newBool01;
*this = val;
}

BoolInt(const int val) {
*this = val;
}
BoolInt(const int val, bool newBool01) {
this->bool01 = newBool01;
*this = val;
}

BoolInt(const char* val) {
*this = val;
}
BoolInt(const char* val, bool newBool01) {
this->bool01 = newBool01;
*this = val;
}

BoolInt(const std::string &val) {
*this = val;
}
BoolInt(const std::string &val, bool newBool01) {
this->bool01 = newBool01;
*this = val;
}

BoolInt(const BoolInt& other) {
*this = other;
}
BoolInt(const BoolInt& other, bool newBool01) {
this->bool01 = newBool01;
*this = other;
this->bool01 = newBool01;
}

inline void clear()
{
Expand Down

0 comments on commit fec94d3

Please sign in to comment.