1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 14:26:38 +02:00

Remove the remaining istream use in Data.

This commit is contained in:
Sadie Powell
2026-03-26 15:48:52 +00:00
parent 85a32077b5
commit 5355b53008
10 changed files with 111 additions and 87 deletions
+8 -5
View File
@@ -21,7 +21,6 @@ public:
std::fstream *fs;
Serializable::Id id = 0;
std::map<Anope::string, Anope::string> data;
std::stringstream ss;
bool read = false;
LoadData(std::fstream &fsref)
@@ -29,7 +28,7 @@ public:
{
}
std::iostream &operator[](const Anope::string &key) override
bool LoadInternal(const Anope::string &key, Anope::string &value) override
{
if (!read)
{
@@ -51,9 +50,13 @@ public:
read = true;
}
ss.clear();
this->ss << this->data[key];
return this->ss;
value = this->data[key];
return true;
}
bool StoreInternal(const Anope::string &key, const Anope::string &value) override
{
return false; // This module can only load data.
}
size_t Hash() const override