summaryrefslogtreecommitdiff
path: root/src/configparser.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-22 22:29:35 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-22 22:29:35 +0000
commitefc75198ded220f6af88914252c3361f6a5664d9 (patch)
tree0fedc5d95a50b8ce96fe18fede8e63af83c82e4e /src/configparser.cpp
parent4663fd393f925e0ff976dddd8df42cab3e5d2893 (diff)
Make ConfigTag::items private
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11956 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r--src/configparser.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp
index 22c3679ab..44eb117a8 100644
--- a/src/configparser.cpp
+++ b/src/configparser.cpp
@@ -84,7 +84,7 @@ struct Parser
unget(ch);
}
- bool kv()
+ bool kv(std::vector<KeyVal>* items)
{
std::string key;
nextword(key);
@@ -138,7 +138,7 @@ struct Parser
break;
value.push_back(ch);
}
- tag->items.push_back(KeyVal(key, value));
+ items->push_back(KeyVal(key, value));
return true;
}
@@ -157,9 +157,10 @@ struct Parser
if (name.empty())
throw CoreException("Empty tag name");
- tag = new ConfigTag(name, current.filename, current.line);
+ std::vector<KeyVal>* items;
+ tag = ConfigTag::create(name, current.filename, current.line, items);
- while (kv());
+ while (kv(items));
if (name == "include")
{
@@ -376,6 +377,18 @@ std::string ConfigTag::getTagLocation()
return src_name + ":" + ConvToStr(src_line);
}
+ConfigTag* ConfigTag::create(const std::string& Tag, const std::string& file, int line, std::vector<KeyVal>*&items)
+{
+ ConfigTag* rv = new ConfigTag(Tag, file, line);
+ items = &rv->items;
+ return rv;
+}
+
+ConfigTag::ConfigTag(const std::string& Tag, const std::string& file, int line)
+ : tag(Tag), src_name(file), src_line(line)
+{
+}
+
std::string OperInfo::getConfig(const std::string& key)
{
std::string rv;