aboutsummaryrefslogtreecommitdiffstats
path: root/src/configparser.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2020-10-31 23:21:15 +0000
committerGravatar Sadie Powell2020-10-31 23:21:15 +0000
commit1b181b42b82213c884e8aac3a620252102992439 (patch)
treee1eefa83c074695016e94cb97bb34a24909ebb3d /src/configparser.cpp
parentAdd stdalgo::iterator_range and switch config tag reading to use it. (diff)
downloadinspircd++-1b181b42b82213c884e8aac3a620252102992439.tar.gz
inspircd++-1b181b42b82213c884e8aac3a620252102992439.tar.bz2
inspircd++-1b181b42b82213c884e8aac3a620252102992439.zip
Convert ConfigTag from reference<> to std::shared_ptr<>.
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r--src/configparser.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp
index e045d7e67..9fef22f15 100644
--- a/src/configparser.cpp
+++ b/src/configparser.cpp
@@ -108,7 +108,7 @@ struct Parser
FILE* const file;
FilePosition current;
FilePosition last_tag;
- reference<ConfigTag> tag;
+ std::shared_ptr<ConfigTag> tag;
int ungot;
std::string mandatory_tag;
@@ -382,7 +382,7 @@ struct Parser
}
};
-void ParseStack::DoInclude(ConfigTag* tag, int flags)
+void ParseStack::DoInclude(std::shared_ptr<ConfigTag> tag, int flags)
{
if (flags & FLAG_NO_INC)
throw CoreException("Invalid <include> tag in file included with noinclude=\"yes\"");
@@ -690,9 +690,9 @@ std::string ConfigTag::getTagLocation() const
return src_name + ":" + ConvToStr(src_line);
}
-ConfigTag* ConfigTag::create(const std::string& Tag, const std::string& file, int line, ConfigItems*& Items)
+std::shared_ptr<ConfigTag> ConfigTag::create(const std::string& Tag, const std::string& file, int line, ConfigItems*& Items)
{
- ConfigTag* rv = new ConfigTag(Tag, file, line);
+ std::shared_ptr<ConfigTag> rv(new ConfigTag(Tag, file, line));
Items = &rv->items;
return rv;
}