Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactor code, and more comments

  • Loading branch information...
commit 22b54b1dc9d2ad5765ab42f9f4f9a3a6f54fc176 1 parent 4308fbf
DerekLiang authored
Showing with 13 additions and 9 deletions.
  1. +13 −9 QTPImpl.cst
22 QTPImpl.cst
View
@@ -53,6 +53,8 @@ class <%= ClassName %><%= DataClassNameSuffix %> : public QSharedData
{ <% if (GenDebugOutput) {%> qDebug() << this << ":copy: <%= ClassName %><%= DataClassNameSuffix %>" ; <% } %>}
<% if (AddComment) { %>
+ //assign operator= is defined in the base class and is private, therefore it is omit here.
+
// int id;
// QString name;
<% } %>
@@ -156,20 +158,22 @@ class <%= ClassName %>
<script runat="template">
public override void Render(TextWriter writer)
{
+ if (OutputPath.Length==0) {
+ base.Render(writer);
+ return;
+ }
StringWriter sw = new StringWriter();
this.Response.AddTextWriter(sw);
base.Render(writer);
- if (OutputPath.Length>0) {
- using(
- StreamWriter cppFile = new StreamWriter(OutputPath + @"\" + ClassName.ToLower() + FileNameSuffix + ".cpp" , false),
- hFile = new StreamWriter(OutputPath + @"\" + ClassName.ToLower() + FileNameSuffix + ".h" , false))
- {
- string[] parts = sw.ToString().Split(new string[] {"@@@@-@@@@@"}, StringSplitOptions.None);
- cppFile.Write(parts[0]);
- hFile.Write(parts[1]);
- }
+ using(
+ StreamWriter cppFile = new StreamWriter(OutputPath + @"\" + ClassName.ToLower() + FileNameSuffix + ".cpp" , false),
+ hFile = new StreamWriter(OutputPath + @"\" + ClassName.ToLower() + FileNameSuffix + ".h" , false))
+ {
+ string[] parts = sw.ToString().Split(new string[] {"@@@@-@@@@@"}, StringSplitOptions.None);
+ cppFile.Write(parts[0]);
+ hFile.Write(parts[1]);
}
}
</script>
Please sign in to comment.
Something went wrong with that request. Please try again.