summaryrefslogtreecommitdiff
path: root/modules/database/db_flatfile.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-01-21 22:31:16 -0500
committerAdam <Adam@anope.org>2013-01-21 22:31:16 -0500
commitddaa001dafb5122e6e363e4acbbe6ce045b7b104 (patch)
tree0364a76606ac6e2881ebd663601ce260f7c1101e /modules/database/db_flatfile.cpp
parent51c049e1a738e9124bab3961f35b830906517421 (diff)
Merge usefulness of Flags and Extensible classes into Extensible, made most flags we have juse strings instead of defines/enums
Diffstat (limited to 'modules/database/db_flatfile.cpp')
-rw-r--r--modules/database/db_flatfile.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/database/db_flatfile.cpp b/modules/database/db_flatfile.cpp
index 6208b7afe..b1f86d984 100644
--- a/modules/database/db_flatfile.cpp
+++ b/modules/database/db_flatfile.cpp
@@ -15,13 +15,19 @@
class SaveData : public Serialize::Data
{
public:
+ Anope::string last;
std::fstream *fs;
SaveData() : fs(NULL) { }
std::iostream& operator[](const Anope::string &key) anope_override
{
- *fs << "\nDATA " << key << " ";
+ if (key != last)
+ {
+ *fs << "\nDATA " << key << " ";
+ last = key;
+ }
+
return *fs;
}
};
@@ -57,6 +63,14 @@ class LoadData : public Serialize::Data
this->ss << this->data[key];
return this->ss;
}
+
+ std::set<Anope::string> KeySet() const anope_override
+ {
+ std::set<Anope::string> keys;
+ for (std::map<Anope::string, Anope::string>::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it)
+ keys.insert(it->first);
+ return keys;
+ }
void Reset()
{