Main Page ? Class Hierarchy ? Compound List ? File List ? Compound Members ? File Members ?

MSDEVGenerator Class Reference

#include <cmt_generators.h>

Inheritance diagram for MSDEVGenerator:

[legend]
Collaboration diagram for MSDEVGenerator:

[legend]
List of all members.

Public Methods

? MSDEVGenerator ()
int? build_workspace (const Constituent::ConstituentVector &constituents)
int? build_project (const Constituent &constituent)

Private Methods

void? reset ()

Private Attributes

cmt_string? msdevdir
FragmentHandle? dsw_header_fragment
FragmentHandle? dsw_project_fragment
FragmentHandle? dsw_all_project_header_fragment
FragmentHandle? dsw_all_project_dependency_fragment
FragmentHandle? dsw_all_project_trailer_fragment
FragmentHandle? dsw_trailer_fragment
FragmentHandle? dsp_all_fragment
FragmentHandle? dsp_library_header_fragment
FragmentHandle? dsp_application_header_fragment
FragmentHandle? dsp_windows_header_fragment
FragmentHandle? dsp_contents_fragment
FragmentHandle? dsp_trailer_fragment

Constructor & Destructor Documentation

MSDEVGenerator::MSDEVGenerator (? ? )?
?

Definition at line 1532 of file cmt_generators.cxx.

References dsp_all_fragment, dsp_application_header_fragment, dsp_contents_fragment, dsp_library_header_fragment, dsp_trailer_fragment, dsp_windows_header_fragment, dsw_all_project_dependency_fragment, dsw_all_project_header_fragment, dsw_all_project_trailer_fragment, dsw_header_fragment, dsw_project_fragment, dsw_trailer_fragment, and FragmentHandle::set().

01533 {
01534   dsw_header_fragment.set ("dsw_header");
01535   dsw_project_fragment.set ("dsw_project");
01536   dsw_all_project_header_fragment.set ("dsw_all_project_header");
01537   dsw_all_project_dependency_fragment.set ("dsw_all_project_dependency");
01538   dsw_all_project_trailer_fragment.set ("dsw_all_project_trailer");
01539   dsw_trailer_fragment.set ("dsw_trailer");
01540 
01541   dsp_all_fragment.set ("dsp_all");
01542   dsp_library_header_fragment.set ("dsp_library_header");
01543   dsp_application_header_fragment.set ("dsp_application_header");
01544   dsp_windows_header_fragment.set ("dsp_windows_header");
01545   dsp_contents_fragment.set ("dsp_contents");
01546   dsp_trailer_fragment.set ("dsp_trailer");
01547 }

Member Function Documentation

int MSDEVGenerator::build_project (? const Constituent &? ? constituent )?
?

Definition at line 1687 of file cmt_generators.cxx.

References Application, cmt_string::c_str(), Document, Constituent::exclude_exprs, Constituent::generator, CmtGenerator::get_all_files(), Constituent::includes, Library, Constituent::modules, Constituent::name, Constituent::need_OS9, Constituent::no_share, reset(), Constituent::select_exprs, CmtGenerator::set_full_name(), cmt_vector< cmt_string >::size(), Constituent::suffix, CmtGenerator::terminate(), Constituent::type, Constituent::variables, and Constituent::windows.

Referenced by Generator::build_msdev().

