Lot of code for generating code. Working on unit tests.
This commit is contained in:
parent
da45929b12
commit
8f4845d4d2
42 changed files with 1089 additions and 267 deletions
54
pglablib/codebuilder/LanguageConfig.h
Normal file
54
pglablib/codebuilder/LanguageConfig.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue