umbrello/umbrello
#include <codegenerationpolicy.h>
Public Types | |
enum | CommentStyle { SingleLine =0, MultiLine } |
enum | IndentationType { NONE =0, TAB, SPACE } |
enum | ModifyNamePolicy { No =0, Underscore, Capitalise } |
enum | NewLineType { UNIX =0, DOS, MAC } |
enum | OverwritePolicy { Ok =0, Ask, Never, Cancel } |
Signals | |
void | modifiedCodeContent () |
Protected Member Functions | |
void | calculateIndentation () |
Protected Attributes | |
QString | m_indentation |
QString | m_lineEndingChars |
Detailed Description
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.
Definition at line 29 of file codegenerationpolicy.h.
Member Enumeration Documentation
Enumerator | |
---|---|
SingleLine | |
MultiLine |
Definition at line 50 of file codegenerationpolicy.h.
Enumerator | |
---|---|
NONE | |
TAB | |
SPACE |
Definition at line 49 of file codegenerationpolicy.h.
Enumerator | |
---|---|
No | |
Underscore | |
Capitalise |
Definition at line 47 of file codegenerationpolicy.h.
Enumerator | |
---|---|
UNIX | |
DOS | |
MAC |
Definition at line 48 of file codegenerationpolicy.h.
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 |
Definition at line 46 of file codegenerationpolicy.h.
Constructor & Destructor Documentation
|
explicit |
Constructor.
- Parameters
-
clone generation policy to clone
Definition at line 40 of file codegenerationpolicy.cpp.
CodeGenerationPolicy::CodeGenerationPolicy | ( | ) |
Constructor.
Definition at line 51 of file codegenerationpolicy.cpp.
|
virtual |
Destructor.
Definition at line 59 of file codegenerationpolicy.cpp.
Member Function Documentation
|
protected |
Calculate the indentation.
Definition at line 307 of file codegenerationpolicy.cpp.
|
virtual |
Create a new dialog interface for this object.
- Returns
- dialog object
Definition at line 412 of file codegenerationpolicy.cpp.
void CodeGenerationPolicy::emitModifiedCodeContentSig | ( | ) |
Emits the signal 'ModifiedCodeContent'.
Definition at line 420 of file codegenerationpolicy.cpp.
Uml::Visibility::Enum CodeGenerationPolicy::getAssociationFieldScope | ( | ) |
Get the value of m_associationFieldScope.
- Returns
- the Visibility value of m_associationFieldScope
Definition at line 403 of file codegenerationpolicy.cpp.
Uml::Visibility::Enum CodeGenerationPolicy::getAttributeAccessorScope | ( | ) |
Get the value of m_attributeAccessorScope.
- Returns
- the Visibility value of m_attributeAccessorScope
Definition at line 384 of file codegenerationpolicy.cpp.
bool CodeGenerationPolicy::getAutoGenerateConstructors | ( | ) |
Get the value of m_autoGenerateConstructors.
- Returns
- the value of m_autoGenerateConstructors
Definition at line 365 of file codegenerationpolicy.cpp.
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
Definition at line 147 of file codegenerationpolicy.cpp.
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
Definition at line 122 of file codegenerationpolicy.cpp.
CodeGenerationPolicy::CommentStyle CodeGenerationPolicy::getCommentStyle | ( | ) |
Get the value of m_commentStyle.
- Returns
- the comment style
Definition at line 99 of file codegenerationpolicy.cpp.
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%
Definition at line 540 of file codegenerationpolicy.cpp.
QString CodeGenerationPolicy::getHeadingFileDir | ( | ) | const |
Get the value of m_headingFileDir location of the header file template.
- Returns
- the value of m_headingFileDir
Definition at line 167 of file codegenerationpolicy.cpp.
bool CodeGenerationPolicy::getIncludeHeadings | ( | ) | const |
Get the value of m_includeHeadings.
- Returns
- the value of m_includeHeadings
Definition at line 186 of file codegenerationpolicy.cpp.
QString CodeGenerationPolicy::getIndentation | ( | ) | const |
Utility method to get the amount (and type of whitespace) to indent with.
- Returns
- the value of the indentation
Definition at line 299 of file codegenerationpolicy.cpp.
int CodeGenerationPolicy::getIndentationAmount | ( | ) |
Get indentation level units.
Definition at line 290 of file codegenerationpolicy.cpp.
CodeGenerationPolicy::IndentationType CodeGenerationPolicy::getIndentationType | ( | ) |
Get the value of m_indentationType.
Definition at line 268 of file codegenerationpolicy.cpp.
CodeGenerationPolicy::NewLineType CodeGenerationPolicy::getLineEndingType | ( | ) |
Get the value of m_lineEndingType What line ending characters to use.
- Returns
- the value of m_lineEndingType
Definition at line 239 of file codegenerationpolicy.cpp.
CodeGenerationPolicy::ModifyNamePolicy CodeGenerationPolicy::getModifyPolicy | ( | ) | const |
Get the value of m_modifyPolicy.
- Returns
- the value of m_modifyPolicy
Definition at line 346 of file codegenerationpolicy.cpp.
QString CodeGenerationPolicy::getNewLineEndingChars | ( | ) | const |
Utility function to get the actual characters.
- Returns
- the line ending characters
Definition at line 248 of file codegenerationpolicy.cpp.
QDir CodeGenerationPolicy::getOutputDirectory | ( | ) |
Get the value of m_outputDirectory location of where output files will go.
- Returns
- the value of m_outputDirectory
Definition at line 206 of file codegenerationpolicy.cpp.
CodeGenerationPolicy::OverwritePolicy CodeGenerationPolicy::getOverwritePolicy | ( | ) | const |
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
Definition at line 80 of file codegenerationpolicy.cpp.
|
signal |
void CodeGenerationPolicy::setAssociationFieldScope | ( | Uml::Visibility::Enum | var | ) |
Set the value of m_associationFieldScope.
- Parameters
-
var the new value
Definition at line 393 of file codegenerationpolicy.cpp.
void CodeGenerationPolicy::setAttributeAccessorScope | ( | Uml::Visibility::Enum | var | ) |
Set the value of m_attributeAccessorScope.
- Parameters
-
var the new value
Definition at line 374 of file codegenerationpolicy.cpp.
void CodeGenerationPolicy::setAutoGenerateConstructors | ( | bool | var | ) |
Set the value of m_autoGenerateConstructors.
- Parameters
-
var the new value
Definition at line 355 of file codegenerationpolicy.cpp.
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
Definition at line 134 of file codegenerationpolicy.cpp.
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
Definition at line 110 of file codegenerationpolicy.cpp.
void CodeGenerationPolicy::setCommentStyle | ( | CommentStyle | new_var | ) |
Set the value of m_commentStyle.
- Parameters
-
new_var the new value of m_commentStyle
Definition at line 89 of file codegenerationpolicy.cpp.
|
virtual |
set the defaults from a config file
Definition at line 429 of file codegenerationpolicy.cpp.
|
virtual |
set the defaults from a config file
Definition at line 459 of file codegenerationpolicy.cpp.
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
Definition at line 157 of file codegenerationpolicy.cpp.
void CodeGenerationPolicy::setIncludeHeadings | ( | bool | new_var | ) |
Set the value of m_includeHeadings.
- Parameters
-
new_var the new value of m_includeHeadings
Definition at line 176 of file codegenerationpolicy.cpp.
void CodeGenerationPolicy::setIndentationAmount | ( | int | amount | ) |
Set how many units to indent for each indentation level.
- Parameters
-
amount the amount of indentation units
Definition at line 277 of file codegenerationpolicy.cpp.
void CodeGenerationPolicy::setIndentationType | ( | IndentationType | new_var | ) |
Set the value of m_indentationType The amount and type of whitespace to indent with.
- Parameters
-
new_var the new value of m_indentationType
Definition at line 258 of file codegenerationpolicy.cpp.
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
Definition at line 216 of file codegenerationpolicy.cpp.
void CodeGenerationPolicy::setModifyPolicy | ( | ModifyNamePolicy | new_var | ) |
Set the value of m_modifyPolicy.
- Parameters
-
new_var the new value of m_modifyPolicy
Definition at line 337 of file codegenerationpolicy.cpp.
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
Definition at line 196 of file codegenerationpolicy.cpp.
void CodeGenerationPolicy::setOverwritePolicy | ( | OverwritePolicy | new_var | ) |
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
Definition at line 69 of file codegenerationpolicy.cpp.
|
virtual |
Write Default params.
Definition at line 502 of file codegenerationpolicy.cpp.
Member Data Documentation
|
protected |
Definition at line 148 of file codegenerationpolicy.h.
|
protected |
Definition at line 147 of file codegenerationpolicy.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.