01688 {
01689   reset ();
01690 
01691   const cmt_string& package = Cmt::get_current_package ();
01692   static cmt_string file;
01693   static cmt_string full_name;
01694   static cmt_string suffix;
01695 
01696   int i;
01697 
01698   m_CONSTITUENT = constituent.name;
01699   m_CONSTITUENTSUFFIX = constituent.suffix;
01700 
01701   for (i = 0; i < constituent.includes.size (); i++)
01702     {
01703       const cmt_string& include = constituent.includes[i];
01704       m_PACKINCLUDES += " -I" + include;
01705     }
01706 
01707   switch (constituent.type)
01708     {
01709     case Application:
01710       is_application = true;
01711       m_TITLE = "Application";
01712       break;
01713     case Library:
01714       is_library = true;
01715       m_TITLE = "Library";
01716       break;
01717     case Document:
01718       m_GENERATOR = constituent.generator;
01719       m_TITLE = "Document";
01720       break;
01721     }
01722 
01723   m_PACKOS9 = constituent.need_OS9;
01724 
01725   const CmtSystem::cmt_string_vector& sources = constituent.modules;
01726   const cmt_vector& excludes = constituent.exclude_exprs;
01727   const cmt_vector& selects = constituent.select_exprs;
01728 
01729   //--- Build the constituents fragment -----
01730 
01731   m_output_file_name = msdevdir + m_CONSTITUENT + ".dspnew";
01732   m_output_file = fopen (m_output_file_name.c_str (), "wb");
01733 
01734   if (m_output_file == NULL) return (0);
01735 
01736   m_PACKAGE = package;
01737 
01738   if (is_library)
01739     {
01740       if (constituent.no_share)
01741         {
01742           m_LIBRARYSUFFIX = "lib";
01743         }
01744       else
01745         {
01746           m_LIBRARYSUFFIX = "arc";
01747         }
01748 
01749       dsp_library_header_fragment.wincopy (m_output_file, constituent.variables, 4,
01750                                            &m_PACKAGE,
01751                                            &m_CONSTITUENT, 
01752                                            &m_CONSTITUENTSUFFIX, 
01753                                            &m_LIBRARYSUFFIX);
01754     }
01755   else
01756     {
01757       if (constituent.windows)
01758         {
01759           dsp_windows_header_fragment.wincopy (m_output_file, constituent.variables, 3,
01760                                                &m_PACKAGE,
01761                                                &m_CONSTITUENT, 
01762                                                &m_CONSTITUENTSUFFIX);
01763         }
01764       else
01765         {
01766           dsp_application_header_fragment.wincopy (m_output_file, constituent.variables, 3,
01767                                                    &m_PACKAGE,
01768                                                    &m_CONSTITUENT, 
01769                                                    &m_CONSTITUENTSUFFIX);
01770         }
01771     }
01772 
01773   for (i = 0; i < sources.size (); i++)
01774     {
01775       file = sources[i];
01776 
01777       set_full_name (full_name, file);
01778       if (full_name == "") continue;
01779 
01780       static CmtSystem::cmt_string_vector files;
01781 
01782       get_all_files (full_name, excludes, selects, files);
01783 
01784       for (int j = 0; j < files.size (); j++)
01785         {
01786           const cmt_string& name = files[j];
01787 
01788           if (name != "") 
01789             {
01790               m_FULLNAME = name;
01791 
01792               if (m_output_file != NULL)
01793                 {
01794                   dsp_contents_fragment.wincopy (m_output_file, constituent.variables, 2, 
01795                                                  &m_PACKAGE, 
01796                                                  &m_FULLNAME);
01797                 }
01798             }
01799         }
01800     }
01801 
01802   if (m_output_file != NULL)
01803     {
01804       dsp_trailer_fragment.wincopy (m_output_file, constituent.variables, 3,
01805                                     &m_PACKAGE,
01806                                     &m_CONSTITUENT, 
01807                                     &m_CONSTITUENTSUFFIX);
01808 
01809       terminate ();
01810     }
01811 
01812   return (0);
01813 }

int MSDEVGenerator::build_workspace (? const Constituent::ConstituentVector &? ? constituents )?
?

Definition at line 1596 of file cmt_generators.cxx.

References cmt_string::c_str(), Library, Constituent::name, reset(), cmt_vector< Constituent >::size(), Constituent::suffix, CmtGenerator::terminate(), Constituent::type, and Constituent::variables.

Referenced by Generator::build_msdev_workspace().

01597 {
01598   reset ();
01599 
01600   const cmt_string& package = Cmt::get_current_package ();
01601 
01602   m_output_file_name = msdevdir + package + ".dswnew";
01603 
01604   m_output_file = fopen (m_output_file_name.c_str (), "wb");
01605   if (m_output_file != NULL)
01606     {
01607       m_PACKAGE = package;
01608       dsw_header_fragment.wincopy (m_output_file, 1,
01609                                    &m_PACKAGE);
01610 
01611       int i;
01612 
01613       dsw_all_project_header_fragment.wincopy (m_output_file, 1, 
01614                                                &m_PACKAGE);
01615 
01616       for (i = 0; i < constituents.size (); i++)
01617         {
01618           const Constituent& constituent = constituents[i];
01619 
01620           if (constituent.type == Library)
01621             {
01622               m_CONSTITUENT = constituent.name;
01623               m_CONSTITUENTSUFFIX = constituent.suffix;
01624               dsw_all_project_dependency_fragment.wincopy (m_output_file, constituent.variables, 3,
01625                                                            &m_PACKAGE,
01626                                                            &m_CONSTITUENT, 
01627                                                            &m_CONSTITUENTSUFFIX);
01628             }
01629           else
01630             {
01631               m_CONSTITUENT = constituent.name;
01632               m_CONSTITUENTSUFFIX = constituent.suffix;
01633               dsw_all_project_dependency_fragment.wincopy (m_output_file, constituent.variables, 3,
01634                                                            &m_PACKAGE,
01635                                                            &m_CONSTITUENT, 
01636                                                            &m_CONSTITUENTSUFFIX);
01637             }
01638 
01639         }
01640 
01641       dsw_all_project_trailer_fragment.wincopy (m_output_file,
01642                                                 1, &m_PACKAGE);
01643 
01644       for (i = 0; i < constituents.size (); i++)
01645         {
01646           const Constituent& constituent = constituents[i];
01647 
01648           if (constituent.type == Library)
01649             {
01650               m_CONSTITUENT = constituent.name;
01651               m_CONSTITUENTSUFFIX = constituent.suffix;
01652               dsw_project_fragment.wincopy (m_output_file,
01653                                             constituent.variables, 3,
01654                                             &m_PACKAGE,
01655                                             &m_CONSTITUENT, 
01656                                             &m_CONSTITUENTSUFFIX);
01657             }
01658           else
01659             {
01660               m_CONSTITUENT = constituent.name;
01661               m_CONSTITUENTSUFFIX = constituent.suffix;
01662               dsw_project_fragment.wincopy (m_output_file, constituent.variables, 3, 
01663                                             &m_PACKAGE,
01664                                             &m_CONSTITUENT, 
01665                                             &m_CONSTITUENTSUFFIX);
01666             }
01667         }
01668 
01669       dsw_trailer_fragment.wincopy (m_output_file, 1, &m_PACKAGE);
01670 
01671       terminate ();
01672     }
01673 
01674   m_output_file_name = msdevdir + "all.dspnew";
01675 
01676   m_output_file = fopen (m_output_file_name.c_str (), "wb");
01677   if (m_output_file != NULL)
01678     {
01679       dsp_all_fragment.wincopy (m_output_file, 1, &m_PACKAGE);
01680       terminate ();
01681     }
01682 
01683   return (0);
01684 }

void MSDEVGenerator::reset (? ? )? [private]
?

Reimplemented from CmtGenerator.

Definition at line 1549 of file cmt_generators.cxx.

References CmtSystem::cd(), CmtSystem::current_branch(), dsp_all_fragment, dsp_application_header_fragment, dsp_contents_fragment, dsp_library_header_fragment, dsp_trailer_fragment, dsp_windows_header_fragment, dsw_all_project_dependency_fragment, dsw_all_project_header_fragment, dsw_all_project_trailer_fragment, dsw_header_fragment, dsw_project_fragment, dsw_trailer_fragment, CmtSystem::file_separator(), Cmt::get_current_dir(), CmtSystem::mkdir(), msdevdir, FragmentHandle::reset(), CmtGenerator::reset(), and CmtSystem::test_directory().

Referenced by build_project(), and build_workspace().

