diff options
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r-- | src/configreader.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index 11aa026c2..c854d2ec4 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -1465,3 +1465,55 @@ InspIRCd* ServerConfig::GetInstance() return ServerInstance; } + +ValueItem::ValueItem(int value) +{ + std::stringstream n; + n << value; + v = n.str(); +} + +ValueItem::ValueItem(bool value) +{ + std::stringstream n; + n << value; + v = n.str(); +} + +ValueItem::ValueItem(char* value) +{ + v = value; +} + +void ValueItem::Set(char* value) +{ + v = value; +} + +void ValueItem::Set(const char* value) +{ + v = value; +} + +void ValueItem::Set(int value) +{ + std::stringstream n; + n << value; + v = n.str(); +} + +int ValueItem::GetInteger() +{ + return atoi(v.c_str()); +} + +char* ValueItem::GetString() +{ + return (char*)v.c_str(); +} + +bool ValueItem::GetBool() +{ + return (GetInteger() || v == "yes" || v == "true"); +} + |