#include "parser.h"
#include "stg/tariff_conf.h"
+#include "stg/common.h"
#include <string>
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(const TARIFFS & tariffs) : m_tariffs(tariffs) {}
+ explicit FACTORY(const TARIFFS & tariffs) : m_tariffs(tariffs) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new GET_TARIFFS(admin, m_tariffs); }
static void Register(REGISTRY & registry, const TARIFFS & tariffs)
- { registry[tag] = new FACTORY(tariffs); }
+ { registry[ToLower(tag)] = new FACTORY(tariffs); }
private:
const TARIFFS & m_tariffs;
};
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(TARIFFS & tariffs) : m_tariffs(tariffs) {}
+ explicit FACTORY(TARIFFS & tariffs) : m_tariffs(tariffs) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new ADD_TARIFF(admin, m_tariffs); }
static void Register(REGISTRY & registry, TARIFFS & tariffs)
- { registry[tag] = new FACTORY(tariffs); }
+ { registry[ToLower(tag)] = new FACTORY(tariffs); }
private:
TARIFFS & m_tariffs;
};
FACTORY(TARIFFS & tariffs, const USERS & users) : m_tariffs(tariffs), m_users(users) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new DEL_TARIFF(admin, m_users, m_tariffs); }
static void Register(REGISTRY & registry, TARIFFS & tariffs, const USERS & users)
- { registry[tag] = new FACTORY(tariffs, users); }
+ { registry[ToLower(tag)] = new FACTORY(tariffs, users); }
private:
TARIFFS & m_tariffs;
const USERS & m_users;
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(TARIFFS & tariffs) : m_tariffs(tariffs) {}
+ explicit FACTORY(TARIFFS & tariffs) : m_tariffs(tariffs) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new CHG_TARIFF(admin, m_tariffs); }
static void Register(REGISTRY & registry, TARIFFS & tariffs)
- { registry[tag] = new FACTORY(tariffs); }
+ { registry[ToLower(tag)] = new FACTORY(tariffs); }
private:
TARIFFS & m_tariffs;
};