summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/configreader.h68
-rw-r--r--src/configreader.cpp52
2 files changed, 63 insertions, 57 deletions
diff --git a/include/configreader.h b/include/configreader.h
index e7047b569..f3816ba32 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -45,56 +45,15 @@ class ValueItem
{
std::string v;
public:
- ValueItem(int value)
- {
- std::stringstream n;
- n << value;
- v = n.str();
- }
-
- ValueItem(bool value)
- {
- std::stringstream n;
- n << value;
- v = n.str();
- }
-
- ValueItem(char* value)
- {
- v = value;
- }
-
- void Set(char* value)
- {
- v = value;
- }
-
- void Set(const char* value)
- {
- v = value;
- }
-
- void Set(int value)
- {
- std::stringstream n;
- n << value;
- v = n.str();
- }
-
- int GetInteger()
- {
- return atoi(v.c_str());
- }
-
- char* GetString()
- {
- return (char*)v.c_str();
- }
-
- bool GetBool()
- {
- return (GetInteger() || v == "yes" || v == "true");
- }
+ ValueItem(int value);
+ ValueItem(bool value);
+ ValueItem(char* value);
+ void Set(char* value);
+ void Set(const char* val);
+ void Set(int value);
+ int GetInteger();
+ char* GetString();
+ bool GetBool();
};
/** The base class of the container 'ValueContainer'
@@ -103,13 +62,8 @@ class ValueItem
class ValueContainerBase
{
public:
- ValueContainerBase()
- {
- }
-
- virtual ~ValueContainerBase()
- {
- }
+ ValueContainerBase() { }
+ virtual ~ValueContainerBase() { }
};
/** ValueContainer is used to contain pointers to different
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");
+}
+