#include <cppcodegenerationpolicy.h>
| CPPCodeGenerationPolicy::CPPCodeGenerationPolicy |
( |
| ) |
|
| CPPCodeGenerationPolicy::~CPPCodeGenerationPolicy |
( |
| ) |
|
|
virtual |
Create a new dialog interface for this object.
- Parameters
-
| parent | the parent widget |
| name | the name of the page |
- Returns
- dialog object
Implements CodeGenPolicyExt.
| bool CPPCodeGenerationPolicy::getAccessorMethodsStartWithUpperCase |
( |
| ) |
|
| bool CPPCodeGenerationPolicy::getAccessorsAreInline |
( |
| ) |
|
Get the value of m_inlineAccessors.
- Returns
- the boolean value of m_inlineAccessors
| bool CPPCodeGenerationPolicy::getAccessorsArePublic |
( |
| ) |
|
Get the value of m_publicAccessors
- Returns
- the boolean value of m_publicAccessors
| bool CPPCodeGenerationPolicy::getAutoGenerateAccessors |
( |
| ) |
|
Get the value of m_autoGenerateAccessors.
- Returns
- the boolean value of m_autoGenerateAccessors
| QString CPPCodeGenerationPolicy::getClassMemberPrefix |
( |
| ) |
|
| bool CPPCodeGenerationPolicy::getDestructorsAreVirtual |
( |
| ) |
|
Get the value of m_virtualDestructors.
- Returns
- the boolean value of m_virtualDestructors
| QString CPPCodeGenerationPolicy::getDocToolTag |
( |
| ) |
|
| bool CPPCodeGenerationPolicy::getGetterWithGetPrefix |
( |
| ) |
|
| 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
| bool CPPCodeGenerationPolicy::getOperationsAreInline |
( |
| ) |
|
Get the value of m_inlineOperations.
- Returns
- the boolean value of m_inlineOperations
| bool CPPCodeGenerationPolicy::getPackageIsNamespace |
( |
| ) |
|
Get the value of m_packageIsNamespace.
- Returns
- the boolean value of m_packageIsNamespace
| bool CPPCodeGenerationPolicy::getRemovePrefixFromAccessorMethods |
( |
| ) |
|
| QString CPPCodeGenerationPolicy::getStringClassName |
( |
| ) |
|
| QString CPPCodeGenerationPolicy::getStringClassNameInclude |
( |
| ) |
|
| QString CPPCodeGenerationPolicy::getVectorClassName |
( |
| ) |
|
| QString CPPCodeGenerationPolicy::getVectorClassNameInclude |
( |
| ) |
|
| 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.
| QString CPPCodeGenerationPolicy::getVectorMethodInit |
( |
const QString & |
variableName = QString(), |
|
|
const QString & |
itemClassName = QString() |
|
) |
| |
| QString CPPCodeGenerationPolicy::getVectorMethodRemove |
( |
const QString & |
variableName = QString(), |
|
|
const QString & |
itemClassName = QString() |
|
) |
| |
| void CPPCodeGenerationPolicy::init |
( |
| ) |
|
|
protected |
| void CPPCodeGenerationPolicy::setAccessorMethodsStartWithUpperCase |
( |
bool |
var | ) |
|
| void CPPCodeGenerationPolicy::setAccessorsAreInline |
( |
bool |
var | ) |
|
Set the value of m_inlineAccessors
- Parameters
-
| void CPPCodeGenerationPolicy::setAccessorsArePublic |
( |
bool |
var | ) |
|
Set the value of publicAccessors
- Parameters
-
| void CPPCodeGenerationPolicy::setAutoGenerateAccessors |
( |
bool |
var | ) |
|
Set the value of m_autoGenerateAccessors.
- Parameters
-
| void CPPCodeGenerationPolicy::setClassMemberPrefix |
( |
const QString & |
value | ) |
|
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 |
| 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.
| void CPPCodeGenerationPolicy::setDestructorsAreVirtual |
( |
bool |
var | ) |
|
Set the value of m_virtualDestructors.
- Parameters
-
| void CPPCodeGenerationPolicy::setDocToolTag |
( |
const QString & |
value | ) |
|
| void CPPCodeGenerationPolicy::setGetterWithGetPrefix |
( |
bool |
var | ) |
|
| void CPPCodeGenerationPolicy::setOperationsAreInline |
( |
bool |
var | ) |
|
Set the value of m_inlineOperations.
- Parameters
-
| void CPPCodeGenerationPolicy::setPackageIsNamespace |
( |
bool |
var | ) |
|
Set the value of m_packageIsNamespace.
- Parameters
-
| void CPPCodeGenerationPolicy::setRemovePrefixFromAccessorMethods |
( |
bool |
var | ) |
|
| 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.
| void CPPCodeGenerationPolicy::setStringClassNameInclude |
( |
const QString & |
value | ) |
|
| void CPPCodeGenerationPolicy::setStringIncludeIsGlobal |
( |
bool |
value | ) |
|
Set flag whether string include is global.
- Parameters
-
| value | the value of the flag |
| void CPPCodeGenerationPolicy::setVectorClassName |
( |
const QString & |
value | ) |
|
| void CPPCodeGenerationPolicy::setVectorClassNameInclude |
( |
const QString & |
value | ) |
|
| void CPPCodeGenerationPolicy::setVectorIncludeIsGlobal |
( |
bool |
value | ) |
|
Set flag whether vector include is global.
- Parameters
-
| value | the value of the flag |
| bool CPPCodeGenerationPolicy::stringIncludeIsGlobal |
( |
| ) |
|
Determine if the string include is global.
- Returns
- value of flag
| bool CPPCodeGenerationPolicy::vectorIncludeIsGlobal |
( |
| ) |
|
Determine if the vector include is global.
- Returns
- value of flag
| const char * CPPCodeGenerationPolicy::DEFAULT_OBJECT_METHOD_INIT = "%VARNAME% = new %ITEMCLASS%();" |
|
static |
| const char * CPPCodeGenerationPolicy::DEFAULT_VECTOR_METHOD_APPEND = "%VARNAME%.push_back(value);" |
|
static |
| const char * CPPCodeGenerationPolicy::DEFAULT_VECTOR_METHOD_INIT = " " |
|
static |
| 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 |
| QString CPPCodeGenerationPolicy::m_objectMethodInitBase |
|
private |
| QString CPPCodeGenerationPolicy::m_vectorMethodAppendBase |
|
private |
| QString CPPCodeGenerationPolicy::m_vectorMethodInitBase |
|
private |
| QString CPPCodeGenerationPolicy::m_vectorMethodRemoveBase |
|
private |
The documentation for this class was generated from the following files: