[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
Oliver.Kellogg at t-online.de
Thu May 8 12:12:54 UTC 2003
CVS commit by okellogg:
overwritableName: New method severed out from findFileName.
M +4 -0 codegenerator.cpp 1.12
M +18 -0 codegenerator.h 1.7
--- kdesdk/umbrello/umbrello/codegenerator.cpp #1.11:1.12
@@ -108,4 +108,8 @@ QString CodeGenerator::findFileName(UMLC
ext.replace(QRegExp(" "),"_");
+ return overwritableName(concept, name, ext);
+}
+
+QString CodeGenerator::overwritableName(UMLClassifier* concept, QString name, QString ext) {
//check if a file named "name" with extension "ext" already exists
if(!m_outputDirectory.exists(name+ext)) {
--- kdesdk/umbrello/umbrello/codegenerator.h #1.6:1.7
@@ -133,4 +133,22 @@ protected:
QString findFileName(UMLClassifier* concept, QString ext);
+ /**
+ * Returns a name that can be written to in the output directory,
+ * respecting the overwrite policy.
+ * If a file of the given name and extension does not exist,
+ * then just returns the name.
+ * If a file of the given name and extension does exist,
+ * then opens an overwrite dialog. In this case the name returned
+ * may be a modification of the input name.
+ * This method is invoked by findFileName().
+ *
+ * @param concept the class for which an output file name is desired.
+ * @param name the proposed output file name
+ * @param ext the extension (or suffix) used for output files
+ * @return the real file name that should be used. (without extension) or
+ * NULL if none to be used
+ */
+ QString overwritableName(UMLClassifier* concept, QString name, QString ext);
+
/** Opens a file named "name" for writing in the outputDirectory.
* If something goes wrong, it informs the user
More information about the umbrello-devel
mailing list