![]() |
PhoenixGenerator
2.0.0
Set of tools to generate code
|
Go to the source code of this file.
Functions | |
void | checkClassConfig (bool &hasSource, bool &hasTemplate, const std::vector< PClassConfig > &classConfig) |
Check if the configuration has source or template to determine if the .cpp or _impl.h files have to be generated. More... | |
PString | createGetterDecl (const PString &varType, const PString &varName, const PString &className, bool isConst, bool isPtr) |
Creates a function decl for setters. More... | |
PString | createSetterDecl (const PString &varType, const PString &varName, const PString &className, bool isPtr) |
Creates a function decl for setters. More... | |
PString | getClassDeclTempalteDef (const PVecString &listTemplate) |
Get the template definition in the class declaration. More... | |
PString | getClassDefTemplate (const PVecString &listTemplate) |
Get the template call in the class declaration. More... | |
PString | getDefaultValueTypeInCpp (const PString &type) |
Get the default value of a type in C++. More... | |
bool | getIsPointer (const PString &varType) |
Check if the given type is a pointer or not. More... | |
bool | getIsSimpleType (const PString &varType) |
Check if the given type is a simple type. More... | |
PString | makeVarType (const PString &varType, bool isSetter, bool isConst, bool isRef, bool isPtr) |
Makes the var type by taking account of the type. More... | |
void | saveClassConstructorImpl (std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration) |
Saves constructor of the class. More... | |
void | saveClassCopyConstructorImpl (std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration) |
Saves copy constructor of the class. More... | |
void | saveClassCopyFunctionImpl (std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration) |
Saves the copy function of a class. More... | |
void | saveClassDataStreamGenericFunction (std::ofstream &fs, const PClassConfig &classConfig) |
Creates the method which enable to save/load generated class with any kind of stream/message/file. More... | |
void | saveClassDataStreamMethod (std::ofstream &fs, const PClassConfig &classConfig) |
Creates the method which enable to save/load generated class with any kind of stream/message/file. More... | |
bool | saveClassDecl (const std::vector< PClassConfig > &classConfig, const PPath &headerFile, const PVecPath &listInclude, bool enableDataStream, bool enableTypeStream, const PString &includeTemplate) |
Creates header file. More... | |
void | saveClassDecl (std::ofstream &fs, const PClassConfig &classConfig, bool enableDataStream, bool enableTypeStream) |
Creates header file. More... | |
void | saveClassDestructorImpl (std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration) |
Saves destructor of the class. More... | |
void | saveClassEqualOperatorImpl (std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration) |
Saves = operator of the class. More... | |
void | saveClassGettersImpl (std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration) |
Saves the class getters implementation. More... | |
void | saveClassGetTypeNameImpl (std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration, bool enableTypeStream) |
Saves constructor of the class. More... | |
bool | saveClassImpl (const std::vector< PClassConfig > &classConfig, const PPath &sourceFile, const PPath &headerFile, bool enableTypeStream) |
Creates source file. More... | |
void | saveClassImpl (std::ofstream &fs, const PClassConfig &classConfig, bool enableTypeStream) |
Creates source file. More... | |
bool | saveClassImplDecl (const std::vector< PClassConfig > &classConfig, const PPath &baseFileName, const PVecPath &listInclude, bool enableDataStream, bool enableTypeStream) |
Creates header file. More... | |
void | saveClassInitialisationFunctionImpl (std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration) |
Saves the copy function of a class. More... | |
void | saveClassSettersImpl (std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration) |
Saves the class setters implementation. More... | |
bool | saveClassTemplate (const std::vector< PClassConfig > &classConfig, const PPath &sourceFile, const PPath &headerFile) |
Creates template implementation file. More... | |
void | saveClassTemplate (std::ofstream &fs, const PClassConfig &classConfig) |
Creates template implementation file. More... | |
void | saveDeclGetters (std::ofstream &fs, const PClassConfig &classConfig) |
Creates getters header file. More... | |
void | saveDeclSetters (std::ofstream &fs, const PClassConfig &classConfig) |
Creates setters header file. More... | |
void | saveEnumDecl (std::ofstream &fs, const PClassConfig &classConfig, bool enableDataStream, bool enableTypeStream) |
Creates header file. More... | |
void checkClassConfig | ( | bool & | hasSource, |
bool & | hasTemplate, | ||
const std::vector< PClassConfig > & | classConfig | ||
) |
Check if the configuration has source or template to determine if the .cpp or _impl.h files have to be generated.
[out] | hasSource | : true if the configuration needs .cpp file |
[out] | hasTemplate | : true if the configuration needs _impl.h file |
classConfig | : class config we want to save |
Definition at line 710 of file saveClassConfig.cpp.
Referenced by saveClassImplDecl().
PString createGetterDecl | ( | const PString & | varType, |
const PString & | varName, | ||
const PString & | className, | ||
bool | isConst, | ||
bool | isPtr | ||
) |
Creates a function decl for setters.
varType | : type of the var to set |
varName | : name of the var to set |
className | : name of the class |
isConst | : true if the function must be const |
isPtr | : true if te variable is a pointer |
Definition at line 102 of file saveClassConfig.cpp.
References PString::firstToUpper(), and makeVarType().
Referenced by saveClassGettersImpl(), and saveDeclGetters().
PString createSetterDecl | ( | const PString & | varType, |
const PString & | varName, | ||
const PString & | className, | ||
bool | isPtr | ||
) |
Creates a function decl for setters.
varType | : type of the var to set |
varName | : name of the var to set |
className | : name of the class |
isPtr | : true if te variable is a pointer |
Definition at line 85 of file saveClassConfig.cpp.
References PString::firstToUpper(), and makeVarType().
Referenced by saveClassSettersImpl(), and saveDeclSetters().
PString getClassDeclTempalteDef | ( | const PVecString & | listTemplate | ) |
Get the template definition in the class declaration.
listTemplate | : list of template def |
Definition at line 180 of file saveClassConfig.cpp.
Referenced by saveClassDecl(), and saveClassTemplate().
PString getClassDefTemplate | ( | const PVecString & | listTemplate | ) |
Get the template call in the class declaration.
listTemplate | : list of template def |
Definition at line 197 of file saveClassConfig.cpp.
References PString::split().
Referenced by saveClassDecl(), and saveClassTemplate().
Get the default value of a type in C++.
type | : type to be converted |
Definition at line 33 of file saveClassConfig.cpp.
Referenced by saveClassInitialisationFunctionImpl().
bool getIsPointer | ( | const PString & | varType | ) |
Check if the given type is a pointer or not.
varType | : type to be checked |
Definition at line 24 of file saveClassConfig.cpp.
References PString::find().
Referenced by saveClassInitialisationFunctionImpl().
bool getIsSimpleType | ( | const PString & | varType | ) |
Check if the given type is a simple type.
varType | : type to be checked |
Definition at line 15 of file saveClassConfig.cpp.
References PString::eraseChar(), and PString::replace().
Referenced by createCheckClassEquality(), makeVarType(), project_wrapper_attributeDef(), project_wrapper_classAttributeFromMessage(), project_wrapper_classAttributeGetSize(), project_wrapper_classAttributeToMessage(), project_wrapper_classGetterSetterDef(), project_wrapper_classImpl(), project_wrapper_classImplCheck(), project_wrapper_classImplDealloc(), project_wrapper_classImplGetterSetter(), project_wrapper_classImplNewc(), and saveClassInitialisationFunctionImpl().
PString makeVarType | ( | const PString & | varType, |
bool | isSetter, | ||
bool | isConst, | ||
bool | isRef, | ||
bool | isPtr | ||
) |
Makes the var type by taking account of the type.
varType | : variable type name |
isSetter | : true if the type is made for a setter |
isConst | : true if the type must be const |
isRef | : true if the variable is a reference |
isPtr | : true if te variable is a pointer |
Definition at line 63 of file saveClassConfig.cpp.
References getIsSimpleType().
Referenced by createGetterDecl(), and createSetterDecl().
void saveClassConstructorImpl | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig, | ||
const PString & | defTemplate, | ||
const PString & | templateDeclaration | ||
) |
Saves constructor of the class.
[out] | fs | : header file name |
classConfig | : PClassConfig we vant to save | |
defTemplate | : extra template definition for the class name space | |
templateDeclaration | : basic template declaration before each method (template< ... >) |
Definition at line 388 of file saveClassConfig.cpp.
References PClassConfig::getListParentClass(), and PClassConfig::getName().
Referenced by saveClassImpl(), and saveClassTemplate().
void saveClassCopyConstructorImpl | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig, | ||
const PString & | defTemplate, | ||
const PString & | templateDeclaration | ||
) |
Saves copy constructor of the class.
[out] | fs | : header file name |
classConfig | : PClassConfig we vant to save | |
defTemplate | : extra template definition for the class name space | |
templateDeclaration | : basic template declaration before each method (template< ... >) |
Definition at line 415 of file saveClassConfig.cpp.
References PClassConfig::getName().
Referenced by saveClassImpl(), and saveClassTemplate().
void saveClassCopyFunctionImpl | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig, | ||
const PString & | defTemplate, | ||
const PString & | templateDeclaration | ||
) |
Saves the copy function of a class.
[out] | fs | : header file name |
classConfig | : PClassConfig we vant to save | |
defTemplate | : extra template definition for the class name space | |
templateDeclaration | : basic template declaration before each method (template< ... >) |
Definition at line 511 of file saveClassConfig.cpp.
References PClassConfig::getListAttribute(), and PClassConfig::getName().
Referenced by saveClassImpl(), and saveClassTemplate().
void saveClassDataStreamGenericFunction | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig | ||
) |
Creates the method which enable to save/load generated class with any kind of stream/message/file.
[out] | fs | : header file name |
classConfig | : class config we want to save |
Definition at line 161 of file saveClassConfig.cpp.
References PClassConfig::getName().
Referenced by saveClassDecl().
void saveClassDataStreamMethod | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig | ||
) |
Creates the method which enable to save/load generated class with any kind of stream/message/file.
[out] | fs | : header file name |
classConfig | : class config we want to save |
Definition at line 137 of file saveClassConfig.cpp.
References PClassConfig::getListAttribute(), and PClassConfig::getName().
Referenced by saveClassDecl().
bool saveClassDecl | ( | const std::vector< PClassConfig > & | classConfig, |
const PPath & | headerFile, | ||
const PVecPath & | listInclude, | ||
bool | enableDataStream, | ||
bool | enableTypeStream, | ||
const PString & | includeTemplate | ||
) |
Creates header file.
classConfig | : class config we want to save |
headerFile | : header file name |
listInclude | : list of the include files |
enableDataStream | : true to enable the serialization/deserialization with DataStream, false otherwise |
enableTypeStream | : true to enable the phoenix_getTypeName function creation |
includeTemplate | : include to the template implementation file |
Definition at line 587 of file saveClassConfig.cpp.
References PPath::getFileName(), licenceSave(), makeMultiIncludeDefineMacro(), saveClassDecl(), and saveEnumDecl().
void saveClassDecl | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig, | ||
bool | enableDataStream, | ||
bool | enableTypeStream | ||
) |
Creates header file.
[out] | fs | : header file name |
classConfig | : class config we want to save | |
enableDataStream | : true to enable the serialization/deserialization with DataStream, false otherwise | |
enableTypeStream | : true to enable the phoenix_getTypeName function creation |
Definition at line 279 of file saveClassConfig.cpp.
References getClassDeclTempalteDef(), getClassDefTemplate(), PClassConfig::getClassDocumentation(), PClassConfig::getListAttribute(), PClassConfig::getListParentClass(), PClassConfig::getListTemplate(), PClassConfig::getName(), saveClassDataStreamGenericFunction(), saveClassDataStreamMethod(), saveDeclGetters(), saveDeclSetters(), and PString::split().
Referenced by saveClassDecl(), and saveClassImplDecl().
void saveClassDestructorImpl | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig, | ||
const PString & | defTemplate, | ||
const PString & | templateDeclaration | ||
) |
Saves destructor of the class.
[out] | fs | : header file name |
classConfig | : PClassConfig we vant to save | |
defTemplate | : extra template definition for the class name space | |
templateDeclaration | : basic template declaration before each method (template< ... >) |
Definition at line 432 of file saveClassConfig.cpp.
References PClassConfig::getName().
Referenced by saveClassImpl(), and saveClassTemplate().
void saveClassEqualOperatorImpl | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig, | ||
const PString & | defTemplate, | ||
const PString & | templateDeclaration | ||
) |
Saves = operator of the class.
[out] | fs | : header file name |
classConfig | : PClassConfig we vant to save | |
defTemplate | : extra template definition for the class name space | |
templateDeclaration | : basic template declaration before each method (template< ... >) |
Definition at line 447 of file saveClassConfig.cpp.
References PClassConfig::getName().
Referenced by saveClassImpl(), and saveClassTemplate().
void saveClassGettersImpl | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig, | ||
const PString & | defTemplate, | ||
const PString & | templateDeclaration | ||
) |
Saves the class getters implementation.
[out] | fs | : header file name |
classConfig | : PClassConfig we vant to save | |
defTemplate | : extra template definition for the class name space | |
templateDeclaration | : basic template declaration before each method (template< ... >) |
Definition at line 485 of file saveClassConfig.cpp.
References createGetterDecl(), PClassConfig::getListAttribute(), and PClassConfig::getName().
Referenced by saveClassImpl(), and saveClassTemplate().
void saveClassGetTypeNameImpl | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig, | ||
const PString & | defTemplate, | ||
const PString & | templateDeclaration, | ||
bool | enableTypeStream | ||
) |
Saves constructor of the class.
[out] | fs | : header file name |
classConfig | : PClassConfig we vant to save | |
defTemplate | : extra template definition for the class name space | |
templateDeclaration | : basic template declaration before each method (template< ... >) | |
enableTypeStream | : true to enable the phoenix_getTypeName function creation |
Definition at line 357 of file saveClassConfig.cpp.
References PClassConfig::getListTemplate(), PClassConfig::getName(), and PString::split().
Referenced by saveClassImpl().
bool saveClassImpl | ( | const std::vector< PClassConfig > & | classConfig, |
const PPath & | sourceFile, | ||
const PPath & | headerFile, | ||
bool | enableTypeStream | ||
) |
Creates source file.
classConfig | : class config we want to save |
sourceFile | : source file name |
headerFile | : header file name |
enableTypeStream | : true to enable the phoenix_getTypeName function creation |
Definition at line 638 of file saveClassConfig.cpp.
References PPath::getFileName(), licenceSave(), and saveClassImpl().
void saveClassImpl | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig, | ||
bool | enableTypeStream | ||
) |
Creates source file.
[out] | fs | : source file |
classConfig | : PClassConfig we vant to save | |
enableTypeStream | : true to enable the phoenix_getTypeName function creation |
Definition at line 566 of file saveClassConfig.cpp.
References saveClassConstructorImpl(), saveClassCopyConstructorImpl(), saveClassCopyFunctionImpl(), saveClassDestructorImpl(), saveClassEqualOperatorImpl(), saveClassGettersImpl(), saveClassGetTypeNameImpl(), saveClassInitialisationFunctionImpl(), and saveClassSettersImpl().
Referenced by saveClassImpl(), and saveClassImplDecl().
bool saveClassImplDecl | ( | const std::vector< PClassConfig > & | classConfig, |
const PPath & | baseFileName, | ||
const PVecPath & | listInclude, | ||
bool | enableDataStream, | ||
bool | enableTypeStream | ||
) |
Creates header file.
classConfig | : class config we want to save |
baseFileName | : base file name for header or source file |
listInclude | : list of the include files |
enableDataStream | : true to enable the serialization/deserialization with DataStream, false otherwise |
enableTypeStream | : true to enable the phoenix_getTypeName function creation |
Definition at line 728 of file saveClassConfig.cpp.
References checkClassConfig(), PPath::getFileName(), saveClassDecl(), saveClassImpl(), and saveClassTemplate().
Referenced by saveParserClassConfig().
void saveClassInitialisationFunctionImpl | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig, | ||
const PString & | defTemplate, | ||
const PString & | templateDeclaration | ||
) |
Saves the copy function of a class.
[out] | fs | : header file name |
classConfig | : PClassConfig we vant to save | |
defTemplate | : extra template definition for the class name space | |
templateDeclaration | : basic template declaration before each method (template< ... >) |
Definition at line 531 of file saveClassConfig.cpp.
References getDefaultValueTypeInCpp(), getIsPointer(), getIsSimpleType(), PClassConfig::getListAttribute(), and PClassConfig::getName().
Referenced by saveClassImpl(), and saveClassTemplate().
void saveClassSettersImpl | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig, | ||
const PString & | defTemplate, | ||
const PString & | templateDeclaration | ||
) |
Saves the class setters implementation.
[out] | fs | : header file name |
classConfig | : PClassConfig we want to save | |
defTemplate | : extra template definition for the class name space | |
templateDeclaration | : basic template declaration before each method (template< ... >) |
Definition at line 466 of file saveClassConfig.cpp.
References createSetterDecl(), PClassConfig::getListAttribute(), and PClassConfig::getName().
Referenced by saveClassImpl(), and saveClassTemplate().
bool saveClassTemplate | ( | const std::vector< PClassConfig > & | classConfig, |
const PPath & | sourceFile, | ||
const PPath & | headerFile | ||
) |
Creates template implementation file.
classConfig | : class config we want to save |
sourceFile | : source file name |
headerFile | : header file name |
Definition at line 684 of file saveClassConfig.cpp.
References PPath::getFileName(), licenceSave(), makeMultiIncludeDefineMacro(), and saveClassTemplate().
void saveClassTemplate | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig | ||
) |
Creates template implementation file.
[out] | fs | : template implementation file |
classConfig | : PClassConfig we vant to save |
Definition at line 661 of file saveClassConfig.cpp.
References getClassDeclTempalteDef(), getClassDefTemplate(), PClassConfig::getListTemplate(), saveClassConstructorImpl(), saveClassCopyConstructorImpl(), saveClassCopyFunctionImpl(), saveClassDestructorImpl(), saveClassEqualOperatorImpl(), saveClassGettersImpl(), saveClassInitialisationFunctionImpl(), and saveClassSettersImpl().
Referenced by saveClassImplDecl(), and saveClassTemplate().
void saveDeclGetters | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig | ||
) |
Creates getters header file.
[out] | fs | : header file name |
classConfig | : class config we want to save |
Definition at line 125 of file saveClassConfig.cpp.
References createGetterDecl(), and PClassConfig::getListAttribute().
Referenced by saveClassDecl().
void saveDeclSetters | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig | ||
) |
Creates setters header file.
[out] | fs | : header file name |
classConfig | : class config we want to save |
Definition at line 114 of file saveClassConfig.cpp.
References createSetterDecl(), and PClassConfig::getListAttribute().
Referenced by saveClassDecl().
void saveEnumDecl | ( | std::ofstream & | fs, |
const PClassConfig & | classConfig, | ||
bool | enableDataStream, | ||
bool | enableTypeStream | ||
) |
Creates header file.
[out] | fs | : header file name |
classConfig | : class config we want to save | |
enableDataStream | : true to enable the serialization/deserialization with DataStream, false otherwise | |
enableTypeStream | : true to enable the phoenix_getTypeName function creation |
Definition at line 213 of file saveClassConfig.cpp.
References PClassConfig::getClassDocumentation(), PClassConfig::getListAttribute(), and PClassConfig::getName().
Referenced by saveClassDecl().