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
50
pglablib/codebuilder/DefaultConfigs.cpp
Normal file
50
pglablib/codebuilder/DefaultConfigs.cpp
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
#include "DefaultConfigs.h"
|
||||
#include "LanguageConfig.h"
|
||||
#include "TypeMappings.h"
|
||||
#include "Pgsql_oids.h"
|
||||
|
||||
using namespace Pgsql;
|
||||
|
||||
TypeMappings GetDefaultCppTypeMappings()
|
||||
{
|
||||
TypeMappings result = {
|
||||
{ bool_oid, "bool" },
|
||||
{ char_oid, "char" },
|
||||
{ name_oid, "std::string" },
|
||||
{ int8_oid, "int64_t" },
|
||||
{ int2_oid, "int16_t" },
|
||||
{ int4_oid, "int32_t" },
|
||||
{ text_oid, "std::string" },
|
||||
{ oid_oid, "Oid" },
|
||||
{ float4_oid, "float" },
|
||||
{ float8_oid, "double" }
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
std::shared_ptr<LanguageConfig> buildDefaultCppLanguageConfig()
|
||||
{
|
||||
return std::make_shared<LanguageConfig>();
|
||||
}
|
||||
|
||||
std::shared_ptr<const LanguageConfig> getDefaultCppLanguageConfig()
|
||||
{
|
||||
static auto config = buildDefaultCppLanguageConfig();
|
||||
return config;
|
||||
}
|
||||
|
||||
std::shared_ptr<const LanguageConfig> buildPgLabCppLanguageConfig()
|
||||
{
|
||||
auto cfg = buildDefaultCppLanguageConfig();
|
||||
|
||||
return cfg;
|
||||
}
|
||||
|
||||
std::shared_ptr<const LanguageConfig> getPgLabCppLanguageConfig()
|
||||
{
|
||||
static auto config = buildPgLabCppLanguageConfig();
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue