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

# Include Class Reference

`#include <cmt_include.h>`

Collaboration diagram for Include:

[legend]
List of all members.

## Public Types
typedef cmt_vector<Include> | IncludeVector
## Public Methods
| Include ()
| ~Include ()
## Public Attributes
cmt_string | name
Use* | use
## Static Public Methods
void | action (const CmtSystem::cmt_string_vector& words, Use* use)
Include* | find (const cmt_string& name, Use* use)
Include* | add (const cmt_string& name, Use* use)
void | print_all (PrintMode mode)
void | print_filters (PrintMode mode)
void | clear_all ()

## Member Typedef Documentation

typedef cmt_vector<Include> Include::IncludeVector

| Definition at line 10 of file cmt_include.h.

## Constructor & Destructor Documentation

Include::Include ( | )

| Definition at line 191 of file cmt_include.cxx.
    00193 {
    00194   use = 0;
    00195 }

Include::~Include ( | )

| Definition at line 198 of file cmt_include.cxx.
    00200 {
    00201   use = 0;
    00202 }

## Member Function Documentation

void Include::action ( | const CmtSystem::cmt_string_vector & words,
| Use * use )`[static]`

| Definition at line 16 of file cmt_include.cxx. Referenced by Cmt::select().
    00018 {
    00019   cmt_string name;
    00020
    00021   if (use == 0) use = &(Use::current());
    00022
    00023   for (int i = 1; i < words.size (); i++)
    00024     {
    00025       name = words[i];
    00026       if (name == "") return;
    00027       add (name, use);
    00028     }
    00029 }

Include * Include::add ( | const cmt_string & name,
| Use * use )`[static]`

| Definition at line 59 of file cmt_include.cxx.
    00061 {
    00062   if (name == "") return (0);
    00063
    00064   if (use == 0) use = &(Use::current());
    00065
    00066   {
    00067     Include* incl;
    00068
    00069     incl = find (name, use);
    00070     if (incl != 0) return (incl);
    00071   }
    00072
    00073   Include& incl = use->includes.add ();
    00074
    00075   incl.name = name;
    00076   incl.use = use;
    00077
    00078   return (&incl);
    00079 }

void Include::clear_all ( | )`[static]`

| Definition at line 185 of file cmt_include.cxx. Referenced by Cmt::clear().
    00187 {
    00188 }

Include * Include::find ( | const cmt_string & name,
| Use * use )`[static]`

| Definition at line 32 of file cmt_include.cxx.
    00034 {
    00035   int include_index;
    00036
    00037   if (use == 0) use = &(Use::current());
    00038
    00039   if (use->includes.size () == 0) return (0);
    00040
    00041   for (include_index = 0;
    00042        include_index < use->includes.size ();
    00043        include_index++)
    00044     {
    00045       Include& incl = use->includes[include_index];
    00046
    00047       if (incl.use != use) continue;
    00048
    00049       if (incl.name == name)
    00050         {
    00051           return (&incl);
    00052         }
    00053     }
    00054
    00055   return (0);
    00056 }

void Include::print_all ( | PrintMode mode )`[static]`

| Definition at line 82 of file cmt_include.cxx.
    00084 {
    00085   int number;
    00086   int include_number;
    00087   Use::UsePtrVector& uses = Use::uses ();
    00088
    00089   if (uses.size () > 0)
    00090     {
    00091       for (number = 0; number < uses.size (); number++)
    00092         {
    00093           const Use* use = uses[number];
    00094
    00095           if (use->package == "CMT") continue;
    00096
    00097           cout << "-I${" << use->prefix << "ROOT}/src ";
    00098
    00099           for (include_number = 0;
    00100                include_number < use->includes.size ();
    00101                include_number++)
    00102             {
    00103               const Include& incl = use->includes[include_number];
    00104
    00105               cout << "-I" << incl.name << " ";
    00106             }
    00107         }
    00108     }
    00109
    00110   for (include_number = 0;
    00111        include_number < (Use::current()).includes.size ();
    00112        include_number++)
    00113     {
    00114       const Include& incl = (Use::current()).includes[include_number];
    00115
    00116       cout << "-I" << incl.name << " ";
    00117     }
    00118 }

void Include::print_filters ( | PrintMode mode )`[static]`

| Definition at line 121 of file cmt_include.cxx.
    00123 {
    00124   int number;
    00125   int include_number;
    00126   Use::UsePtrVector& uses = Use::uses ();
    00127
    00128   if (uses.size () > 0)
    00129     {
    00130       for (number = 0; number < uses.size (); number++)
    00131         {
    00132           Use* use = uses[number];
    00133
    00134           cout << "s#" <<
    00135               ".*" << SLASH <<
    00136               use->package << SLASH <<
    00137               use->version << SLASH <<
    00138               "#$(" << use->prefix << "ROOT)" << SLASH <<
    00139               "#g" << endl;
    00140
    00141           for (include_number = 0;
    00142                include_number < use->includes.size ();
    00143                include_number++)
    00144             {
    00145               Include& incl = use->includes[include_number];
    00146
    00147               const cmt_string& d = Cmt::filter_dir (incl.name);
    00148
    00149               if (d.size () > 0)
    00150                 {
    00151                   cout << "s#" << d << "#" <<
    00152                       incl.name << "#g" << endl;
    00153                 }
    00154             }
    00155         }
    00156     }
    00157
    00158   {
    00159     const Use* use = &(Use::current());
    00160
    00161     cout << "s#" << ".*" << SLASH <<
    00162         use->package << SLASH <<
    00163         use->version << SLASH <<
    00164         "#$(" << use->prefix << "ROOT)" << SLASH <<
    00165         "#g" << endl;
    00166
    00167     for (include_number = 0;
    00168          include_number < use->includes.size ();
    00169          include_number++)
    00170       {
    00171         const Include& incl = use->includes[include_number];
    00172
    00173         const cmt_string& d = Cmt::filter_dir (incl.name);
    00174
    00175         if (d.size () > 0)
    00176           {
    00177             cout << "s#" << d << "#" <<
    00178                 incl.name << "#g" << endl;
    00179           }
    00180       }
    00181   }
    00182 }

## Member Data Documentation

cmt_string Include::name

| Definition at line 23 of file cmt_include.h.

Use * Include::use

| Definition at line 24 of file cmt_include.h.

The documentation for this class was generated from the following files:

- cmt_include.h
- cmt_include.cxx