55 lines
1.2 KiB
C
55 lines
1.2 KiB
C
|
|
#ifndef LANGUAGECONFIG_H
|
|||
|
|
#define LANGUAGECONFIG_H
|
|||
|
|
|
|||
|
|
#include <QString>
|
|||
|
|
#include "Pgsql_oids.h"
|
|||
|
|
|
|||
|
|
class NameManglingRules;
|
|||
|
|
class TypeMappings;
|
|||
|
|
class StructureTemplate;
|
|||
|
|
class IndentationConfig;
|
|||
|
|
/**
|
|||
|
|
*
|
|||
|
|
*/
|
|||
|
|
class LanguageConfig {
|
|||
|
|
public:
|
|||
|
|
LanguageConfig();
|
|||
|
|
|
|||
|
|
QString columnNameToFieldName(const QString& column_name) const;
|
|||
|
|
QString getTypeName(Oid dbtype) const;
|
|||
|
|
|
|||
|
|
std::shared_ptr<const TypeMappings> typeMappings() const { return m_typeMappings; }
|
|||
|
|
void setTypeMappings(std::shared_ptr<const TypeMappings> type_mappings)
|
|||
|
|
{
|
|||
|
|
m_typeMappings = type_mappings;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
std::shared_ptr<const StructureTemplate> structureTemplate() const
|
|||
|
|
{
|
|||
|
|
return m_structureTemplate;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
std::shared_ptr<const IndentationConfig> indentationConfig() const
|
|||
|
|
{
|
|||
|
|
return m_indentationConfig;
|
|||
|
|
}
|
|||
|
|
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;
|
|||
|
|
|
|||
|
|
enum class VariableStrategy {
|
|||
|
|
UseLocalVariables,
|
|||
|
|
DeclareClass
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
#endif // LANGUAGECONFIG_H
|