2018-09-09 18:52:32 +02:00
|
|
|
|
#ifndef LANGUAGECONFIG_H
|
|
|
|
|
|
#define LANGUAGECONFIG_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
#include "Pgsql_oids.h"
|
2018-11-17 10:14:31 +01:00
|
|
|
|
#include "TypeMappings.h"
|
2018-09-09 18:52:32 +02:00
|
|
|
|
|
|
|
|
|
|
class NameManglingRules;
|
|
|
|
|
|
class StructureTemplate;
|
|
|
|
|
|
class IndentationConfig;
|
2018-09-19 09:55:43 +02:00
|
|
|
|
class ResultLoopTemplate;
|
2018-09-09 18:52:32 +02:00
|
|
|
|
/**
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
class LanguageConfig {
|
|
|
|
|
|
public:
|
|
|
|
|
|
LanguageConfig();
|
|
|
|
|
|
|
|
|
|
|
|
QString columnNameToFieldName(const QString& column_name) const;
|
2018-11-17 10:14:31 +01:00
|
|
|
|
TypeMappingResult getTypeName(Oid dbtype) const;
|
2018-09-09 18:52:32 +02:00
|
|
|
|
|
2018-09-19 08:25:58 +02:00
|
|
|
|
void setNameManglingRules(std::shared_ptr<const NameManglingRules> name_mangling_rules);
|
|
|
|
|
|
std::shared_ptr<const TypeMappings> typeMappings() const;
|
|
|
|
|
|
void setTypeMappings(std::shared_ptr<const TypeMappings> type_mappings);
|
|
|
|
|
|
std::shared_ptr<const StructureTemplate> structureTemplate() const;
|
|
|
|
|
|
void setStructureTemplate(std::shared_ptr<const StructureTemplate> structure_template);
|
|
|
|
|
|
std::shared_ptr<const IndentationConfig> indentationConfig() const;
|
|
|
|
|
|
void setIndentationConfig(std::shared_ptr<const IndentationConfig> indentation_config);
|
2018-09-19 09:55:43 +02:00
|
|
|
|
std::shared_ptr<const ResultLoopTemplate> resultLoopTemplate() const;
|
|
|
|
|
|
void setResultLoopTemplate(std::shared_ptr<const ResultLoopTemplate> result_loop_template);
|
2018-09-09 18:52:32 +02:00
|
|
|
|
private:
|
|
|
|
|
|
/** Default template for declaring a variable of the correct type.
|
|
|
|
|
|
* exmaple: "{$type} {$varname};"
|
|
|
|
|
|
*/
|
|
|
|
|
|
//QString varDeclTemplate;
|
|
|
|
|
|
std::shared_ptr<const NameManglingRules> m_varNaming;
|
|
|
|
|
|
std::shared_ptr<const TypeMappings> m_typeMappings;
|
|
|
|
|
|
std::shared_ptr<const StructureTemplate> m_structureTemplate;
|
|
|
|
|
|
std::shared_ptr<const IndentationConfig> m_indentationConfig;
|
2018-09-19 09:55:43 +02:00
|
|
|
|
std::shared_ptr<const ResultLoopTemplate> m_resultLoopTemplate;
|
2018-09-09 18:52:32 +02:00
|
|
|
|
|
|
|
|
|
|
enum class VariableStrategy {
|
|
|
|
|
|
UseLocalVariables,
|
|
|
|
|
|
DeclareClass
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // LANGUAGECONFIG_H
|