CodeGenerationPolicy Class Reference
class CodeGenerationPolicy This class describes the code generation policy for this project. More...
#include <codegenerationpolicy.h>
Public Types | |
| enum | OverwritePolicy { Ok = 0, Ask, Never, Cancel } |
| 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. More... | |
| enum | ModifyNamePolicy { No = 0, Underscore, Capitalise } |
| enum | NewLineType { UNIX = 0, DOS, MAC } |
| enum | IndentationType { NONE = 0, TAB, SPACE } |
| enum | CommentStyle { SingleLine = 0, MultiLine } |
| enum | ScopePolicy { Public = 200, Private, Protected, FromParent } |
Signals | |
| void | modifiedCodeContent () |
Public Member Functions | |
| OverwritePolicy | defaultOverwritePolicy () const |
| bool | defaultVerboseSectionComments () const |
| bool | defaultVerboseDocumentComments () const |
| bool | defaultIncludeHeadings () const |
| NewLineType | defaultLineEndingType () const |
| IndentationType | defaultIndentType () const |
| int | defaultIndentAmount () const |
| ModifyNamePolicy | defaultModifyNamePolicy () const |
| CommentStyle | defaultCommentStyle () const |
| ScopePolicy | defaultAttribAccessorScope () const |
| ScopePolicy | defaultAssocFieldScope () const |
| bool | defaultAutoGenerateConstructors () const |
| CodeGenerationPolicy (CodeGenerationPolicy *clone=0) | |
| Constructor. | |
| CodeGenerationPolicy (KConfig *config) | |
| virtual | ~CodeGenerationPolicy () |
| Empty Destructor. | |
| void | setOverwritePolicy (OverwritePolicy new_var) |
| Set the value of m_overwritePolicy Policy of how to deal with overwriting existing files. | |
| OverwritePolicy | getOverwritePolicy () const |
| Get the value of m_overwritePolicy Policy of how to deal with overwriting existing files. | |
| void | setCodeVerboseSectionComments (bool new_var) |
| Set the value of m_codeVerboseSectionComments Whether or not verbose code commenting for sections is desired. | |
| bool | getCodeVerboseSectionComments () const |
| Get the value of m_codeVerboseSectionComments Whether or not verbose code commenting for sections is desired. | |
| void | setCodeVerboseDocumentComments (bool new_var) |
| Set the value of m_codeVerboseDocumentComments Whether or not verbose code commenting for documentation is desired. | |
| bool | getCodeVerboseDocumentComments () const |
| Get the value of m_codeVerboseDocumentComments Whether or not verbose code commenting for documentation is desired. | |
| void | setHeadingFileDir (const QString &path) |
| Set the value of m_headingFileDir location of the header file template. | |
| QString | getHeadingFileDir () const |
| Get the value of m_headingFileDir location of the header file template. | |
| void | setIncludeHeadings (bool new_var) |
| Set the value of m_includeHeadings. | |
| bool | getIncludeHeadings () const |
| Get the value of m_includeHeadings. | |
| void | setOutputDirectory (QDir new_var) |
| Set the value of m_outputDirectory location of where output files will go. | |
| QDir | getOutputDirectory () |
| Get the value of m_outputDirectory location of where output files will go. | |
| void | setLineEndingType (NewLineType new_var) |
| Set the value of m_lineEndingType What line ending characters to use. | |
| NewLineType | getLineEndingType () |
| Get the value of m_lineEndingType What line ending characters to use. | |
| QString | getNewLineEndingChars () const |
| Utility function to get the actual characters. | |
| void | setIndentationType (IndentationType type) |
| Set the value of m_indentationType The amount and type of whitespace to indent with. | |
| IndentationType | getIndentationType () |
| Get the value of m_indentationType. | |
| void | setIndentationAmount (int amount) |
| How many units to indent for each indentation level. | |
| int | getIndentationAmount () |
| QString | getIndentation () const |
| Get the string representation of each level of indentation. | |
| void | setModifyPolicy (ModifyNamePolicy new_var) |
| Set the value of m_modifyPolicy. | |
| ModifyNamePolicy | getModifyPolicy () const |
| Get the value of m_modifyPolicy. | |
| void | setAutoGenerateConstructors (bool var) |
| Set the value of m_autoGenerateConstructors. | |
| bool | getAutoGenerateConstructors () |
| Get the value of m_autoGenerateConstructors. | |
| void | setAttributeAccessorScope (ScopePolicy var) |
| Set the value of m_attributeAccessorScope. | |
| ScopePolicy | getAttributeAccessorScope () |
| Get the value of m_attributeAccessorScope. | |
| void | setAssociationFieldScope (ScopePolicy var) |
| Set the value of m_associationFieldScope. | |
| ScopePolicy | getAssociationFieldScope () |
| Get the value of m_associationFieldScope. | |
| virtual CodeGenerationPolicyPage * | createPage (QWidget *parent=0, const char *name=0) |
| Create a new dialog interface for this object. | |
| QString | getHeadingFile (QString str) |
| Gets the heading file (as a string) to be inserted at the beginning of the generated file. | |
| virtual void | setDefaults (CodeGenerationPolicy *defaults, bool emitUpdateSignal=true) |
| set the defaults for this code generator from the passed generator. | |
| virtual void | setDefaults (KConfig *config, bool emitUpdateSignal=true) |
| set the defaults from a config file for this code generator from the passed KConfig pointer. | |
| virtual void | writeConfig (KConfig *config) |
| write Default params to passed KConfig pointer. | |
| void | emitModifiedCodeContentSig () |
| void | setCommentStyle (CommentStyle new_var) |
| Set the value of m_commentStyle. | |
| CommentStyle | getCommentStyle () |
| Get the value of m_commentStyle. | |
Protected Member Functions | |
| void | calculateIndentation () |
| void | initFields () |
Protected Attributes | |
| OverwritePolicy | m_overwritePolicy |
| bool | m_codeVerboseSectionComments |
| bool | m_codeVerboseDocumentComments |
| QDir | m_headingFiles |
| bool | m_includeHeadings |
| QDir | m_outputDirectory |
| NewLineType | m_lineEndingType |
| IndentationType | m_indentationType |
| int | m_indentationAmount |
| ModifyNamePolicy | m_modifyPolicy |
| bool | m_autoGenerateConstructors |
| CommentStyle | m_commentStyle |
| ScopePolicy | m_attributeAccessorScope |
| ScopePolicy | m_associationFieldScope |
| QString | m_lineEndingChars |
| QString | m_indentation |
Detailed Description
class CodeGenerationPolicy This class describes the code generation policy for this project.
Definition at line 35 of file codegenerationpolicy.h.
Member Enumeration Documentation
|
|
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.
Definition at line 51 of file codegenerationpolicy.h. |
Constructor & Destructor Documentation
|
|
Constructor.
Definition at line 96 of file codegenerationpolicy.cpp. References setDefaults(). |
|
|
Empty Destructor.
Definition at line 109 of file codegenerationpolicy.cpp. |
Member Function Documentation
|
|
Set the value of m_overwritePolicy Policy of how to deal with overwriting existing files. OverwritePolicy can have the following values
Definition at line 129 of file codegenerationpolicy.cpp. Referenced by CodeGenerator::overwritableName(), and setDefaults(). |
|
|
Get the value of m_overwritePolicy Policy of how to deal with overwriting existing files. Allowed values are "Ok", "Ask", "Never" "Cancel".
Definition at line 139 of file codegenerationpolicy.cpp. Referenced by CodeGenerator::overwritableName(), and writeConfig(). |
|
|
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.
Definition at line 166 of file codegenerationpolicy.cpp. Referenced by setDefaults(). |
|
|
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.
Definition at line 177 of file codegenerationpolicy.cpp. Referenced by writeConfig(). |
|
|
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.
Definition at line 188 of file codegenerationpolicy.cpp. Referenced by setDefaults(). |
|
|
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.
Definition at line 200 of file codegenerationpolicy.cpp. Referenced by JavaClassifierCodeDocument::forceDoc(), CPPHeaderCodeDocument::updateContent(), and writeConfig(). |
|
|
Set the value of m_headingFileDir location of the header file template.
Definition at line 209 of file codegenerationpolicy.cpp. Referenced by setDefaults(). |
|
|
Get the value of m_headingFileDir location of the header file template.
Definition at line 218 of file codegenerationpolicy.cpp. Referenced by writeConfig(). |
|
|
Set the value of m_includeHeadings.
Definition at line 226 of file codegenerationpolicy.cpp. Referenced by setDefaults(). |
|
|
Get the value of m_includeHeadings.
Definition at line 235 of file codegenerationpolicy.cpp. Referenced by getHeadingFile(), and writeConfig(). |
|
|
Set the value of m_outputDirectory location of where output files will go.
Definition at line 244 of file codegenerationpolicy.cpp. Referenced by setDefaults(), and PerlWriter::writeClass(). |
|
|
Get the value of m_outputDirectory location of where output files will go.
Definition at line 253 of file codegenerationpolicy.cpp. Referenced by CodeGenerator::findFileName(), CodeGenerator::openFile(), CodeGenerator::overwritableName(), PerlWriter::writeClass(), and writeConfig(). |
|
|
Set the value of m_lineEndingType What line ending characters to use.
Definition at line 262 of file codegenerationpolicy.cpp. Referenced by setDefaults(). |
|
|
Get the value of m_lineEndingType What line ending characters to use.
Definition at line 284 of file codegenerationpolicy.cpp. Referenced by writeConfig(). |
|
|
Utility function to get the actual characters.
Definition at line 290 of file codegenerationpolicy.cpp. Referenced by CodeGenerator::formatDoc(), getHeadingFile(), TextBlock::setAttributesFromNode(), CodeMethodBlock::setAttributesFromNode(), TextBlock::setAttributesOnNode(), CodeMethodBlock::setAttributesOnNode(), SimpleCodeGenerator::syncCodeToDocument(), TextBlock::toString(), CodeMethodBlock::toString(), and CPPHeaderCodeDocument::updateContent(). |
|
|
Set the value of m_indentationType The amount and type of whitespace to indent with.
Definition at line 299 of file codegenerationpolicy.cpp. Referenced by setDefaults(). |
|
|
Get the value of m_indentationType.
Definition at line 305 of file codegenerationpolicy.cpp. Referenced by writeConfig(). |
|
|
How many units to indent for each indentation level.
Definition at line 309 of file codegenerationpolicy.cpp. Referenced by setDefaults(). |
|
|
Get the string representation of each level of indentation. The amount and type of whitespace to indent with.
Definition at line 326 of file codegenerationpolicy.cpp. Referenced by TextBlock::getIndentation(), SimpleCodeGenerator::syncCodeToDocument(), and CPPHeaderCodeDocument::updateContent(). |
|
|
Set the value of m_modifyPolicy.
Definition at line 353 of file codegenerationpolicy.cpp. Referenced by setDefaults(). |
|
|
Get the value of m_modifyPolicy.
Definition at line 361 of file codegenerationpolicy.cpp. Referenced by writeConfig(). |
|
|
Set the value of m_autoGenerateConstructors.
Definition at line 369 of file codegenerationpolicy.cpp. Referenced by JavaCodeGenerationPolicyPage::apply(), and setDefaults(). |
|
|
Get the value of m_autoGenerateConstructors.
Definition at line 378 of file codegenerationpolicy.cpp. Referenced by JavaCodeGenerationPolicyPage::JavaCodeGenerationPolicyPage(), CPPHeaderCodeDocument::updateContent(), and writeConfig(). |
|
|
Set the value of m_attributeAccessorScope.
Definition at line 382 of file codegenerationpolicy.cpp. Referenced by JavaCodeGenerationPolicyPage::apply(), and setDefaults(). |
|
|
Get the value of m_attributeAccessorScope.
Definition at line 387 of file codegenerationpolicy.cpp. Referenced by JavaCodeGenerationPolicyPage::JavaCodeGenerationPolicyPage(), and writeConfig(). |
|
|
Set the value of m_associationFieldScope.
Definition at line 391 of file codegenerationpolicy.cpp. Referenced by JavaCodeGenerationPolicyPage::apply(), and setDefaults(). |
|
|
Get the value of m_associationFieldScope.
Definition at line 396 of file codegenerationpolicy.cpp. Referenced by JavaCodeGenerationPolicyPage::JavaCodeGenerationPolicyPage(), and writeConfig(). |
|
||||||||||||
|
Create a new dialog interface for this object.
Definition at line 404 of file codegenerationpolicy.cpp. |
|
|
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 513 of file codegenerationpolicy.cpp. References getIncludeHeadings(), and getNewLineEndingChars(). Referenced by CodeGenerator::getHeadingFile(). |
|
||||||||||||
|
set the defaults for this code generator from the passed generator.
Definition at line 416 of file codegenerationpolicy.cpp. References setCodeVerboseDocumentComments(), setCodeVerboseSectionComments(), setHeadingFileDir(), setIncludeHeadings(), setIndentationAmount(), setIndentationType(), setLineEndingType(), setModifyPolicy(), setOutputDirectory(), and setOverwritePolicy(). Referenced by CodeGenerationPolicy(). |
|
||||||||||||
|
set the defaults from a config file for this code generator from the passed KConfig pointer.
Definition at line 444 of file codegenerationpolicy.cpp. References setAssociationFieldScope(), setAttributeAccessorScope(), setAutoGenerateConstructors(), setCodeVerboseDocumentComments(), setCodeVerboseSectionComments(), setCommentStyle(), setHeadingFileDir(), setIncludeHeadings(), setIndentationAmount(), setIndentationType(), setLineEndingType(), setModifyPolicy(), setOutputDirectory(), and setOverwritePolicy(). |
|
|
write Default params to passed KConfig pointer.
Definition at line 488 of file codegenerationpolicy.cpp. References getAssociationFieldScope(), getAttributeAccessorScope(), getAutoGenerateConstructors(), getCodeVerboseDocumentComments(), getCodeVerboseSectionComments(), getCommentStyle(), getHeadingFileDir(), getIncludeHeadings(), getIndentationType(), getLineEndingType(), getModifyPolicy(), getOutputDirectory(), and getOverwritePolicy(). Referenced by UMLApp::saveOptions(). |
|
|
Set the value of m_commentStyle.
Definition at line 147 of file codegenerationpolicy.cpp. Referenced by JavaCodeGenerationPolicyPage::apply(), and setDefaults(). |
|
|
Get the value of m_commentStyle.
Definition at line 156 of file codegenerationpolicy.cpp. Referenced by RubyCodeDocumentation::firstEditableLine(), JavaCodeDocumentation::firstEditableLine(), CPPCodeDocumentation::firstEditableLine(), RubyCodeDocumentation::getNewEditorLine(), JavaCodeDocumentation::getNewEditorLine(), CPPCodeDocumentation::getNewEditorLine(), JavaCodeGenerationPolicyPage::JavaCodeGenerationPolicyPage(), RubyCodeDocumentation::toString(), JavaCodeDocumentation::toString(), CPPCodeDocumentation::toString(), RubyCodeDocumentation::unformatText(), JavaCodeDocumentation::unformatText(), CPPCodeDocumentation::unformatText(), and writeConfig(). |
The documentation for this class was generated from the following files:
