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

FragmentHandle Class Reference

#include <cmt_fragment.h>

Collaboration diagram for FragmentHandle:

Collaboration graph
[legend]
List of all members.

Public Methods

 FragmentHandle ()
 FragmentHandle (const cmt_string name)
FragmentHandle& operator= (const FragmentHandle& other)
void reset ()
void set (const cmt_string name)
cmt_stringname ()
cmt_stringsuffix ()
cmt_stringheader ()
cmt_stringtrailer ()
bool need_dependencies ()
bool copy (FILE* out, int variables, ...)
bool copy (cmt_string& out, int variables, ...)
bool wincopy (FILE* out, int variables, ...)
bool wincopy (cmt_string& out, int variables, ...)
bool copy (FILE* out, const Variable::VariableVector& vector, int variables, ...)
bool copy (cmt_string& out, const Variable::VariableVector& vector, int variables, ...)
bool wincopy (FILE* out, const Variable::VariableVector& vector, int variables, ...)
bool wincopy (cmt_string& out, const Variable::VariableVector& vector, int variables, ...)

Private Methods

bool setup ()

Private Attributes

Fragment_fragment
cmt_string _name
bool _initialized

Constructor & Destructor Documentation

FragmentHandle::FragmentHandle ( )
 

Definition at line 949 of file cmt_fragment.cxx.

00950 {
00951   _fragment = 0;
00952   _initialized = false;
00953 }

FragmentHandle::FragmentHandle ( const cmt_string name )
 

Definition at line 956 of file cmt_fragment.cxx.

00956                                                      : _name(name)
00957 {
00958   _fragment = 0;
00959   _initialized = false;
00960 }


Member Function Documentation

bool FragmentHandle::copy ( cmt_string & out,
const Variable::VariableVector & vector,
int variables,
... )
 

Definition at line 1139 of file cmt_fragment.cxx.

01140 {
01141   if (!setup ()) return (false);
01142 
01143   va_list ids;
01144 
01145   va_start (ids, variables);
01146   bool result = _fragment->copy (out, vector, variables, ids);
01147   va_end (ids);
01148 
01149   if (!result)
01150     {
01151       cout << "#CMT> Fragment " << _name << " not found" << endl;
01152       _fragment = 0;
01153     }
01154 
01155   return (result);
01156 }

bool FragmentHandle::copy ( FILE * out,
const Variable::VariableVector & vector,
int variables,
... )
 

Definition at line 1119 of file cmt_fragment.cxx.

01120 {
01121   if (!setup ()) return (false);
01122 
01123   va_list ids;
01124 
01125   va_start (ids, variables);
01126   bool result = _fragment->copy (out, vector, variables, ids);
01127   va_end (ids);
01128 
01129   if (!result)
01130     {
01131       cout << "#CMT> Fragment " << _name << " not found" << endl;
01132       _fragment = 0;
01133     }
01134 
01135   return (result);
01136 }

bool FragmentHandle::copy ( cmt_string & out,
int variables,
... )
 

Definition at line 1056 of file cmt_fragment.cxx.

01057 {
01058   if (!setup ()) return (false);
01059 
01060   va_list ids;
01061 
01062   va_start (ids, variables);
01063   bool result = _fragment->copy (out, variables, ids);
01064   va_end (ids);
01065 
01066   if (!result)
01067     {
01068       cout << "#CMT> Fragment " << _name << " not found" << endl;
01069       _fragment = 0;
01070     }
01071 
01072   return (result);
01073 }

bool FragmentHandle::copy ( FILE * out,
int variables,
... )
 

Definition at line 1036 of file cmt_fragment.cxx.

Referenced by Generator::build_constituents_makefile(), MakefileGenerator::build_document_makefile(), MakefileGenerator::build_library_makefile(), Generator::build_make_setup(), Generator::build_readme(), CmtModel::expand(), MakefileGenerator::java_file_action(), and MakefileGenerator::proto_file_action().

01037 {
01038   if (!setup ()) return (false);
01039 
01040   va_list ids;
01041 
01042   va_start (ids, variables);
01043   bool result = _fragment->copy (out, variables, ids);
01044   va_end (ids);
01045 
01046   if (!result)
01047     {
01048       cout << "#CMT> Fragment " << _name << " not found" << endl;
01049       _fragment = 0;
01050     }
01051 
01052   return (result);
01053 }

cmt_string & FragmentHandle::header ( )
 

Definition at line 1008 of file cmt_fragment.cxx.

01009 {
01010   static cmt_string null_string;
01011 
01012   if (!setup ()) return (null_string);
01013 
01014   return (_fragment->header);
01015 }

cmt_string & FragmentHandle::name ( )
 

Definition at line 988 of file cmt_fragment.cxx.

00989 {
00990   static cmt_string null_string;
00991 
00992   if (!setup ()) return (null_string);
00993 
00994   return (_fragment->name);
00995 }

bool FragmentHandle::need_dependencies ( )
 

Definition at line 1028 of file cmt_fragment.cxx.

