#include <codegenerationpolicy.h>
|
enum | OverwritePolicy { Ok =0
, Ask
, Never
, Cancel
} |
|
enum | ModifyNamePolicy { No =0
, Underscore
, Capitalise
} |
|
enum | NewLineType { UNIX =0
, DOS
, MAC
} |
|
enum | IndentationType { NONE =0
, TAB
, SPACE
} |
|
enum | CommentStyle { SingleLine =0
, MultiLine
} |
|
class CodeGenerationPolicy This class describes the code generation policy for this project. Note that as the code gen policy may be the 'default' policy, it may not be coupled with a code generator.
◆ CommentStyle
Enumerator |
---|
SingleLine | |
MultiLine | |
◆ IndentationType
◆ ModifyNamePolicy
Enumerator |
---|
No | |
Underscore | |
Capitalise | |
◆ NewLineType
◆ OverwritePolicy
OverwritePolicy can have the following values
- Ok: if there is a file named the same as what you want to name your output file, you can overwrite the old file.
- Ask:if there is a file named the same as what you want to name your output file, you should ask the User what to do, and give him the option to overwrite the file write the code to a different file, or to abort the generation of this class.
- Never: you cannot overwrite any files. Generates a new file name like "fileName1.h", "fileName2.h" until you find an appropriate name.
- Cancel: Do not output anything. This is only set if the user chooses Apply to All Remaining Files and clicks on Do not Output in the Ask dialog
Enumerator |
---|
Ok | |
Ask | |
Never | |
Cancel | |
◆ CodeGenerationPolicy() [1/2]
Constructor.
- Parameters
-
clone | generation policy to clone |
◆ CodeGenerationPolicy() [2/2]
CodeGenerationPolicy::CodeGenerationPolicy |
( |
| ) |
|
◆ ~CodeGenerationPolicy()
CodeGenerationPolicy::~CodeGenerationPolicy |
( |
| ) |
|
|
virtual |
◆ calculateIndentation()
void CodeGenerationPolicy::calculateIndentation |
( |
| ) |
|
|
protected |
Calculate the indentation.
◆ createPage()
Create a new dialog interface for this object.
- Returns
- dialog object
◆ emitModifiedCodeContentSig()
void CodeGenerationPolicy::emitModifiedCodeContentSig |
( |
| ) |
|
Emits the signal 'ModifiedCodeContent'.
◆ getAssociationFieldScope()
Get the value of m_associationFieldScope
- Returns
- the Visibility value of m_associationFieldScope
◆ getAttributeAccessorScope()
Get the value of m_attributeAccessorScope
- Returns
- the Visibility value of m_attributeAccessorScope
◆ getAutoGenerateConstructors()
bool CodeGenerationPolicy::getAutoGenerateConstructors |
( |
| ) |
|
Get the value of m_autoGenerateConstructors
- Returns
- the value of m_autoGenerateConstructors
◆ getCodeVerboseDocumentComments()
bool CodeGenerationPolicy::getCodeVerboseDocumentComments |
( |
| ) |
const |
Get the value of m_codeVerboseDocumentComments Whether or not verbose code commenting for documentation is desired. If true, documentation for various code will be written even if no code would normally be created at that point in the file.
- Returns
- the value of m_codeVerboseDocumentComments
◆ getCodeVerboseSectionComments()
bool CodeGenerationPolicy::getCodeVerboseSectionComments |
( |
| ) |
const |
Get the value of m_codeVerboseSectionComments Whether or not verbose code commenting for sections is desired. If true, comments for sections will be written even if the section is empty.
- Returns
- the flag whether verbose code commenting for sections is desired
◆ getCommentStyle()
Get the value of m_commentStyle
- Returns
- the comment style
◆ getHeadingFile()
QString CodeGenerationPolicy::getHeadingFile |
( |
const QString & |
str | ) |
|
Gets the heading file (as a string) to be inserted at the beginning of the generated file. you give the file type as parameter and get the string. if fileName starts with a period (.) then fileName is the extension (.cpp, .h, .java) if fileName starts with another character you are requesting a specific file (mylicensefile.txt). The files can have parameters which are denoted by parameter%.
current parameters are author% date% time% filepath%
◆ getHeadingFileDir()
QString CodeGenerationPolicy::getHeadingFileDir |
( |
| ) |
const |
Get the value of m_headingFileDir location of the header file template.
- Returns
- the value of m_headingFileDir
◆ getIncludeHeadings()
bool CodeGenerationPolicy::getIncludeHeadings |
( |
| ) |
const |
Get the value of m_includeHeadings
- Returns
- the value of m_includeHeadings
◆ getIndentation()
QString CodeGenerationPolicy::getIndentation |
( |
| ) |
const |
Utility method to get the amount (and type of whitespace) to indent with.
- Returns
- the value of the indentation
◆ getIndentationAmount()
int CodeGenerationPolicy::getIndentationAmount |
( |
| ) |
|
Get indentation level units.
◆ getIndentationType()
Get the value of m_indentationType
◆ getLineEndingType()
Get the value of m_lineEndingType What line ending characters to use.
- Returns
- the value of m_lineEndingType
◆ getModifyPolicy()
Get the value of m_modifyPolicy
- Returns
- the value of m_modifyPolicy
◆ getNewLineEndingChars()
QString CodeGenerationPolicy::getNewLineEndingChars |
( |
| ) |
const |
Utility function to get the actual characters.
- Returns
- the line ending characters
◆ getOutputDirectory()
QDir CodeGenerationPolicy::getOutputDirectory |
( |
| ) |
|
Get the value of m_outputDirectory location of where output files will go.
- Returns
- the value of m_outputDirectory
◆ getOverwritePolicy()
Get the value of m_overwritePolicy Policy of how to deal with overwriting existing files. Allowed values are "ask", "yes" and "no".
- Returns
- the overwrite policy
◆ modifiedCodeContent
void CodeGenerationPolicy::modifiedCodeContent |
( |
| ) |
|
|
signal |
◆ setAssociationFieldScope()
Set the value of m_associationFieldScope
- Parameters
-
◆ setAttributeAccessorScope()
Set the value of m_attributeAccessorScope
- Parameters
-
◆ setAutoGenerateConstructors()
void CodeGenerationPolicy::setAutoGenerateConstructors |
( |
bool |
var | ) |
|
Set the value of m_autoGenerateConstructors
- Parameters
-
◆ setCodeVerboseDocumentComments()
void CodeGenerationPolicy::setCodeVerboseDocumentComments |
( |
bool |
new_var | ) |
|
Set the value of m_codeVerboseDocumentComments Whether or not verbose code commenting for documentation is desired. If true, documentation for various code will be written even if no code would normally be created at that point in the file.
- Parameters
-
new_var | the new value to set verbose code commenting |
◆ setCodeVerboseSectionComments()
void CodeGenerationPolicy::setCodeVerboseSectionComments |
( |
bool |
new_var | ) |
|
Set the value of m_codeVerboseSectionComments Whether or not verbose code commenting for sections is desired. If true, comments for sections will be written even if the section is empty.
- Parameters
-
new_var | the new value of m_codeVerboseSectionComments |
◆ setCommentStyle()
void CodeGenerationPolicy::setCommentStyle |
( |
CommentStyle |
new_var | ) |
|
Set the value of m_commentStyle
- Parameters
-
new_var | the new value of m_commentStyle |
◆ setDefaults() [1/2]
void CodeGenerationPolicy::setDefaults |
( |
bool |
emitUpdateSignal = true | ) |
|
|
virtual |
set the defaults from a config file
◆ setDefaults() [2/2]
void CodeGenerationPolicy::setDefaults |
( |
CodeGenerationPolicy * |
clone, |
|
|
bool |
emitUpdateSignal = true |
|
) |
| |
|
virtual |
set the defaults from a config file
◆ setHeadingFileDir()
void CodeGenerationPolicy::setHeadingFileDir |
( |
const QString & |
path | ) |
|
Set the value of m_headingFileDir location of the header file template.
- Parameters
-
path | the new value of m_headingFileDir |
◆ setIncludeHeadings()
void CodeGenerationPolicy::setIncludeHeadings |
( |
bool |
new_var | ) |
|
Set the value of m_includeHeadings
- Parameters
-
new_var | the new value of m_includeHeadings |
◆ setIndentationAmount()
void CodeGenerationPolicy::setIndentationAmount |
( |
int |
amount | ) |
|
Set how many units to indent for each indentation level.
- Parameters
-
amount | the amount of indentation units |
◆ setIndentationType()
Set the value of m_indentationType The amount and type of whitespace to indent with.
- Parameters
-
new_var | the new value of m_indentationType |
◆ setLineEndingType()
void CodeGenerationPolicy::setLineEndingType |
( |
NewLineType |
type | ) |
|
Set the value of m_lineEndingType What line ending characters to use.
- Parameters
-
type | the new value of m_lineEndingType |
◆ setModifyPolicy()
Set the value of m_modifyPolicy
- Parameters
-
new_var | the new value of m_modifyPolicy |
◆ setOutputDirectory()
void CodeGenerationPolicy::setOutputDirectory |
( |
QDir |
new_var | ) |
|
Set the value of m_outputDirectory location of where output files will go.
- Parameters
-
new_var | the new value of m_outputDirectory |
◆ setOverwritePolicy()
Set the value of m_overwritePolicy Policy of how to deal with overwriting existing files. Allowed values are "ask", "yes" and "no".
- Parameters
-
new_var | the new value of m_overwritePolicy |
◆ writeConfig()
void CodeGenerationPolicy::writeConfig |
( |
| ) |
|
|
virtual |
◆ m_indentation
QString CodeGenerationPolicy::m_indentation |
|
protected |
◆ m_lineEndingChars
QString CodeGenerationPolicy::m_lineEndingChars |
|
protected |
The documentation for this class was generated from the following files: