#include <cppcodegenerationpolicy.h>
◆ CPPCodeGenerationPolicy()
CPPCodeGenerationPolicy::CPPCodeGenerationPolicy |
( |
| ) |
|
◆ ~CPPCodeGenerationPolicy()
CPPCodeGenerationPolicy::~CPPCodeGenerationPolicy |
( |
| ) |
|
|
virtual |
◆ createPage()
Create a new dialog interface for this object.
- Parameters
-
parent | the parent widget |
name | the name of the page |
- Returns
- dialog object
Implements CodeGenPolicyExt.
◆ getAccessorMethodsStartWithUpperCase()
bool CPPCodeGenerationPolicy::getAccessorMethodsStartWithUpperCase |
( |
| ) |
|
◆ getAccessorsAreInline()
bool CPPCodeGenerationPolicy::getAccessorsAreInline |
( |
| ) |
|
Get the value of m_inlineAccessors.
- Returns
- the boolean value of m_inlineAccessors
◆ getAccessorsArePublic()
bool CPPCodeGenerationPolicy::getAccessorsArePublic |
( |
| ) |
|
Get the value of m_publicAccessors
- Returns
- the boolean value of m_publicAccessors
◆ getAutoGenerateAccessors()
bool CPPCodeGenerationPolicy::getAutoGenerateAccessors |
( |
| ) |
|
Get the value of m_autoGenerateAccessors.
- Returns
- the boolean value of m_autoGenerateAccessors
◆ getClassMemberPrefix()
QString CPPCodeGenerationPolicy::getClassMemberPrefix |
( |
| ) |
|
◆ getDestructorsAreVirtual()
bool CPPCodeGenerationPolicy::getDestructorsAreVirtual |
( |
| ) |
|
Get the value of m_virtualDestructors.
- Returns
- the boolean value of m_virtualDestructors
◆ getDocToolTag()
QString CPPCodeGenerationPolicy::getDocToolTag |
( |
| ) |
|
◆ getGetterWithGetPrefix()
bool CPPCodeGenerationPolicy::getGetterWithGetPrefix |
( |
| ) |
|
◆ getObjectMethodInit()
QString CPPCodeGenerationPolicy::getObjectMethodInit |
( |
const QString & |
variableName = QString() , |
|
|
const QString & |
itemClassName = QString() |
|
) |
| |
Be somewhat flexible about how new object classes are initialized. Not sure if this should be user configureable. For now, it is not.
- Parameters
-
variableName | variable name |
itemClassName | item class name |
- Returns
- object method init string
◆ getOperationsAreInline()
bool CPPCodeGenerationPolicy::getOperationsAreInline |
( |
| ) |
|
Get the value of m_inlineOperations.
- Returns
- the boolean value of m_inlineOperations
◆ getPackageIsNamespace()
bool CPPCodeGenerationPolicy::getPackageIsNamespace |
( |
| ) |
|
Get the value of m_packageIsNamespace.
- Returns
- the boolean value of m_packageIsNamespace
◆ getRemovePrefixFromAccessorMethods()
bool CPPCodeGenerationPolicy::getRemovePrefixFromAccessorMethods |
( |
| ) |
|
◆ getStringClassName()
QString CPPCodeGenerationPolicy::getStringClassName |
( |
| ) |
|
◆ getStringClassNameInclude()
QString CPPCodeGenerationPolicy::getStringClassNameInclude |
( |
| ) |
|
◆ getVectorClassName()
QString CPPCodeGenerationPolicy::getVectorClassName |
( |
| ) |
|
◆ getVectorClassNameInclude()
QString CPPCodeGenerationPolicy::getVectorClassNameInclude |
( |
| ) |
|
◆ getVectorMethodAppend()
QString CPPCodeGenerationPolicy::getVectorMethodAppend |
( |
const QString & |
variableName = QString() , |
|
|
const QString & |
itemClassName = QString() |
|
) |
| |
More flexible generation. We want to allow the user to specify how the bodies of the vector methods should be auto-generated.
◆ getVectorMethodInit()
QString CPPCodeGenerationPolicy::getVectorMethodInit |
( |
const QString & |
variableName = QString() , |
|
|
const QString & |
itemClassName = QString() |
|
) |
| |
◆ getVectorMethodRemove()
QString CPPCodeGenerationPolicy::getVectorMethodRemove |
( |
const QString & |
variableName = QString() , |
|
|
const QString & |
itemClassName = QString() |
|
) |
| |
◆ init()
void CPPCodeGenerationPolicy::init |
( |
| ) |
|
|
protected |
◆ setAccessorMethodsStartWithUpperCase()
void CPPCodeGenerationPolicy::setAccessorMethodsStartWithUpperCase |
( |
bool |
var | ) |
|
◆ setAccessorsAreInline()
void CPPCodeGenerationPolicy::setAccessorsAreInline |
( |
bool |
var | ) |
|
Set the value of m_inlineAccessors
- Parameters
-
◆ setAccessorsArePublic()
void CPPCodeGenerationPolicy::setAccessorsArePublic |
( |
bool |
var | ) |
|
Set the value of publicAccessors
- Parameters
-
◆ setAutoGenerateAccessors()
void CPPCodeGenerationPolicy::setAutoGenerateAccessors |
( |
bool |
var | ) |
|
Set the value of m_autoGenerateAccessors.
- Parameters
-
◆ setClassMemberPrefix()
void CPPCodeGenerationPolicy::setClassMemberPrefix |
( |
const QString & |
value | ) |
|
◆ setDefaults() [1/2]
void CPPCodeGenerationPolicy::setDefaults |
( |
bool |
emitUpdateSignal = true | ) |
|
|
virtual |
Set the defaults from a config file for this code generator from the passed KConfig pointer.
- Parameters
-
emitUpdateSignal | flag whether to emit update signal |
Implements CodeGenPolicyExt.
◆ setDefaults() [2/2]
Set the defaults for this code generator from the passed generator.
- Parameters
-
cppclone | code generation policy object for cloning |
emitUpdateSignal | flag whether to emit update signal |
◆ setDestructorsAreVirtual()
void CPPCodeGenerationPolicy::setDestructorsAreVirtual |
( |
bool |
var | ) |
|
Set the value of m_virtualDestructors.
- Parameters
-
◆ setDocToolTag()
void CPPCodeGenerationPolicy::setDocToolTag |
( |
const QString & |
value | ) |
|
◆ setGetterWithGetPrefix()
void CPPCodeGenerationPolicy::setGetterWithGetPrefix |
( |
bool |
var | ) |
|
◆ setOperationsAreInline()
void CPPCodeGenerationPolicy::setOperationsAreInline |
( |
bool |
var | ) |
|
Set the value of m_inlineOperations.
- Parameters
-
◆ setPackageIsNamespace()
void CPPCodeGenerationPolicy::setPackageIsNamespace |
( |
bool |
var | ) |
|
Set the value of m_packageIsNamespace.
- Parameters
-
◆ setRemovePrefixFromAccessorMethods()
void CPPCodeGenerationPolicy::setRemovePrefixFromAccessorMethods |
( |
bool |
var | ) |
|
◆ setStringClassName()
void CPPCodeGenerationPolicy::setStringClassName |
( |
const QString & |
value | ) |
|
We want to be flexible about which classes are allowed for generation of the CPP code. In the next 4 method pairs, we give accessors that allow setting and getting the names of the classes, and their include files for string and vectors.
◆ setStringClassNameInclude()
void CPPCodeGenerationPolicy::setStringClassNameInclude |
( |
const QString & |
value | ) |
|
◆ setStringIncludeIsGlobal()
void CPPCodeGenerationPolicy::setStringIncludeIsGlobal |
( |
bool |
value | ) |
|
Set flag whether string include is global.
- Parameters
-
value | the value of the flag |
◆ setVectorClassName()
void CPPCodeGenerationPolicy::setVectorClassName |
( |
const QString & |
value | ) |
|
◆ setVectorClassNameInclude()
void CPPCodeGenerationPolicy::setVectorClassNameInclude |
( |
const QString & |
value | ) |
|
◆ setVectorIncludeIsGlobal()
void CPPCodeGenerationPolicy::setVectorIncludeIsGlobal |
( |
bool |
value | ) |
|
Set flag whether vector include is global.
- Parameters
-
value | the value of the flag |
◆ stringIncludeIsGlobal()
bool CPPCodeGenerationPolicy::stringIncludeIsGlobal |
( |
| ) |
|
Determine if the string include is global.
- Returns
- value of flag
◆ vectorIncludeIsGlobal()
bool CPPCodeGenerationPolicy::vectorIncludeIsGlobal |
( |
| ) |
|
Determine if the vector include is global.
- Returns
- value of flag
◆ DEFAULT_OBJECT_METHOD_INIT
const char * CPPCodeGenerationPolicy::DEFAULT_OBJECT_METHOD_INIT = "%VARNAME% = new %ITEMCLASS%();" |
|
static |
◆ DEFAULT_VECTOR_METHOD_APPEND
const char * CPPCodeGenerationPolicy::DEFAULT_VECTOR_METHOD_APPEND = "%VARNAME%.push_back(value);" |
|
static |
◆ DEFAULT_VECTOR_METHOD_INIT
const char * CPPCodeGenerationPolicy::DEFAULT_VECTOR_METHOD_INIT = " " |
|
static |
◆ DEFAULT_VECTOR_METHOD_REMOVE
const char * CPPCodeGenerationPolicy::DEFAULT_VECTOR_METHOD_REMOVE = "int size = %VARNAME%.size();\nfor (int i = 0; i < size; ++i) {\n\t%ITEMCLASS% item = %VARNAME%.at(i);\n\tif(item == value) {\n\t\tvector<%ITEMCLASS%>::iterator it = %VARNAME%.begin() + i;\n\t\t%VARNAME%.erase(it);\n\t\treturn;\n\t}\n }" |
|
static |
◆ m_objectMethodInitBase
QString CPPCodeGenerationPolicy::m_objectMethodInitBase |
|
private |
◆ m_vectorMethodAppendBase
QString CPPCodeGenerationPolicy::m_vectorMethodAppendBase |
|
private |
◆ m_vectorMethodInitBase
QString CPPCodeGenerationPolicy::m_vectorMethodInitBase |
|
private |
◆ m_vectorMethodRemoveBase
QString CPPCodeGenerationPolicy::m_vectorMethodRemoveBase |
|
private |
The documentation for this class was generated from the following files: