/*
==================================================================================================================================
================================================= Copyright  2010 Allen Baker =================================================
                                                 +------------------------------+
File:       MakeTemplate.java
Originator: Allen Baker (2010.09.07 20:05)
LayoutRev:  5
================================================================================================================================== */
package cosmicabyss.com.app;

import java.io.*;
import java.util.*;


import cosmicabyss.com.lib.*;



/*
======================================================================================================================== *//**
Description<PRE>
   This program generates source code comments for the sections of a source code template file. The comments are written
   to stdout.
</PRE>

Usage<PRE>
   java cosmicabyss.com.app.MakeTemplate [-h -q] [-l [logFile]] [-lang {languageName}] [-type {typeName}] [-b {string}]
      Arguments can be placed in any order on the command line.

   -h means HELP.
      It causes this usage message to be displayed, and terminates the program.

   -q means QUIET.
      It stops the program from sending log messages to stdout. The program sends log messages to stdout by default;
      this option is the only way to stop it from doing that.

   -l means LOGFILE.
      It takes an optional file name parameter, and causes the program to send log messages to the named file. If the
      file name is not present, the program generates a default file name. If the environment variable LOGDIRECTORY is
      defined, the program places the file in that directory. If not, the program places the file in the current
      directory. The program continues to send log messages to stdout too, unless the -q option is used.

   -lang means LANGUAGE.
      It requires a programming language name argument, and causes the program to generate a template for the specified
      language. Supported languages are:
         java --- generates a java file (this is the default)

         basic -- generates a visual basic file

         vba ---- generates a visual basic for applications file

         cs ----- generates a c# file

         cpp ---- generates a c++ file

         hdr ---- generates a c++ header file

      If no language is specified on the commandline, this program will generate a java file template.

   -type means TYPE.
      It requires a module type name argument, and causes the program to generate a template for the specified module
      type. Supported types are:
         lib --- generates a library file (this is the default)

         ext -- generates an extension file

         utl -- generates a utility file

         app -- generates an application file

      If no type is specified on the commandline, this program will generate a library template.

   -b means BANNER.
      It requires a string parameter and causes the program to generate 1 of each level of section header and with each
      section header containing the specified string.
</PRE>

<P>
<DL>
   <DT>
      <B>Example usage:</B>
      <DD>
         <PRE>
            *java cosmicabyss.com.app.MakeTemplate -langjava -typelib
         </PRE>
      </DD>
   </DT>
   <DT>
      <B>View Source:</B>
      <DD>
         <A href="MakeTemplate.java.html">MakeTemplate.java</A>
      </DD>
   </DT>
   <DT>
      <B>Author:</B>
      <DD>
         <A href="mailto:sourcecode.v01@cosmicabyss.com">
            Allen Baker
         </A>
      </DD>
   </DT>
</DL>
*//*
======================================================================================================================== */
public class MakeTemplate
   {



   /*
   ==============================================================================================================
   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[  Constants  ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   ============================================================================================================== */



   /*
   ==========================================================================================
   CLASS_NAME:
      the name of this class
   DESCRIPTION:
      the man page description of this application
   USAGE:
      the man page usage information for this application
   ------------------------------------------------------------------------------------------ */
   private static final XString  CLASS_NAME  = new XString(MakeTemplate.class.getName());
   private static final XString  DESCRIPTION = new XString
      (
      // <Description>  Preprocessor generated String definition, Don't mess with it.
      "This program generates source code comments for the sections of a source code template file. The comments are written\n" +
      "to stdout.                                                                                                           \n" +
      ""// </Description>
      );
   private static final XString  USAGE       = new XString
      (
      // <Usage>        Preprocessor generated String definition, Don't mess with it.
      "java cosmicabyss.com.app.MakeTemplate [-h -q] [-l [logFile]] [-lang {languageName}] [-type {typeName}] [-b {string}] \n" +
      "   Arguments can be placed in any order on the command line.                                                         \n" +
      "                                                                                                                     \n" +
      "-h means HELP.                                                                                                       \n" +
      "   It causes this usage message to be displayed, and terminates the program.                                         \n" +
      "                                                                                                                     \n" +
      "-q means QUIET.                                                                                                      \n" +
      "   It stops the program from sending log messages to stdout. The program sends log messages to stdout by default;    \n" +
      "   this option is the only way to stop it from doing that.                                                           \n" +
      "                                                                                                                     \n" +
      "-l means LOGFILE.                                                                                                    \n" +
      "   It takes an optional file name parameter, and causes the program to send log messages to the named file. If the   \n" +
      "   file name is not present, the program generates a default file name. If the environment variable LOGDIRECTORY is  \n" +
      "   defined, the program places the file in that directory. If not, the program places the file in the current        \n" +
      "   directory. The program continues to send log messages to stdout too, unless the -q option is used.                \n" +
      "                                                                                                                     \n" +
      "-lang means LANGUAGE.                                                                                                \n" +
      "   It requires a programming language name argument, and causes the program to generate a template for the specified \n" +
      "   language. Supported languages are:                                                                                \n" +
      "      java --- generates a java file (this is the default)                                                           \n" +
      "                                                                                                                     \n" +
      "      basic -- generates a visual basic file                                                                         \n" +
      "                                                                                                                     \n" +
      "      vba ---- generates a visual basic for applications file                                                        \n" +
      "                                                                                                                     \n" +
      "      cs ----- generates a c# file                                                                                   \n" +
      "                                                                                                                     \n" +
      "      cpp ---- generates a c++ file                                                                                  \n" +
      "                                                                                                                     \n" +
      "      hdr ---- generates a c++ header file                                                                           \n" +
      "                                                                                                                     \n" +
      "   If no language is specified on the commandline, this program will generate a java file template.                  \n" +
      "                                                                                                                     \n" +
      "-type means TYPE.                                                                                                    \n" +
      "   It requires a module type name argument, and causes the program to generate a template for the specified module   \n" +
      "   type. Supported types are:                                                                                        \n" +
      "      lib --- generates a library file (this is the default)                                                         \n" +
      "                                                                                                                     \n" +
      "      ext -- generates an extension file                                                                             \n" +
      "                                                                                                                     \n" +
      "      utl -- generates a utility file                                                                                \n" +
      "                                                                                                                     \n" +
      "      app -- generates an application file                                                                           \n" +
      "                                                                                                                     \n" +
      "   If no type is specified on the commandline, this program will generate a library template.                        \n" +
      "                                                                                                                     \n" +
      "-b means BANNER.                                                                                                     \n" +
      "   It requires a string parameter and causes the program to generate 1 of each level of section header and with each \n" +
      "   section header containing the specified string.                                                                   \n" +
      ""// </Usage>
      );
   /*
   ==========================================================================================
   section names
   ------------------------------------------------------------------------------------------ */
//   private static final String  cPublic               = "Public";
//   private static final String  cProtectedInternal    = "Protected|Internal";
//   private static final String  cInternal             = "Internal";
//   private static final String  cProtected            = "Protected";
//   private static final String  cPrivate              = "Private";
//   private static final String  cCLROnly              = "CLR-Access-Only";
//   private static final String  cClass                = "Class";
//   private static final String  cInstance             = "Instance";
//   private static final String  cNestedTypes          = "Nested-Types";

   private static final String  cConstants            = "Constants";
   private static final String  cUniversalConstants   = "Immutable";
   private static final String  cSituationalConstants = "Mutable";

   private static final String  cTypes                = "Types";
   private static final String  cEnums                = "Enums";
   private static final String  cStructs              = "Structs";
   private static final String  cDelegates            = "Delegates";
   private static final String  cClasses              = "Classes";
   private static final String  cInterfaces           = "Interfaces";

   private static final String  cVariables            = "Variables";

   private static final String  cFunctions            = "Functions";
   private static final String  cConstructors         = "Constructors";
   private static final String  cDestructors          = "Destructors";
   private static final String  cInitialization       = "Initialization";
   private static final String  cMethods              = "Methods";
   private static final String  cProperties           = "Properties";
   private static final String  cOperators            = "Operators";
   private static final String  cIndexers             = "Indexers";
   private static final String  cEvents               = "Events";
   private static final String  cMain                 = "Main";
   /*
   ==========================================================================================
   widths in characters of some fundamental things
   ------------------------------------------------------------------------------------------ */
   private static final int  cLineWidth = 130;
   private static final int  cTabWidth  = 3;
   /*
   ==========================================================================================
   the number of tabs a class and its subordinate sections are indented
   ------------------------------------------------------------------------------------------ */
   private static final int  cJavaFileIndent      = 0;
   private static final int  cJavaClassIndent     = 0;
   private static final int  cJavaSectionIndent   = 1;
   private static final int  cJavaFunctionIndent  = 1;
   private static final int  cJavaCommentIndent   = 2;

   private static final int  cBasicFileIndent     = 0;
   private static final int  cBasicClassIndent    = 0;
   private static final int  cBasicSectionIndent  = 1;
   private static final int  cBasicFunctionIndent = 1;
   private static final int  cBasicCommentIndent  = 2;

   private static final int  cCsFileIndent        = 0;
   private static final int  cCsClassIndent       = 1;
   private static final int  cCsSectionIndent     = 2;
   private static final int  cCsFunctionIndent    = 2;
   private static final int  cCsCommentIndent     = 3;

   private static final int  cCppFileIndent       = 0;
   private static final int  cCppClassIndent      = 0;
   private static final int  cCppSectionIndent    = 1;
   private static final int  cCppFunctionIndent   = 1;
   private static final int  cCppCommentIndent    = 2;

   private static final int  cHdrFileIndent       = 0;
   private static final int  cHdrClassIndent      = 0;
   private static final int  cHdrSectionIndent    = 1;
   private static final int  cHdrFunctionIndent   = 1;
   private static final int  cHdrCommentIndent    = 2;



   /*
   ==============================================================================================================
   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[  Types  ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   ============================================================================================================== */
   /*
   ==============================================================================================================
   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<[  Enums  ]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   ============================================================================================================== */
   /*
   ==============================================================================================================
   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<[  Structs  ]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   ============================================================================================================== */
   /*
   ==============================================================================================================
   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<[  Classes  ]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   ============================================================================================================== */
   /*
   ==============================================================================================================
   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<[  Interfaces  ]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   ============================================================================================================== */



   /*
   ==============================================================================================================
   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[  Variables  ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   ============================================================================================================== */



   /*
   ==========================================================================================
   cOut:
      formatted and time-stamped console output.
   ------------------------------------------------------------------------------------------ */
   private static ConsoleStream  cOut = ConsoleStream.getSingleton();
   /*
   ==========================================================================================
   iFileNameList:
      the list of all file names that match the filespecs given on the command line.
   iGlobalProperties:
      a copy of all the environment variables.
   iLang:
      identifies the programming language to generate sections for.
   iLangFamily:
      language family: 'c' = languages descended from c, 'b' = languages descended from
      basic.
   iType:
      identifies what kind of module to generate sections for.
   iString:
      identifies the specific string that the user wants put into 1 section header for each
      level.
   iPreviousLevel:
      keeps track of indentation level
   ------------------------------------------------------------------------------------------ */
   private FileNameList      iFileNameList     = null;
   private GlobalProperties  iGlobalProperties = null;
   private XString           iLang             = new XString("java");
   private XString           iLangFamily       = new XString("c");
   private XString           iType             = new XString("lib");
   private XString           iString           = null;
   private int               iPreviousLevel    = 0;
   /*
   ==========================================================================================
   indent sizes for sections
   ------------------------------------------------------------------------------------------ */
   private int  iFileIndent;
   private int  iClassIndent;
   private int  iSectionIndent;
   private int  iFunctionIndent;
   private int  iCommentIndent;
   /*
   ==========================================================================================
   comment bars for separating comment blocks. The prefixes are used as codes to make it
   easier to identify the header types when parsing a source file.
   ------------------------------------------------------------------------------------------ */
   private XString  iFilePrefix        = new XString("::.");
   private XString  iFileHeavyBar      = new XString("==================================================================================================================================");
   private XString  iFileLightBar      = new XString("==================================================================================================================================");
   private int      iFileWidth         = iFileHeavyBar.length();

   private XString  iClassPrefix       = new XString("::");
   private XString  iClassHeavyBar     = new XString("========================================================================================================================");
   private XString  iClassLightBar     = new XString("========================================================================================================================");
   private int      iClassWidth        = iClassHeavyBar.length();

   private XString  iSectionPrefix     = new XString(":.");
   private XString  iSectionHeavyBar   = new XString("==============================================================================================================");
   private XString  iSectionLightBar   = new XString("--------------------------------------------------------------------------------------------------------------");
   private int      iSectionWidth      = iSectionHeavyBar.length();

   private XString  iFunctionPrefix    = new XString(":");
   private XString  iFunctionHeavyBar  = new XString("====================================================================================================");
   private XString  iFunctionMiddleBar = new XString("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]");
   private XString  iFunctionLightBar  = new XString("----------------------------------------------------------------------------------------------------");
   private int      iFunctionWidth     = iFunctionHeavyBar.length();

   private XString  iCommentPrefix     = new XString(".");
   private XString  iCommentHeavyBar   = new XString("==========================================================================================");
   private XString  iCommentLightBar   = new XString("------------------------------------------------------------------------------------------");
   private int      iCommentWidth      = iCommentHeavyBar.length();
   /*
   ==========================================================================================
   tokens for framing banner comments
   ------------------------------------------------------------------------------------------ */
   private XString[]  iLBracket =
      {
      new XString("["), new XString("["), new XString("["), new XString("["), new XString("[")
      };
   private XString[]  iRBracket =
      {
      new XString("]"), new XString("]"), new XString("]"), new XString("]"), new XString("]")
      };
   private XString[]  iLFill =
      {
      new XString("@"), new XString("<"), new XString(":"), new XString("-"), new XString(" ")
      };
   private XString[]  iRFill =
      {
      new XString("@"), new XString(">"), new XString(":"), new XString("-"), new XString(" ")
      };
   /*
   ==========================================================================================
   header
   ------------------------------------------------------------------------------------------ */
   private XString[] iFileHeader =
      {
      iFileHeavyBar,
      new XString("================================================= %COPYRIGHT% ================================================="),
      new XString("                                                 +------------------------------+"),
      new XString("File:       %MODULENAME%"),
      new XString("Originator: %CREATEDATE%"),
      new XString("LayoutRev:  5"),
      iFileHeavyBar
      };
   private XString[] iClassHeader =
      {
      iClassHeavyBar,
      new XString("Description<PRE>"),
      new XString("</PRE>"),
      new XString(""),
      new XString("Subclass<PRE>"),
      new XString("   This class is derived from the yyy class. The abstraction it layers on top of yyy includes the"),
      new XString("   following:"),
      new XString("      => It."),
      new XString("</PRE>"),
      new XString(""),
      new XString("Usage<PRE>"),
      new XString("</PRE>"),
      new XString(""),
      new XString("<P>"),
      new XString("<DL>"),
      new XString("   <DT>"),
      new XString("      <B>Example usage:</B>"),
      new XString("      <DD>"),
      new XString("         <PRE>"),
      new XString("            *java cosmicabyss.com.app.%MODULENAME% -t cpp"),
      new XString("         </PRE>"),
      new XString("      </DD>"),
      new XString("   </DT>"),
      new XString("   <DT>"),
      new XString("      <B>View Source:</B>"),
      new XString("      <DD>"),
      new XString("         <A href=\"%MODULENAME%.java.html\">%MODULENAME%.java</A>"),
      new XString("      </DD>"),
      new XString("   </DT>"),
      new XString("</DL>"),
      new XString(""),
      new XString("@author"),
      new XString("   <A href=\"mailto:sourcecode.v01@cosmicabyss.com\">Allen Baker</A>"),
      iClassHeavyBar
      };
   private XString[] iFunctionHeader =
      {
      iFunctionHeavyBar,
      iFunctionMiddleBar,
      iFunctionHeavyBar,
      new XString("This method"),
      new XString("=> -> --"),
      new XString("c  c  c  c  c  c  c"),
      new XString(""),
      new XString("@return"),
      new XString("   This method returns"),
      new XString(""),
      new XString("@exception"),
      new XString("   xx is thrown when"),
      new XString("@exception"),
      new XString("   yy is thrown when"),
      new XString(""),
      new XString("@param"),
      new XString("   pX (optional)(input/output)(output) is the"),
      new XString("@param"),
      new XString("   pY (optional)(input/output)(output) is the"),
      iFunctionLightBar
      };
   private XString[] iCommentHeader =
      {
      iCommentHeavyBar,
      iCommentLightBar
      };
   /*
   ==========================================================================================
   descriptions
   ------------------------------------------------------------------------------------------ */
   private XString[] iDescLib =
      {
      new XString("   Instances of this class represent a xxx."                                                                  ),
      new XString(""                                                                                                             ),
      new XString("   Salient characteristics of a %MODULENAME% are:"                                                              ),
      new XString("      => It."                                                                                                 ),
      };
   private XString[] iDescExt =
      {
      new XString("   This class provides extension methods to the %MODULENAME% class."                                                      ),
      new XString(""                                                                                                                         ),
      new XString("   Extension methods enable you to \"add\" methods to existing types without creating a new derived type, recompiling,"   ),
      new XString("   or otherwise modifying the original type. Extension methods are a special kind of static method, but they are called"  ),
      new XString("   as if they were instance methods on the extended type. For client code written in C# and Visual Basic, there is no"    ),
      new XString("   apparent difference between calling an extension method and the methods that are actually defined in a type."          ),
      new XString(""                                                                                                                         ),
      new XString("   Extension methods are defined as static methods but are called by using instance method syntax. Their first parameter" ),
      new XString("   specifies which type the method operates on, and the parameter is preceded by the this modifier. Extension methods"    ),
      new XString("   are only in scope when you explicitly import the namespace into your source code with a using directive."              ),
      new XString(""                                                                                                                         ),
      new XString("   The following example shows an extension method defined for the System.String class. Note that it is"                  ),
      new XString("   defined inside a non-nested, non-generic static class:"                                                                ),
      new XString("      <PRE>"                                                                                                              ),
      new XString("         namespace ExtensionMethods"                                                                                      ),
      new XString("         {"                                                                                                               ),
      new XString("             public static class MyExtensions"                                                                            ),
      new XString("             {"                                                                                                           ),
      new XString("                 public static int WordCount(this String str)"                                                            ),
      new XString("                 {"                                                                                                       ),
      new XString("                     return str.Split(new char[] { ' ', '.', '?' }, StringSplitOptions.RemoveEmptyEntries).Length;"       ),
      new XString("                 }"                                                                                                       ),
      new XString("             }"                                                                                                           ),
      new XString("         }"                                                                                                               ),
      new XString("      </PRE>"                                                                                                             ),
      new XString(""                                                                                                                         ),
      new XString("   And it can be called from an application by using this syntax:"                                                        ),
      new XString("      <PRE>"                                                                                                              ),
      new XString("         Copystring s = \"Hello Extension Methods\""                                                                      ),
      new XString("         int i = s.WordCount();"                                                                                          ),
      new XString("      </PRE>"                                                                                                             ),
      new XString(""                                                                                                                         ),
      new XString("   In your code you invoke the extension method with instance method syntax. However, the intermediate language (IL)"     ),
      new XString("   generated by the compiler translates your code into a call on the static method. Therefore, the principle of"          ),
      new XString("   encapsulation is not really being violated. In fact, extension methods cannot access private variables in the type"    ),
      new XString("   they are extending."                                                                                                   ),
      new XString(""                                                                                                                         ),
      new XString("   All the public methods in this class MUST be extensions. I.e., they must be static, they must have at least one"       ),
      new XString("   parameter, and their first parameter must be preceeded with the \"this\" modifier. Furthermore, all the public"        ),
      new XString("   methods in this class MUST extend the %MODULENAME% class."                                                             ),
      new XString(""                                                                                                                         ),
      new XString("   This class is implicitly sealed or final."                                                                             ),
      };
   private XString[] iDescUtl =
      {
      new XString("   This is a utilities class that contains static methods that supplement the %MODULENAME% class. It is an application"   ),
      new XString("   of the \"Utility Pattern\"."                                                                                           ),
      new XString(""                                                                                                                         ),
      new XString("   The Utility pattern is a creational software pattern that is used for utility classes that do not require"             ),
      new XString("   instantiation and only have static methods. The stateless class is designated as static so that no instances can be"   ),
      new XString("   created. Good candidates for utility classes are convenience methods that can be grouped together functionally."       ),
      new XString(""                                                                                                                         ),
      new XString("   Furthermore, methods in Utility classes are usually deterministic. As the Utility class is stateless, all parameters"  ),
      new XString("   in each method must pass all necessary information to the method."                                                     ),
      new XString(""                                                                                                                         ),
      new XString("   All the public methods in this class MUST be utilities, i.e., they must be static and MUST supplement the"             ),
      new XString("   %MODULENAME% class."                                                                                                   ),
      new XString(""                                                                                                                         ),
      new XString("   This class is implicitly sealed or final."                                                                             ),
      };
   private XString[] iDescApp =
      {
      new XString("   This class is an application program that"),
      };
   /*
   ==========================================================================================
   c# Constants section comment
   ------------------------------------------------------------------------------------------ */
   private XString[] iConstantsComment =
      {
      iSectionLightBar,
      new XString("Some constant values (Immutable Constants) have no possibility of ever changing - scientific and mathematical" ),
      new XString("mathematical constants like pi and daysPerYear. Immutable Constants are defined using the \"const\" keyword."  ),
      new XString("Other constant values (Mutable Constants) could theoretically change or are expected to change but only very"  ),
      new XString("slowly - things like the application's configuration parameters. Mutable Constants are defined using the"      ),
      new XString("\"static readonly\" keywords."                                                                                 ),
      new XString(""                                                                                                              ),
      new XString("In C#, a value defined as \"const\" executes about twice as fast as one defined as a variable. However, a"     ),
      new XString("value defined as \"const\" is embedded directly into the executable code in every class it's used in, so"      ),
      new XString("changing it means having to recompile all classes that use it. This would be a problem bordering on disaster"  ),
      new XString("in some deployment senarios. Consequently, all (and only) values that have NO chance of EVER changing should"  ),
      new XString("be defined as \"const\" and all others should be defined as readonly variables."                               ),
      };



   /*
   ==============================================================================================================
   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[  Functions  ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   ============================================================================================================== */



   /*
   ==============================================================================================================
   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<[  Constructors  ]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   ============================================================================================================== */



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method creates a MakeTemplate class object and runs the application to
   completion.

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#000">View source</A>

   @param
      pArgs contains the command line arguments with which the class was invoked as an application.
   *//*
   ---------------------------------------------------------------------------------------------------- */
   public <Type> MakeTemplate(Type[] pArgs) throws Exception
      {
      boolean  successCode = true;

      successCode = initializeInstanceConstantsAndVariables(pArgs);
      if (successCode)
         {
         ifb>
            ( !
               (
               iType.equals("app") ||
               iType.equals("ext") ||
               iType.equals("utl") ||
               iType.equals("lib")
               )
            )
            {
            cOut.printf("COMMAND LINE ERROR: Type %s is not supported.",iType);
            cOut.println();
            usage();
            cOut.titledSeverityPrintf
               (
               Const.HALT,
               CLASS_NAME,
               "Command line error."
               );
            cOut.stopLog();
            System.exit(-1);
            }
         if      (iLang.equals("java"))  successCode = generateJavaTemplate();
         else if (iLang.equals("basic")) successCode = generateVbaTemplate();
         else if (iLang.equals("vba"))   successCode = generateVbaTemplate();
         else if (iLang.equals("cs"))    successCode = generateCsTemplate();
         else if (iLang.equals("cpp"))   successCode = generateCppTemplate();
         else if (iLang.equals("hdr"))   successCode = generateCppTemplate();
         else
            {
            cOut.printf("COMMAND LINE ERROR: Language %s is not supported.",iLang);
            cOut.println();
            usage();
            cOut.titledSeverityPrintf
               (
               Const.HALT,
               CLASS_NAME,
               "Command line error."
               );
            cOut.stopLog();
            System.exit(-1);
            }
         }
      cOut.println
         (
         CLASS_NAME.string() +
         (successCode? " completed successfully." : " completed with problems.")
         );
      cOut.println();
      cOut.stopLog();
      }



   /*
   ==============================================================================================================
   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<[  Initialization  ]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   ============================================================================================================== */



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method is the class static initialization block which is run the first time the JVM loads this
   class code and before anything else in this class is accessed

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#001">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   static
      {
      /*
      ==========================================================================================
      if required, make sure all the class constants and variables are initialized the first
      time the JVM loads this class code and before anything else in this class is accessed
      ------------------------------------------------------------------------------------------ */
      initializeClassConstantsAndVariables();
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method is called from the class static initialization block to make sure all the class
   constants and variables are initialized the first time the JVM loads this class code and before
   anything else in this class is accessed

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#002">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private static void initializeClassConstantsAndVariables()
      {
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method initializes all the instance constants and variables

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#003">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private <Type> boolean initializeInstanceConstantsAndVariables(Type[] pArgs) throws Exception
      {
      boolean  successCode = true;

      successCode = processCommandLine(pArgs);
      if (successCode)
         {
         iType       = iType.toLowerCase();
         iLang       = iLang.toLowerCase();
         iLangFamily = new XString(((iLang.toString()=="java") || (iLang.toString()=="cs") || (iLang.toString()=="cpp") || (iLang.toString()=="hdr"))? "c" : "b");

         if      (iLang.equals("java"))
            {
            iFileIndent      = cJavaFileIndent;
            iClassIndent     = cJavaClassIndent;
            iSectionIndent   = cJavaSectionIndent;
            iFunctionIndent  = cJavaFunctionIndent;
            iCommentIndent   = cJavaCommentIndent;
            }
         else if (iLang.equals("cs"))
            {
            iFileIndent      = cCsFileIndent;
            iClassIndent     = cCsClassIndent;
            iSectionIndent   = cCsSectionIndent;
            iFunctionIndent  = cCsFunctionIndent;
            iCommentIndent   = cCsCommentIndent;
            }
         else if (iLang.equals("cpp"))
            {
            iFileIndent      = cCppFileIndent;
            iClassIndent     = cCppClassIndent;
            iSectionIndent   = cCppSectionIndent;
            iFunctionIndent  = cCppFunctionIndent;
            iCommentIndent   = cCppCommentIndent;
            }
         else if (iLang.equals("hdr"))
            {
            iFileIndent      = cHdrFileIndent;
            iClassIndent     = cHdrClassIndent;
            iSectionIndent   = cHdrSectionIndent;
            iFunctionIndent  = cHdrFunctionIndent;
            iCommentIndent   = cHdrCommentIndent;
            }
         else if (iLang.equals("basic"))
            {
            iFileIndent      = cBasicFileIndent;
            iClassIndent     = cBasicClassIndent;
            iSectionIndent   = cBasicSectionIndent;
            iFunctionIndent  = cBasicFunctionIndent;
            iCommentIndent   = cBasicCommentIndent;
            }
         else if (iLang.equals("vba"))
            {
            iFileIndent      = cBasicFileIndent;
            iClassIndent     = cBasicClassIndent;
            iSectionIndent   = cBasicSectionIndent;
            iFunctionIndent  = cBasicFunctionIndent;
            iCommentIndent   = cBasicCommentIndent;
            }
         }
      return successCode;
      }



   /*
   ==============================================================================================================
   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<[  Methods  ]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   ============================================================================================================== */



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method sets the ConsoleStream for this object.

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#004">View source</A>

   @return
      a reference to this object

   @param
      pConsole is a ConsoleStream through which this objects sends its output.
   *//*
   ---------------------------------------------------------------------------------------------------- */
   public MakeTemplate setOut(ConsoleStream pConsole)
      {
      cOut = pConsole;
      return this;
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This boilerplate method is used for testing an instantiated object of this class and may include any
   code the developer chooses.

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#005">View source</A>

   @return
      a reference to this object
   *//*
   ---------------------------------------------------------------------------------------------------- */
   public MakeTemplate test() throws Exception
      {
      cOut.titledPrintf
         (
         "\"HELLO WORLD!\"",
         "%s  %s  %s",
         "I'm an object of the", CLASS_NAME, "class, and I approved this message."
         );
      return this;
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method displays the command line arguments that this program was invoked with.

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#006">View source</A>

   @param
      pArgs contains the command line arguments with which the class was invoked as an application.
   *//*
   ---------------------------------------------------------------------------------------------------- */
   private <Type> void showArgs(Type[] pArgs) throws Exception
      {
      XString  str = new XString("");
      for (int  i=0; i<pArgs.length; i++)
         {
         str = str.concat(UString.toString(pArgs[i]) + "   ");
         }
      cOut.println("Command Line Arguments",str);
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method processes the command line arguments and based on what it finds, sets the instance
   variables.

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#007">View source</A>

   @return
      a success code of true if all goes well, false otherwise.

   @param
      pArgs contains the command line arguments with which the class was invoked as an application.
   *//*
   ---------------------------------------------------------------------------------------------------- */
   private <Type> boolean processCommandLine(Type[] pArgs) throws Exception
      {
      boolean  successCode = true;
      /*
      ==========================================================================================
      Greetings !
      ------------------------------------------------------------------------------------------ */
      System.out.println();
      System.out.println();
      System.out.println();
      System.out.println();
      cOut.banner(CLASS_NAME);
      System.out.println();
      /*
      ==========================================================================================
      tell the user what command line arges this program started with
      ------------------------------------------------------------------------------------------ */
      showArgs(pArgs);
      /*
      ==========================================================================================
      this cannot be done statically because it throws an exception.
      ------------------------------------------------------------------------------------------ */
      iGlobalProperties = new GlobalProperties();
      /*
      ==========================================================================================
      get ready to process the command line arguments
      ------------------------------------------------------------------------------------------ */
      CommandLine  cmdLn = new CommandLine(CLASS_NAME,pArgs);
      /*
      ==========================================================================================
      these are the valid command line controls
      ------------------------------------------------------------------------------------------ */
      cmdLn.addControlsFromString(":hqrsl::b:");
      cmdLn.addControl("-lang", "required");
      cmdLn.addControl("-type", "required");
      /*
      ==========================================================================================
      list the valid controls
      ------------------------------------------------------------------------------------------ */
      cmdLn.listControls();
      cOut.println();
      /*
      ==========================================================================================
      interpret the arguments on the command line
      ------------------------------------------------------------------------------------------ */
      HashSet<XString>          controlsWithoutArgs = new HashSet<XString>();
      HashMap<XString,XString>  controlsWithArgs    = new HashMap<XString,XString>();
      ArrayList<XString>        excludedFileSpecs   = new ArrayList<XString>();
      ArrayList<XString>        includedFileSpecs   = new ArrayList<XString>();
      boolean                   result              = cmdLn.commandLineArgs
         (
         iGlobalProperties  ,
         controlsWithoutArgs,
         controlsWithArgs   ,
         excludedFileSpecs  ,
         includedFileSpecs
         );
      /*
      ==========================================================================================
      if the command line was messed up, abort the program
      ------------------------------------------------------------------------------------------ */
//      if (includedFileSpecs.isEmpty())
//         {
//         cOut.println("COMMAND LINE ERROR: MANDATORY control NOT on command line:  fileSpecs");
//         }
//      if ((result == false) || (includedFileSpecs.isEmpty()))
//         {
//         usage();
//         cOut.titledSeverityPrintf
//            (
//            Const.HALT,
//            CLASS_NAME,
//            "Command line error."
//            );
//         cOut.stopLog();
//         System.exit(-1);
//         }
      /*
      ==========================================================================================
      arguments for the FileNameList with their default values.  Some of these arguments may be
      modified by commandline controls.
      ------------------------------------------------------------------------------------------ */
      boolean  recurse             = false;
      boolean  fullyQualifiedNames = true;
      boolean  matchSubdirs        = false;
      boolean  sort                = true;
      boolean  collapse            = false;
      /*
      ==========================================================================================
      process commandline controls without arguments
      ------------------------------------------------------------------------------------------ */
      for (XString  ctl : controlsWithoutArgs)
         {
         cOut.println(ctl.string() + " control is present.");
         if (ctl.equals("-h"))
            {
            usage();
            cOut.stopLog();
            System.exit(-1);
            }
         recurse      |= ctl.equals("-r");
         matchSubdirs |= ctl.equals("-s");
         }
      if (controlsWithoutArgs.size() > 0) cOut.println();
      /*
      ==========================================================================================
      process commandline controls with arguments
      ------------------------------------------------------------------------------------------ */
      Set<XString>  set = controlsWithArgs.keySet();
      for (XString  ctl : set)
         {
         XString argStr = controlsWithArgs.get(ctl);
         cOut.println(ctl + " control is present with the argument: " + argStr);
         if (ctl.equals("-lang"))
            {
            iLang = argStr;
            }
         if (ctl.equals("-type"))
            {
            iType = argStr;
            }
         if (ctl.equals("-b"))
            {
            iString = argStr;
            }
         }
      if (controlsWithArgs.size() > 0) cOut.println();
      /*
      ==========================================================================================
      get a list of all the files names that will be processed
      ------------------------------------------------------------------------------------------ */
      for (XString  fileSpec : includedFileSpecs)
         {
         cOut.println("Files matching this fileSpec will be INcluded: " + fileSpec);
         }
      if (includedFileSpecs.size() > 0) cOut.println();
      for (XString  fileSpec : excludedFileSpecs)
         {
         cOut.println("Files matching this fileSpec will be EXcluded: " + fileSpec);
         }
      if (excludedFileSpecs.size() > 0) cOut.println();
      iFileNameList = new FileNameList
         (
         includedFileSpecs,excludedFileSpecs,recurse,fullyQualifiedNames,matchSubdirs,sort,collapse
         );
      /*
      ==========================================================================================
      ------------------------------------------------------------------------------------------ */
      return successCode;
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method writes a usage message to the log

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#008">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void usage()
      {
      cOut.println("Program Description",DESCRIPTION);
      cOut.println("Usage",USAGE);
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method detabs a line of text, trims any trailing whitespace from it, and prints it to
   System.out followed by a newline.

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#009">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void detabTrimRightAndPrintln()
      {
      System.out.println();
      }

   private void detabTrimRightAndPrintln(String pStr)
      {
      XString  xstr;
      xstr = new XString(pStr);
      detabTrimRightAndPrintln(xstr);
      }

   private void detabTrimRightAndPrintln(XString pStr)
      {
      XString  xstr;
      xstr = pStr;
      xstr = xstr.trimRight();
      xstr = xstr.detab(cTabWidth);
      System.out.println(xstr.string());
      }

   private String indent(int pIndent)
      {
      int width = (cTabWidth * pIndent);
      return (new XString("").alignLeft(width,' ')).toString();
      }



   /*
   ==============================================================================================================
   ::::::::::::::::::::::::::::::::::::::::::::::::::[  Java  ]::::::::::::::::::::::::::::::::::::::::::::::::::
   ============================================================================================================== */



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method generates a source code template for Java

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#010">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private boolean generateJavaTemplate() throws Exception
      {
      boolean  successCode = true;
      /*
      ==========================================================================================
      if the user wants a specific string printed, generate 1 section header for each level
      containing that string.
      ------------------------------------------------------------------------------------------ */
      if (iString != null)
         {
         writeJavaSectionBanner(0, iString.string());
         writeJavaSectionBanner(1, iString.string());
         writeJavaSectionBanner(2, iString.string());
         writeJavaSectionBanner(3, iString.string());
         writeJavaSectionBanner(4, iString.string());
         return successCode;
         }
      /*
      ==========================================================================================
      otherwise, generate the full set of standard section headers.
      ------------------------------------------------------------------------------------------ */
      generateJavaFileHeaderAndDescription();
      generateJavaSectionBanners();
      generateJavaFunctionHeader();
      generateJavaComment();
      generateJavaSectionBannerExamples();
      return successCode;
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#011">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateJavaFileHeaderAndDescription()
      {
      /*
      ==========================================================================================
      write out the file header
      ------------------------------------------------------------------------------------------ */
      detabTrimRightAndPrintln("/*" + iFilePrefix);
      int  size = iFileHeader.length;
      for (XString  line : iFileHeader)
         {
         size--;
         if (size != 0)
            {
            line = line.replace("%MODULENAME%","%MODULENAME%." + iLang);
            detabTrimRightAndPrintln(line.string());
            }
         else
            {
            detabTrimRightAndPrintln(line.string() + " */");
            }
         }
      /*
      ==========================================================================================
      skip some lines
      ------------------------------------------------------------------------------------------ */
      detabTrimRightAndPrintln();
      detabTrimRightAndPrintln();
      detabTrimRightAndPrintln();
      /*
      ==========================================================================================
      write out the file description
      ------------------------------------------------------------------------------------------ */
      String indentSpaces = indent(iClassIndent);
      detabTrimRightAndPrintln("/*" + iClassPrefix);
      int  count = 0;
      size = iClassHeader.length;
      for (XString  line : iClassHeader)
         {
         size--;
         count++;
         if (size != 0)
            {
            if (count != 1)
               {
               detabTrimRightAndPrintln(line.string());
               if (line.trim().string() == "Description<PRE>")
                  {
                  XString[] description;
                  if      (iType.equals("app")) { description = iDescApp; }
                  else if (iType.equals("utl")) { description = iDescUtl; }
                  else                          { description = iDescLib; }
                  for (XString  descLine : description)
                     {
                     detabTrimRightAndPrintln(indentSpaces + descLine.string());
                     }
                  }
               }
            else
               {
               detabTrimRightAndPrintln(line.string() + " *//**");
               }
            }
         else
            {
            detabTrimRightAndPrintln("*//*");
            detabTrimRightAndPrintln(line.string() + " */");
            }
         }
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#012">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateJavaSectionBanners()
      {
      writeJavaSectionBanner(0, cConstants);
      writeJavaSectionBanner(0, cTypes);
      writeJavaSectionBanner(1, cEnums);
      writeJavaSectionBanner(1, cStructs);
      writeJavaSectionBanner(1, cClasses);
      writeJavaSectionBanner(1, cInterfaces);
      writeJavaSectionBanner(0, cVariables);
      writeJavaSectionBanner(0, cFunctions);
      writeJavaSectionBanner(1, cConstructors);
      writeJavaSectionBanner(1, cInitialization);
      writeJavaSectionBanner(1, cMethods);
      writeJavaSectionBanner(1, cMain);
      writeJavaSectionBanner(0, "Notes");
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#013">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateJavaSectionBannerExamples()
      {
      writeJavaSectionBanner(0, "Section Level 0 Banner");
      writeJavaSectionBanner(1, "Section Level 1 Banner");
      writeJavaSectionBanner(2, "Section Level 2 Banner");
      writeJavaSectionBanner(3, "Section Level 3 Banner");
      writeJavaSectionBanner(4, "Section Level 4 Banner");
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#014">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateJavaFunctionHeader()
      {
      detabTrimRightAndPrintln("   /*" + iFunctionPrefix);
      int  count = 0;
      int  size = iFunctionHeader.length;
      for (XString  line : iFunctionHeader)
         {
         if ((line.startsWith("param")) || (line.startsWith("return")))
            {
            line = new XString("@" + line.string());
            }
         size--;
         count++;
         if (size != 0)
            {
            if (count != 3)
               {
               detabTrimRightAndPrintln("   " + line.string());
               }
            else
               {
               detabTrimRightAndPrintln("   " + line.string() + " *//**");
               }
            }
         else
            {
            detabTrimRightAndPrintln("   *//*");
            detabTrimRightAndPrintln("   " + line.string() + " */");
            }
         }
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#015">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateJavaComment()
      {
      detabTrimRightAndPrintln("      /*" + iCommentPrefix);
      detabTrimRightAndPrintln("      "   + iCommentHeavyBar);
      detabTrimRightAndPrintln("      "   + iCommentLightBar + " */");
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#016">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void writeJavaSectionBanner(int pLevel, String pStr)
      {
      int  mFieldWidth = iSectionHeavyBar.length();
      /*
      ==========================================================================================
      build the comment
      ------------------------------------------------------------------------------------------ */
      XString  cmmt = new XString(pStr);
      cmmt = new XString(iLBracket[pLevel] + "  " + cmmt.toString() + "  " + iRBracket[pLevel]);
      cmmt = cmmt.alignRight(((mFieldWidth-cmmt.length())/2) + cmmt.length(),iLFill[pLevel].charAt(0));
      cmmt = cmmt.alignLeft (mFieldWidth, iRFill[pLevel].charAt(0));
      /*
      ==========================================================================================
      write it out bracketed by bars
      ------------------------------------------------------------------------------------------ */
      detabTrimRightAndPrintln("   /*" + iSectionPrefix);
      detabTrimRightAndPrintln("   "   + iSectionHeavyBar);
      detabTrimRightAndPrintln("   "   + cmmt.string());
      detabTrimRightAndPrintln("   "   + iSectionHeavyBar + " */");
      }



   /*
   ==============================================================================================================
   ::::::::::::::::::::::::::::::::::::::[  Visual Basic for Applications  ]:::::::::::::::::::::::::::::::::::::
   ============================================================================================================== */



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method generates a source code template for Visual Basic for Applications

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#017">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private boolean generateVbaTemplate() throws Exception
      {
      boolean  successCode = true;
      /*
      ==========================================================================================
      if the user wants a specific string printed, generate 1 section header for each level
      containing that string.
      ------------------------------------------------------------------------------------------ */
      if (iString != null)
         {
         writeVbaSectionBanner(0, iString.string());
         writeVbaSectionBanner(1, iString.string());
         writeVbaSectionBanner(2, iString.string());
         writeVbaSectionBanner(3, iString.string());
         writeVbaSectionBanner(4, iString.string());
         return successCode;
         }
      /*
      ==========================================================================================
      otherwise, generate the full set of standard section headers.
      ------------------------------------------------------------------------------------------ */
      generateVbaFileHeaderAndDescription();
      generateVbaSectionBanners();
      generateVbaFunctionHeader();
      generateVbaComment();
      generateVbaSectionBannerExamples();
      return successCode;
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#018">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateVbaFileHeaderAndDescription()
      {
      detabTrimRightAndPrintln("'" + iFilePrefix);
      for (XString  line : iFileHeader)
         {
         line = line.replace("%MODULENAME%","%MODULENAME%." + iLang);
         detabTrimRightAndPrintln("' " + line.string());
         }
      detabTrimRightAndPrintln("Option Explicit");
      detabTrimRightAndPrintln();
      detabTrimRightAndPrintln();
      detabTrimRightAndPrintln();
      detabTrimRightAndPrintln("'" + iClassPrefix);
      for (XString  line : iClassHeader)
         {
         line = line.replace("*java cosmicabyss.com.app.","");
         line = line.replace("java",iLang);
         detabTrimRightAndPrintln("' " + line.string());
         }
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#019">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateVbaSectionBanners()
      {
      /*
      ==========================================================================================
      otherwise, generate the full set of standard section headers.
      ------------------------------------------------------------------------------------------ */
      writeVbaSectionBanner(0, "Constants");
      writeVbaSectionBanner(0, "Module Variables");
      writeVbaSectionBanner(0, "Public Routines");
      writeVbaSectionBanner(0, "Private Routines");
      writeVbaSectionBanner(0, "Notes");
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#020">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateVbaSectionBannerExamples()
      {
      writeVbaSectionBanner(0, "Section Level 0 Banner");
      writeVbaSectionBanner(1, "Section Level 1 Banner");
      writeVbaSectionBanner(2, "Section Level 2 Banner");
      writeVbaSectionBanner(3, "Section Level 3 Banner");
      writeVbaSectionBanner(4, "Section Level 4 Banner");
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#021">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateVbaFunctionHeader()
      {
      detabTrimRightAndPrintln("'" + iFunctionPrefix);
      for (XString  line : iFunctionHeader)
         {
         detabTrimRightAndPrintln("' " + line.string());
         }
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#022">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateVbaComment()
      {
      detabTrimRightAndPrintln("   '"  + iCommentPrefix);
      detabTrimRightAndPrintln("   ' " + iCommentHeavyBar);
      detabTrimRightAndPrintln("   ' " + iCommentLightBar);
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#023">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void writeVbaSectionBanner(int pLevel, String pStr)
      {
      int  mFieldWidth = iSectionHeavyBar.length();
      /*
      ==========================================================================================
      build the comment
      ------------------------------------------------------------------------------------------ */
      XString  cmmt = new XString(pStr);
      cmmt = new XString(iLBracket[pLevel] + "  " + cmmt.toString() + "  " + iRBracket[pLevel]);
      cmmt = cmmt.alignRight(((mFieldWidth-cmmt.length())/2) + cmmt.length(),iLFill[pLevel].charAt(0));
      cmmt = cmmt.alignLeft (mFieldWidth, iRFill[pLevel].charAt(0));
      /*
      ==========================================================================================
      write it out bracketed by bars
      ------------------------------------------------------------------------------------------ */
      detabTrimRightAndPrintln("'"  + iSectionPrefix);
      detabTrimRightAndPrintln("' " + iSectionHeavyBar);
      detabTrimRightAndPrintln("' " + cmmt.string());
      detabTrimRightAndPrintln("' " + iSectionHeavyBar);
      }



   /*
   ==============================================================================================================
   :::::::::::::::::::::::::::::::::::::::::::::::::::[  C#  ]:::::::::::::::::::::::::::::::::::::::::::::::::::
   ============================================================================================================== */



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method generates a source code template for C#

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#024">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private boolean generateCsTemplate() throws Exception
      {
      boolean  successCode = true;
      /*
      ==========================================================================================
      if the user wants a specific string printed, generate 1 section header for each level
      containing that string.
      ------------------------------------------------------------------------------------------ */
      if (iString != null)
         {
         writeCsSectionBanner(0, iString.string());
         writeCsSectionBanner(1, iString.string());
         writeCsSectionBanner(2, iString.string());
         writeCsSectionBanner(3, iString.string());
         writeCsSectionBanner(4, iString.string());
         return successCode;
         }
      /*
      ==========================================================================================
      otherwise, generate the full set of standard section headers.
      ------------------------------------------------------------------------------------------ */
      generateCsFileHeader();
      generateCsClassHeader();
      generateCsSectionBanners();
      generateCsFunctionHeader();
      generateCsComment();
      generateCsSectionBannerExamples();
      return successCode;
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#025">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateCsFileHeader()
      {
      String indentSpaces = indent(iFileIndent);
      detabTrimRightAndPrintln(indentSpaces + "/*" + iFilePrefix);
      int  size = iFileHeader.length;
      for (XString  line : iFileHeader)
         {
         size--;
         if (size != 0)
            {
            line = line.replace("%MODULENAME%","%MODULENAME%." + iLang);
            detabTrimRightAndPrintln(indentSpaces + line.string());
            }
         else
            {
            detabTrimRightAndPrintln(indentSpaces + line.string() + " */");
            }
         }
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#026">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateCsClassHeader()
      {
      String indentSpaces = indent(iClassIndent);
      detabTrimRightAndPrintln();
      detabTrimRightAndPrintln();
      detabTrimRightAndPrintln();
      detabTrimRightAndPrintln(indentSpaces + "/*" + iClassPrefix);
      int  count = 0;
      int  size  = iClassHeader.length;
      for (XString  line : iClassHeader)
         {
         size--;
         count++;
         if (size != 0)
            {
            if (count != 1)
               {
               line = line.replace("*java cosmicabyss.com.app.","");
               line = line.replace("java",iLang);
               detabTrimRightAndPrintln(indentSpaces + line.string());
               if (line.trim().string() == "Description<PRE>")
                  {
                  XString[] description;
                  if      (iType.equals("app")) { description = iDescApp; }
                  else if (iType.equals("ext")) { description = iDescExt; }
                  else if (iType.equals("utl")) { description = iDescUtl; }
                  else                          { description = iDescLib; }
                  for (XString  descLine : description)
                     {
                     detabTrimRightAndPrintln(indentSpaces + descLine.string());
                     }
                  }
               }
            else
               {
               detabTrimRightAndPrintln(indentSpaces + line.string() + " *//**");
               }
            }
         else
            {
            detabTrimRightAndPrintln(indentSpaces + "*//*");
            detabTrimRightAndPrintln(indentSpaces + line.string() + " */");
            }
         }
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#027">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateCsSectionBanners()
      {
      writeCsSectionBanner(0, cConstants);
      writeCsSectionBanner(1, cUniversalConstants);
      writeCsSectionBanner(1, cSituationalConstants);
      writeCsSectionBanner(0, cTypes);
      writeCsSectionBanner(1, cEnums);
      writeCsSectionBanner(1, cStructs);
      writeCsSectionBanner(1, cDelegates);
      writeCsSectionBanner(1, cClasses);
      writeCsSectionBanner(1, cInterfaces);
      writeCsSectionBanner(0, cVariables);
      writeCsSectionBanner(0, cFunctions);
      writeCsSectionBanner(1, cConstructors);
      writeCsSectionBanner(1, cDestructors);
      writeCsSectionBanner(1, cInitialization);
      writeCsSectionBanner(1, cMethods);
      writeCsSectionBanner(1, cProperties);
      writeCsSectionBanner(1, cOperators);
      writeCsSectionBanner(1, cIndexers);
      writeCsSectionBanner(1, cEvents);
      writeCsSectionBanner(1, cMain);
      writeCsSectionBanner(0, "Notes");
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#028">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateCsSectionBannerExamples()
      {
      writeCsSectionBanner(0, "Section Level 0 Banner");
      writeCsSectionBanner(1, "Section Level 1 Banner");
      writeCsSectionBanner(2, "Section Level 2 Banner");
      writeCsSectionBanner(3, "Section Level 3 Banner");
      writeCsSectionBanner(4, "Section Level 4 Banner");
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#029">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateCsFunctionHeader()
      {
      String indentSpaces = indent(iFunctionIndent);
      detabTrimRightAndPrintln(indentSpaces + "/*" + iFunctionPrefix);
      int  count = 0;
      int  size = iFunctionHeader.length;
      for (XString  line : iFunctionHeader)
         {
         if ((line.startsWith("param")) || (line.startsWith("return")))
            {
            line = new XString("@" + line.string());
            }
         size--;
         count++;
         if (size != 0)
            {
            if (count != 3)
               {
               detabTrimRightAndPrintln(indentSpaces + line.string());
               }
            else
               {
               detabTrimRightAndPrintln(indentSpaces + line.string() + " *//**");
               }
            }
         else
            {
            detabTrimRightAndPrintln(indentSpaces + "*//*");
            detabTrimRightAndPrintln(indentSpaces + line.string() + " */");
            }
         }
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#030">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateCsComment()
      {
      String indentSpaces = indent(iCommentIndent);
      detabTrimRightAndPrintln(indentSpaces + "/*" + iCommentPrefix);
      detabTrimRightAndPrintln(indentSpaces + iCommentHeavyBar);
      detabTrimRightAndPrintln(indentSpaces + iCommentLightBar + " */");
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#031">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void writeCsSectionBanner(int pLevel, String pStr)
      {
      String indentSpaces = indent(iSectionIndent);
      int    mFieldWidth  = iSectionHeavyBar.length();
      /*
      ==========================================================================================
      build the comment
      ------------------------------------------------------------------------------------------ */
      XString  cmmt = new XString(pStr);
      cmmt = new XString(iLBracket[pLevel] + "  " + cmmt.toString() + "  " + iRBracket[pLevel]);
      cmmt = cmmt.alignRight(((mFieldWidth-cmmt.length())/2) + cmmt.length(),iLFill[pLevel].charAt(0));
      cmmt = cmmt.alignLeft (mFieldWidth, iRFill[pLevel].charAt(0));
      /*
      ==========================================================================================
      write it out bracketed by bars
      ------------------------------------------------------------------------------------------ */
      detabTrimRightAndPrintln(indentSpaces + "/*" + iSectionPrefix);
      detabTrimRightAndPrintln(indentSpaces + iSectionHeavyBar);
      detabTrimRightAndPrintln(indentSpaces + cmmt.string());
      if (cConstants == pStr)
         {
         for (XString  line : iConstantsComment)
            {
            detabTrimRightAndPrintln(indentSpaces + line.string());
            }
         }
      detabTrimRightAndPrintln(indentSpaces + iSectionHeavyBar + " */");
      }



   /*
   ==============================================================================================================
   :::::::::::::::::::::::::::::::::::::::::::::::::::[  C++  ]::::::::::::::::::::::::::::::::::::::::::::::::::
   ============================================================================================================== */



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method generates a source code template for C++

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#032">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private boolean generateCppTemplate() throws Exception
      {
      boolean  successCode = true;
      /*
      ==========================================================================================
      if the user wants a specific string printed, generate 1 section header for each level
      containing that string.
      ------------------------------------------------------------------------------------------ */
      if (iString != null)
         {
         writeCppSectionBanner(0, iString.string());
         writeCppSectionBanner(1, iString.string());
         writeCppSectionBanner(2, iString.string());
         writeCppSectionBanner(3, iString.string());
         writeCppSectionBanner(4, iString.string());
         return successCode;
         }
      /*
      ==========================================================================================
      otherwise, generate the full set of standard section headers.
      ------------------------------------------------------------------------------------------ */
      generateCppFileHeaderAndDescription();
      generateCppSectionBanners();
      generateCppFunctionHeader();
      generateCppComment();
      generateCppSectionBannerExamples();
      return successCode;
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#033">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateCppFileHeaderAndDescription()
      {
      /*
      ==========================================================================================
      write out the file header
      ------------------------------------------------------------------------------------------ */
      detabTrimRightAndPrintln("/*" + iFilePrefix);
      int  size = iFileHeader.length;
      for (XString  line : iFileHeader)
         {
         size--;
         if (size != 0)
            {
            line = line.replace("%MODULENAME%","%MODULENAME%." + iLang);
            detabTrimRightAndPrintln(line.string());
            }
         else
            {
            detabTrimRightAndPrintln(line.string() + " */");
            }
         }
      /*
      ==========================================================================================
      skip some lines
      ------------------------------------------------------------------------------------------ */
      detabTrimRightAndPrintln();
      detabTrimRightAndPrintln();
      detabTrimRightAndPrintln();
      /*
      ==========================================================================================
      write out the file description
      ------------------------------------------------------------------------------------------ */
      detabTrimRightAndPrintln("/*" + iClassPrefix);
      size = iClassHeader.length;
      for (XString  line : iClassHeader)
         {
         size--;
         if (size != 0)
            {
            line = line.replace("*java cosmicabyss.com.app.","");
            line = line.replace("java",iLang);
            detabTrimRightAndPrintln(line.string());
            }
         else
            {
            detabTrimRightAndPrintln(line.string() + " */");
            }
         }
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#034">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateCppSectionBanners()
      {
      writeCppSectionBanner(0, cConstants);
      writeCppSectionBanner(0, cTypes);
      writeCppSectionBanner(1, cEnums);
      writeCppSectionBanner(1, cStructs);
      writeCppSectionBanner(1, cDelegates);
      writeCppSectionBanner(1, cClasses);
      writeCppSectionBanner(1, cInterfaces);
      writeCppSectionBanner(0, cVariables);
      writeCppSectionBanner(0, cFunctions);
      writeCppSectionBanner(1, cConstructors);
      writeCppSectionBanner(1, cDestructors);
      writeCppSectionBanner(1, cInitialization);
      writeCppSectionBanner(1, cMethods);
      writeCppSectionBanner(1, cProperties);
      writeCppSectionBanner(1, cOperators);
      writeCppSectionBanner(1, cIndexers);
      writeCppSectionBanner(1, cEvents);
      writeCppSectionBanner(1, cMain);
      writeCppSectionBanner(0, "Notes");
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#035">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateCppSectionBannerExamples()
      {
      writeCppSectionBanner(0, "Section Level 0 Banner");
      writeCppSectionBanner(1, "Section Level 1 Banner");
      writeCppSectionBanner(2, "Section Level 2 Banner");
      writeCppSectionBanner(3, "Section Level 3 Banner");
      writeCppSectionBanner(4, "Section Level 4 Banner");
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#036">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateCppFunctionHeader()
      {
      detabTrimRightAndPrintln("   /*" + iFunctionPrefix);
      int count = 0;
      int size = iFunctionHeader.length;
      for (XString  line : iFunctionHeader)
         {
         size--;
         if (size != 0)
            {
            detabTrimRightAndPrintln("   " + line.string());
            }
         else
            {
            detabTrimRightAndPrintln("   " + line.string() + " */");
            }
         }
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#037">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void generateCppComment()
      {
      detabTrimRightAndPrintln("      /*" + iCommentPrefix);
      detabTrimRightAndPrintln("      "   + iCommentHeavyBar);
      detabTrimRightAndPrintln("      "   + iCommentLightBar + " */");
      }



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#038">View source</A>

   *//*
   ---------------------------------------------------------------------------------------------------- */
   private void writeCppSectionBanner(int pLevel, String pStr)
      {
      int  mFieldWidth = iSectionHeavyBar.length();
      /*
      ==========================================================================================
      build the comment
      ------------------------------------------------------------------------------------------ */
      XString  cmmt = new XString(pStr);
      cmmt = new XString(iLBracket[pLevel] + "  " + cmmt.toString() + "  " + iRBracket[pLevel]);
      cmmt = cmmt.alignRight(((mFieldWidth-cmmt.length())/2) + cmmt.length(),iLFill[pLevel].charAt(0));
      cmmt = cmmt.alignLeft (mFieldWidth, iRFill[pLevel].charAt(0));
      /*
      ==========================================================================================
      write it out bracketed by bars
      ------------------------------------------------------------------------------------------ */
      detabTrimRightAndPrintln("   /*" + iSectionPrefix);
      detabTrimRightAndPrintln("   "   + iSectionHeavyBar);
      detabTrimRightAndPrintln("   "   + cmmt.string());
      detabTrimRightAndPrintln("   "   + iSectionHeavyBar + " */");
      }



   /*
   ==============================================================================================================
   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<[  Main  ]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   ============================================================================================================== */



   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method runs the MakeTemplate class as a standalone application. It's the method that's
   called when the class is invoked from the command line by using the java application launcher - "java".

   Usage<PRE>
   java cosmicabyss.com.app.MakeTemplate [-h -q] [-l [logFile]] [-lang {languageName}] [-type {typeName}] [-b {string}]
      Arguments can be placed in any order on the command line.

   -h means HELP.
      It causes this usage message to be displayed, and terminates the program.

   -q means QUIET.
      It stops the program from sending log messages to stdout. The program sends log messages to stdout by default;
      this option is the only way to stop it from doing that.

   -l means LOGFILE.
      It takes an optional file name parameter, and causes the program to send log messages to the named file. If the
      file name is not present, the program generates a default file name. If the environment variable LOGDIRECTORY is
      defined, the program places the file in that directory. If not, the program places the file in the current
      directory. The program continues to send log messages to stdout too, unless the -q option is used.

   -lang means LANGUAGE.
      It requires a programming language name argument, and causes the program to generate a template for the specified
      language. Supported languages are:
         java --- generates a java file (this is the default)

         basic -- generates a visual basic file

         vba ---- generates a visual basic for applications file

         cs ----- generates a c# file

         cpp ---- generates a c++ file

         hdr ---- generates a c++ header file

      If no language is specified on the commandline, this program will generate a java file template.

   -type means TYPE.
      It requires a module type name argument, and causes the program to generate a template for the specified module
      type. Supported types are:
         lib --- generates a library file (this is the default)

         ext -- generates an extension file

         utl -- generates a utility file

         app -- generates an application file

      If no type is specified on the commandline, this program will generate a library template.

   -b means BANNER.
      It requires a string parameter and causes the program to generate 1 of each level of section header and with each
      section header containing the specified string.
   </PRE>


   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#039">View source</A>

   @param
      pArgs contains the command line arguments with which the class was invoked as an application.
   *//*
   ---------------------------------------------------------------------------------------------------- */
   public static void main(String[] pArgs) throws Exception
      {
      MakeTemplate  thisMakeTemplate = new MakeTemplate(pArgs);
      }



   }  // class MakeTemplate



   /*
   ==============================================================================================================
   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[  Notes  ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   ============================================================================================================== */
   /*:                                    
   ====================================================================================================
   [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
   ==================================================================================================== *//**
   This method
   => -> --
   c  c  c  c  c  c  c

   <P><B>Implementation: </B><A HREF="MakeTemplate.java.html#040">View source</A>

   @return
      This method returns

   @exception
      xx is thrown when
   @exception
      yy is thrown when

   @param
      pX (optional)(input/output)(output) is the
   @param
      pY (optional)(input/output)(output) is the
   *//*
   ---------------------------------------------------------------------------------------------------- */
      /*
      ==========================================================================================
      ------------------------------------------------------------------------------------------ */
   /*
   ==============================================================================================================
   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[  Section Level 0 Banner  ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   ============================================================================================================== */
   /*
   ==============================================================================================================
   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<[  Section Level 1 Banner  ]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   ============================================================================================================== */
   /*
   ==============================================================================================================
   :::::::::::::::::::::::::::::::::::::::::[  Section Level 2 Banner  ]:::::::::::::::::::::::::::::::::::::::::
   ============================================================================================================== */
   /*
   ==============================================================================================================
   -----------------------------------------[  Section Level 3 Banner  ]-----------------------------------------
   ============================================================================================================== */
   /*
   ==============================================================================================================
                                            [  Section Level 4 Banner  ]
   ============================================================================================================== */