mirror of
https://github.com/anope/anope.git
synced 2026-06-30 02:36:38 +02:00
That doesn't work either, just don't use references.
find ./ -name '*.cpp' -exec sed -i 's/Get<const Anope::string\&>/Get<const Anope::string>/g' {} \;
This commit is contained in:
@@ -119,7 +119,7 @@ class DBFlatFile : public Module, public Pipe
|
||||
const std::vector<Anope::string> &type_order = Serialize::Type::GetTypeOrder();
|
||||
|
||||
std::set<Anope::string> dbs;
|
||||
dbs.insert(Config->GetModule(this)->Get<const Anope::string &>("database"));
|
||||
dbs.insert(Config->GetModule(this)->Get<const Anope::string>("database"));
|
||||
|
||||
for (unsigned i = 0; i < type_order.size(); ++i)
|
||||
{
|
||||
@@ -195,7 +195,7 @@ class DBFlatFile : public Module, public Pipe
|
||||
const std::vector<Anope::string> &type_order = Serialize::Type::GetTypeOrder();
|
||||
std::set<Anope::string> tried_dbs;
|
||||
|
||||
const Anope::string &db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string &>("database");
|
||||
const Anope::string &db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string>("database");
|
||||
|
||||
std::fstream fd(db_name.c_str(), std::ios_base::in);
|
||||
if (!fd.is_open())
|
||||
@@ -272,7 +272,7 @@ class DBFlatFile : public Module, public Pipe
|
||||
if (s_type->GetOwner())
|
||||
db_name = Anope::DataDir + "/module_" + s_type->GetOwner()->name + ".db";
|
||||
else
|
||||
db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string &>("database");
|
||||
db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string>("database");
|
||||
|
||||
if (Anope::IsFile(db_name))
|
||||
rename(db_name.c_str(), (db_name + ".tmp").c_str());
|
||||
@@ -304,7 +304,7 @@ class DBFlatFile : public Module, public Pipe
|
||||
for (std::map<Module *, std::fstream *>::iterator it = databases.begin(), it_end = databases.end(); it != it_end; ++it)
|
||||
{
|
||||
std::fstream *f = it->second;
|
||||
const Anope::string &db_name = Anope::DataDir + "/" + (it->first ? (it->first->name + ".db") : Config->GetModule(this)->Get<const Anope::string &>("database"));
|
||||
const Anope::string &db_name = Anope::DataDir + "/" + (it->first ? (it->first->name + ".db") : Config->GetModule(this)->Get<const Anope::string>("database"));
|
||||
|
||||
if (!f->is_open() || !f->good())
|
||||
{
|
||||
@@ -349,7 +349,7 @@ class DBFlatFile : public Module, public Pipe
|
||||
if (stype->GetOwner())
|
||||
db_name = Anope::DataDir + "/module_" + stype->GetOwner()->name + ".db";
|
||||
else
|
||||
db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string &>("database");
|
||||
db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string>("database");
|
||||
|
||||
std::fstream fd(db_name.c_str(), std::ios_base::in);
|
||||
if (!fd.is_open())
|
||||
|
||||
@@ -1098,7 +1098,7 @@ class DBOld : public Module
|
||||
Implementation i[] = { I_OnLoadDatabase, I_OnUplinkSync };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
|
||||
hashm = Config->GetModule(this)->Get<const Anope::string &>("hash");
|
||||
hashm = Config->GetModule(this)->Get<const Anope::string>("hash");
|
||||
|
||||
if (hashm != "md5" && hashm != "oldmd5" && hashm != "sha1" && hashm != "plain" && hashm != "sha256")
|
||||
throw ModuleException("Invalid hash method");
|
||||
|
||||
@@ -637,7 +637,7 @@ class DBPlain : public Module
|
||||
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
DatabaseFile = Anope::DataDir + "/" + conf->GetModule(this)->Get<const Anope::string &>("database");
|
||||
DatabaseFile = Anope::DataDir + "/" + conf->GetModule(this)->Get<const Anope::string>("database");
|
||||
if (DatabaseFile.empty())
|
||||
DatabaseFile = "anope.db";
|
||||
BackupFile = Anope::DataDir + "/backups/" + DatabaseFile;
|
||||
|
||||
@@ -149,8 +149,8 @@ class DBSQL : public Module, public Pipe
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
Configuration::Block *block = conf->GetModule(this);
|
||||
this->sql = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string &>("engine"));
|
||||
this->prefix = block->Get<const Anope::string &>("prefix", "anope_db_");
|
||||
this->sql = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string>("engine"));
|
||||
this->prefix = block->Get<const Anope::string>("prefix", "anope_db_");
|
||||
this->import = block->Get<bool>("import");
|
||||
}
|
||||
|
||||
|
||||
@@ -131,8 +131,8 @@ class DBMySQL : public Module, public Pipe
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
Configuration::Block *block = conf->GetModule(this);
|
||||
this->SQL = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string &>("engine"));
|
||||
this->prefix = block->Get<const Anope::string &>("prefix", "anope_db_");
|
||||
this->SQL = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string>("engine"));
|
||||
this->prefix = block->Get<const Anope::string>("prefix", "anope_db_");
|
||||
}
|
||||
|
||||
void OnSerializableConstruct(Serializable *obj) anope_override
|
||||
|
||||
Reference in New Issue
Block a user