01029 {
01030   if (!setup ()) return (false);
01031 
01032   return (_fragment->need_dependencies);
01033 }

FragmentHandle & FragmentHandle::operator= ( const FragmentHandle & other )
 

Definition at line 963 of file cmt_fragment.cxx.

00964 {
00965   _name = other._name;
00966   _fragment = 0;
00967   _initialized = false;
00968 
00969   return (*this);
00970 }

void FragmentHandle::reset ( )
 

Definition at line 973 of file cmt_fragment.cxx.

Referenced by MakefileGenerator::reset().

00974 {
00975   _fragment = 0;
00976   _initialized = false;
00977 }

void FragmentHandle::set ( const cmt_string name )
 

Definition at line 980 of file cmt_fragment.cxx.

00981 {
00982   _name = name;
00983   _fragment = 0;
00984   _initialized = false;
00985 }

bool FragmentHandle::setup ( ) [private]
 

Definition at line 1201 of file cmt_fragment.cxx.

Referenced by copy(), header(), name(), need_dependencies(), suffix(), trailer(), and wincopy().

01202 {
01203   if (!_initialized)
01204     {
01205       _initialized = true;
01206 
01207       _fragment = Fragment::find (_name);
01208       if (_fragment == 0)
01209         {
01210           cout << "#CMT> Fragment " << _name << " not found" << endl;
01211         }
01212     }
01213 
01214   if (_fragment == 0)
01215     {
01216       return (false);
01217     }
01218   else
01219     {
01220       return (true);
01221     }
01222 }

cmt_string & FragmentHandle::suffix ( )
 

Definition at line 998 of file cmt_fragment.cxx.

00999 {
01000   static cmt_string null_string;
01001 
01002   if (!setup ()) return (null_string);
01003 
01004   return (_fragment->suffix);
01005 }

cmt_string & FragmentHandle::trailer ( )
 

Definition at line 1018 of file cmt_fragment.cxx.

01019 {
01020   static cmt_string null_string;
01021 
01022   if (!setup ()) return (null_string);
01023 
01024   return (_fragment->trailer);
01025 }

bool FragmentHandle::wincopy ( cmt_string & out,
const Variable::VariableVector & vector,
int variables,
... )
 

Definition at line 1179 of file cmt_fragment.cxx.

01182 {
01183   if (!setup ()) return (false);
01184 
01185   va_list ids;
01186 
01187   va_start (ids, variables);
01188   bool result = _fragment->wincopy (out, vector, variables, ids);
01189   va_end (ids);
01190 
01191   if (!result)
01192     {
01193       cout << "#CMT> Fragment " << _name << " not found" << endl;
01194       _fragment = 0;
01195     }
01196 
01197   return (result);
01198 }

bool FragmentHandle::wincopy ( FILE * out,
const Variable::VariableVector & vector,
int variables,
... )
 

Definition at line 1159 of file cmt_fragment.cxx.

01160 {
01161   if (!setup ()) return (false);
01162 
01163   va_list ids;
01164 
01165   va_start (ids, variables);
01166   bool result = _fragment->wincopy (out, vector, variables, ids);
01167   va_end (ids);
01168 
01169   if (!result)
01170     {
01171       cout << "#CMT> Fragment " << _name << " not found" << endl;
01172       _fragment = 0;
01173     }
01174 
01175   return (result);
01176 }

bool FragmentHandle::wincopy ( cmt_string & out,
int variables,
... )
 

Definition at line 1096 of file cmt_fragment.cxx.

01097 {
01098   if (!setup ()) return (false);
01099 
01100   va_list ids;
01101 
01102   va_start (ids, variables);
01103   bool result = _fragment->wincopy (out, variables, ids);
01104   va_end (ids);
01105 
01106   if (!result)
01107     {
01108       cout << "#CMT> Fragment " << _name << " not found" << endl;
01109       _fragment = 0;
01110     }
01111 
01112   return (result);
01113 }

bool FragmentHandle::wincopy ( FILE * out,
int variables,
... )
 

Definition at line 1076 of file cmt_fragment.cxx.

Referenced by Generator::build_msdev(), and Generator::build_msdev_workspace().

01077 {
01078   if (!setup ()) return (false);
01079 
01080   va_list ids;
01081 
01082   va_start (ids, variables);
01083   bool result = _fragment->wincopy (out, variables, ids);
01084   va_end (ids);
01085 
01086   if (!result)
01087     {
01088       cout << "#CMT> Fragment " << _name << " not found" << endl;
01089       _fragment = 0;
01090     }
01091 
01092   return (result);
01093 }


Member Data Documentation

Fragment * FragmentHandle::_fragment [private]
 

Definition at line 129 of file cmt_fragment.h.

bool FragmentHandle::_initialized [private]
 

Definition at line 131 of file cmt_fragment.h.

cmt_string FragmentHandle::_name [private]
 

Definition at line 130 of file cmt_fragment.h.


The documentation for this class was generated from the following files:
Generated at Mon Jun 10 17:58:41 2002 for CMT by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000