01550 {
01551   CmtGenerator::reset ();
01552 
01553   dsw_header_fragment.reset ();
01554   dsw_project_fragment.reset ();
01555   dsw_all_project_header_fragment.reset ();
01556   dsw_all_project_dependency_fragment.reset ();
01557   dsw_all_project_trailer_fragment.reset ();
01558   dsw_trailer_fragment.reset ();
01559 
01560   dsp_all_fragment.reset ();
01561   dsp_library_header_fragment.reset ();
01562   dsp_application_header_fragment.reset ();
01563   dsp_windows_header_fragment.reset ();
01564   dsp_contents_fragment.reset ();
01565   dsp_trailer_fragment.reset ();
01566 
01567   CmtSystem::cd (Cmt::get_current_dir ());
01568 
01569   cmt_string branch = CmtSystem::current_branch ();
01570 
01571   if ((branch == "mgr") || (branch == "cmt"))
01572     {
01573 #ifdef WIN32
01574       msdevdir = "..";
01575       msdevdir += CmtSystem::file_separator ();
01576       msdevdir += "Visual";
01577       
01578       if (!CmtSystem::test_directory (msdevdir))
01579         {
01580           CmtSystem::mkdir (msdevdir);
01581         }
01582       
01583       msdevdir += CmtSystem::file_separator ();
01584 #endif
01585     }
01586   else
01587     {
01588 #ifdef WIN32
01589       msdevdir = ".";
01590       msdevdir += CmtSystem::file_separator ();
01591 #endif
01592     }
01593 
01594 }

Member Data Documentation

FragmentHandle MSDEVGenerator::dsp_all_fragment [private]
?

Definition at line 135 of file cmt_generators.h.

Referenced by MSDEVGenerator(), and reset().

FragmentHandle MSDEVGenerator::dsp_application_header_fragment [private]
?

Definition at line 137 of file cmt_generators.h.

Referenced by MSDEVGenerator(), and reset().

FragmentHandle MSDEVGenerator::dsp_contents_fragment [private]
?

Definition at line 139 of file cmt_generators.h.

Referenced by MSDEVGenerator(), and reset().

FragmentHandle MSDEVGenerator::dsp_library_header_fragment [private]
?

Definition at line 136 of file cmt_generators.h.

Referenced by MSDEVGenerator(), and reset().

FragmentHandle MSDEVGenerator::dsp_trailer_fragment [private]
?

Definition at line 140 of file cmt_generators.h.

Referenced by MSDEVGenerator(), and reset().

FragmentHandle MSDEVGenerator::dsp_windows_header_fragment [private]
?

Definition at line 138 of file cmt_generators.h.

Referenced by MSDEVGenerator(), and reset().

FragmentHandle MSDEVGenerator::dsw_all_project_dependency_fragment [private]
?

Definition at line 131 of file cmt_generators.h.

Referenced by MSDEVGenerator(), and reset().

FragmentHandle MSDEVGenerator::dsw_all_project_header_fragment [private]
?

Definition at line 130 of file cmt_generators.h.

Referenced by MSDEVGenerator(), and reset().

FragmentHandle MSDEVGenerator::dsw_all_project_trailer_fragment [private]
?

Definition at line 132 of file cmt_generators.h.

Referenced by MSDEVGenerator(), and reset().

FragmentHandle MSDEVGenerator::dsw_header_fragment [private]
?

Definition at line 128 of file cmt_generators.h.

Referenced by MSDEVGenerator(), and reset().

FragmentHandle MSDEVGenerator::dsw_project_fragment [private]
?

Definition at line 129 of file cmt_generators.h.

Referenced by MSDEVGenerator(), and reset().

FragmentHandle MSDEVGenerator::dsw_trailer_fragment [private]
?

Definition at line 133 of file cmt_generators.h.

Referenced by MSDEVGenerator(), and reset().

cmt_string MSDEVGenerator::msdevdir [private]
?

Definition at line 126 of file cmt_generators.h.

Referenced by reset().


The documentation for this class was generated from the following files:
Generated on Wed Sep 1 11:00:45 2004 for CMT by 1.2.18