SimpleCodeGenerator Class Reference
A simple code generator interface designed to work with the existing codewriters. More...
#include <simplecodegenerator.h>
Inheritance diagram for SimpleCodeGenerator:

Public Slots | |
| void | syncCodeToDocument () |
| Force a synchronize of this code generator, and its present contents, to that of the parent UMLDocument. | |
Public Member Functions | |
| SimpleCodeGenerator (bool createDirHierarchyForPackages=true) | |
| Empty Constructor. | |
| virtual | ~SimpleCodeGenerator () |
| Empty Destructor. | |
| void | writeCodeToFile (UMLClassifierList &concepts) |
| void | writeCodeToFile () |
| Write out all code documents to file as appropriate. | |
| virtual void | writeClass (UMLClassifier *c)=0 |
| call this method to generate code for a UMLClassifier | |
| CodeDocument * | newClassifierCodeDocument (UMLClassifier *classifier) |
| This is implemented only because we HAVE to. | |
Protected Member Functions | |
| QString | findFileName (UMLPackage *concept, const QString &ext) |
| QString | overwritableName (UMLPackage *concept, const QString &name, const QString &ext) |
| bool | hasDefaultValueAttr (UMLClassifier *c) |
| bool | hasAbstractOps (UMLClassifier *c) |
| QString | getIndent () |
| Returns the current indent string based on m_indentLevel and m_indentation. | |
| void | initFromParentDocument () |
| Initialize this code generator from its parent UMLDoc. | |
Protected Attributes | |
| QMap< UMLPackage *, QString > | m_fileMap |
| Maps UMLObjects to filenames. | |
| UMLDoc * | m_doc |
| bool | m_createDirHierarchyForPackages |
| For some code generators, it does not make much sense to create a directory for each package because that would lead to a rather sparsely populated directory tree (maximum of just one source file per directory.). | |
| QString | m_indentation |
| int | m_indentLevel |
| QString | m_endl |
Detailed Description
A simple code generator interface designed to work with the existing codewriters.
Definition at line 38 of file simplecodegenerator.h.
Constructor & Destructor Documentation
|
|
Empty Constructor.
Definition at line 47 of file simplecodegenerator.cpp. References UMLApp::getDocument(), and m_createDirHierarchyForPackages. |
|
|
Empty Destructor.
Definition at line 56 of file simplecodegenerator.cpp. |
Member Function Documentation
|
|
Write out all code documents to file as appropriate.
Reimplemented from CodeGenerator. Definition at line 243 of file simplecodegenerator.cpp. References UMLDoc::getClassesAndInterfaces(), m_fileMap, and writeClass(). |
|
|
call this method to generate code for a UMLClassifier
Implemented in AdaWriter, ASWriter, CppWriter, CSharpWriter, DWriter, IDLWriter, JavaWriter, JSWriter, PascalWriter, PerlWriter, Php5Writer, PhpWriter, PythonWriter, RubyWriter, SQLWriter, TclWriter, and XMLSchemaWriter. Referenced by writeCodeToFile(). |
|
|
This is implemented only because we HAVE to.
Implements CodeGenerator. Definition at line 237 of file simplecodegenerator.cpp. |
|
|
Returns the current indent string based on m_indentLevel and m_indentation.
Definition at line 69 of file simplecodegenerator.cpp. Referenced by XMLSchemaWriter::writeClass(), PascalWriter::writeClass(), IDLWriter::writeClass(), and AdaWriter::writeClass(). |
|
|
Initialize this code generator from its parent UMLDoc. When this is called, it will (re-)generate the list of code documents for this project (generator) by checking for new objects/attributes which have been added or changed in the document. One or more CodeDocuments will be created/overwritten/amended as is appropriate for the given language. Reimplemented from CodeGenerator. Definition at line 286 of file simplecodegenerator.cpp. |
|
|
Force a synchronize of this code generator, and its present contents, to that of the parent UMLDocument. "UserGenerated" code will be preserved, but Autogenerated contents will be updated/replaced or removed as is apppropriate. Reimplemented from CodeGenerator. Definition at line 275 of file simplecodegenerator.cpp. References UMLApp::getCommonPolicy(), CodeGenerationPolicy::getIndentation(), and CodeGenerationPolicy::getNewLineEndingChars(). |
Member Data Documentation
|
|
Maps UMLObjects to filenames. Used for finding out which file each class was written to. Definition at line 92 of file simplecodegenerator.h. Referenced by writeCodeToFile(). |
|
|
For some code generators, it does not make much sense to create a directory for each package because that would lead to a rather sparsely populated directory tree (maximum of just one source file per directory.).
Definition at line 103 of file simplecodegenerator.h. Referenced by SimpleCodeGenerator(). |
The documentation for this class was generated from the following files:
