Files
@ 34ec0df769f1
Branch filter:
Location: libtransport.git/src/storagebackend.cpp - annotation
34ec0df769f1
1.4 KiB
text/x-c++hdr
avoid WTF-8.
what arrives from XMPP is already UTF-8 encoded, so applying UTF-8 again
produces somewhat unfortunate results.
this line is not always necessary. before this change, the code was
dependent on the locale.
what arrives from XMPP is already UTF-8 encoded, so applying UTF-8 again
produces somewhat unfortunate results.
this line is not always necessary. before this change, the code was
dependent on the locale.
a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e a06a47ed110e | #include "transport/storagebackend.h"
#include "transport/config.h"
#include "transport/sqlite3backend.h"
#include "transport/mysqlbackend.h"
#include "transport/pqxxbackend.h"
namespace Transport {
StorageBackend *StorageBackend::createBackend(Config *config, std::string &error) {
StorageBackend *storageBackend = NULL;
#ifdef WITH_SQLITE
if (CONFIG_STRING(config, "database.type") == "sqlite3") {
storageBackend = new SQLite3Backend(config);
}
#else
if (CONFIG_STRING(config, "database.type") == "sqlite3") {
error = "Libtransport is not compiled with sqlite3 backend support.";
}
#endif
#ifdef WITH_MYSQL
if (CONFIG_STRING(config, "database.type") == "mysql") {
storageBackend = new MySQLBackend(config);
}
#else
if (CONFIG_STRING(config, "database.type") == "mysql") {
error = "Spectrum2 is not compiled with mysql backend support.";
}
#endif
#ifdef WITH_PQXX
if (CONFIG_STRING(config, "database.type") == "pqxx") {
storageBackend = new PQXXBackend(config);
}
#else
if (CONFIG_STRING(config, "database.type") == "pqxx") {
error = "Spectrum2 is not compiled with pqxx backend support.";
}
#endif
if (CONFIG_STRING(config, "database.type") != "mysql" && CONFIG_STRING(config, "database.type") != "sqlite3"
&& CONFIG_STRING(config, "database.type") != "pqxx" && CONFIG_STRING(config, "database.type") != "none") {
error = "Unknown storage backend " + CONFIG_STRING(config, "database.type");
}
return storageBackend;
}
}
|