pgLab/pglablib/codebuilder/LanguageConfig.cpp
eelke 0c3bb27e58 Further improvements to codegeneration the defaultcpp config is now called the PgLab
config as it is very specific to the PgLab codebase.

More hard programmed templates moved out of codebuilder to the language config.
2018-09-19 09:55:43 +02:00

60 lines
1.5 KiB
C++

#include "LanguageConfig.h"
#include "NameManglingRules.h"
#include "TypeMappings.h"
LanguageConfig::LanguageConfig() = default;
QString LanguageConfig::columnNameToFieldName(const QString& column_name) const
{
return m_varNaming->transform(column_name);
}
QString LanguageConfig::getTypeName(Oid dbtype) const
{
return m_typeMappings->getTypeForOid(dbtype);
}
void LanguageConfig::setNameManglingRules(std::shared_ptr<const NameManglingRules> name_mangling_rules)
{
m_varNaming = name_mangling_rules;
}
std::shared_ptr<const TypeMappings> LanguageConfig::typeMappings() const
{
return m_typeMappings;
}
void LanguageConfig::setTypeMappings(std::shared_ptr<const TypeMappings> type_mappings)
{
m_typeMappings = type_mappings;
}
std::shared_ptr<const StructureTemplate> LanguageConfig::structureTemplate() const
{
return m_structureTemplate;
}
void LanguageConfig::setStructureTemplate(std::shared_ptr<const StructureTemplate> structure_template)
{
m_structureTemplate = structure_template;
}
std::shared_ptr<const IndentationConfig> LanguageConfig::indentationConfig() const
{
return m_indentationConfig;
}
void LanguageConfig::setIndentationConfig(std::shared_ptr<const IndentationConfig> indentation_config)
{
m_indentationConfig = indentation_config;
}
std::shared_ptr<const ResultLoopTemplate> LanguageConfig::resultLoopTemplate() const
{
return m_resultLoopTemplate;
}
void LanguageConfig::setResultLoopTemplate(std::shared_ptr<const ResultLoopTemplate> result_loop_template)
{
m_resultLoopTemplate = result_loop_template;
}