Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

Variable Class Reference

#include <cmt_fragment.h>

Collaboration diagram for Variable:

Collaboration graph
[legend]
List of all members.

Public Types

typedef cmt_vector< VariableVariableVector

Public Member Functions

 Variable ()
 Variable (const cmt_string &n)
const cmt_stringmacro_braces () const
const cmt_stringmacro_pars () const
void set (const cmt_string &new_name, const cmt_string &new_value="")
Variableoperator= (const Variable &other)
Variableoperator= (const cmt_string &v)
void operator+= (const cmt_string &v)
cmt_string operator+ (const cmt_string &v) const
 operator const cmt_string & () const
bool operator== (const cmt_string &v) const
bool operator!= (const cmt_string &v) const

Static Public Member Functions

Variablefind (VariableVector &vector, const cmt_string &name)

Public Attributes

cmt_string name
cmt_string value

Private Attributes

cmt_string m_macro_braces
cmt_string m_macro_pars

Member Typedef Documentation

typedef cmt_vector<Variable> Variable::VariableVector
 

Definition at line 19 of file cmt_fragment.h.

Referenced by FragmentHandle::copy(), Fragment::copy(), CmtModel::expand(), find(), CmtModel::strict_expand(), FragmentHandle::wincopy(), and Fragment::wincopy().


Constructor & Destructor Documentation

Variable::Variable  ) 
 

Definition at line 39 of file cmt_fragment.cxx.

00040 {
00041 }

Variable::Variable const cmt_string n  ) 
 

Definition at line 44 of file cmt_fragment.cxx.

References m_macro_braces, m_macro_pars, and name.

00044                                        : name (n)
00045 {
00046   m_macro_braces = "${";
00047   m_macro_braces += name;
00048   m_macro_braces += "}";
00049 
00050   m_macro_pars = "$(";
00051   m_macro_pars += name;
00052   m_macro_pars += ")";
00053 }


Member Function Documentation

Variable * Variable::find VariableVector vector,
const cmt_string name
[static]
 

Definition at line 25 of file cmt_fragment.cxx.

References name, cmt_vector< T >::size(), and VariableVector.

Referenced by CmtModel::expand(), constituents_action_iterator::set(), and CmtModel::strict_expand().

00027 {
00028   for (int i = 0; i < vector.size (); i++)
00029     {
00030       Variable& v = vector[i];
00031 
00032       if (v.name == name) return (&v);
00033     }
00034 
00035   return (0);
00036 }

const cmt_string & Variable::macro_braces  )  const
 

Definition at line 56 of file cmt_fragment.cxx.

References m_macro_braces.

Referenced by Fragment::copy(), and Fragment::wincopy().

00057 {
00058   return (m_macro_braces);
00059 }

const cmt_string & Variable::macro_pars  )  const
 

Definition at line 62 of file cmt_fragment.cxx.

References m_macro_pars.

Referenced by Fragment::copy(), and Fragment::wincopy().

00063 {
00064   return (m_macro_pars);
00065 }

Variable::operator const cmt_string &  )  const
 

Definition at line 110 of file cmt_fragment.cxx.

References value.

00111 {
00112   return (value);
00113 }

bool Variable::operator!= const cmt_string v  )  const
 

Definition at line 122 of file cmt_fragment.cxx.

References value.

00123 {
00124   return ((value != v));
00125 }

cmt_string Variable::operator+ const cmt_string v  )  const
 

Definition at line 104 of file cmt_fragment.cxx.

References value.

00105 {
00106   return (value + v);
00107 }

void Variable::operator+= const cmt_string v  ) 
 

Definition at line 98 of file cmt_fragment.cxx.

References value.

00099 {
00100   value += v;
00101 }

Variable & Variable::operator= const cmt_string v  ) 
 

Definition at line 91 of file cmt_fragment.cxx.

References value.

00092 {
00093   value = v;
00094   return (*this);
00095 }

Variable & Variable::operator= const Variable other  ) 
 

Definition at line 84 of file cmt_fragment.cxx.

References value.

00085 {
00086   value = other.value;
00087   return (*this);
00088 }

bool Variable::operator== const cmt_string v  )  const
 

Definition at line 116 of file cmt_fragment.cxx.

References value.

00117 {
00118   return ((value == v));
00119 }

void Variable::set const cmt_string new_name,
const cmt_string new_value = ""
 

Definition at line 68 of file cmt_fragment.cxx.

References m_macro_braces, m_macro_pars, name, and value.

Referenced by AnyDocumentGenerator::AnyDocumentGenerator(), CmtGenerator::CmtGenerator(), CmtModel::expand(), constituents_action_iterator::set(), and CmtModel::strict_expand().

00070 {
00071   name = new_name;
00072   value = new_value;
00073 
00074   m_macro_braces = "${";
00075   m_macro_braces += name;
00076   m_macro_braces += "}";
00077 
00078   m_macro_pars = "$(";
00079   m_macro_pars += name;
00080   m_macro_pars += ")";
00081 }


Member Data Documentation

cmt_string Variable::m_macro_braces [private]
 

Definition at line 46 of file cmt_fragment.h.

Referenced by macro_braces(), set(), and Variable().

cmt_string Variable::m_macro_pars [private]
 

Definition at line 47 of file cmt_fragment.h.

Referenced by macro_pars(), set(), and Variable().

cmt_string Variable::name
 

Definition at line 42 of file cmt_fragment.h.

Referenced by find(), set(), Constituent::show(), and Variable().

cmt_string Variable::value
 

Definition at line 43 of file cmt_fragment.h.

Referenced by DocumentGenerator::build(), LibraryGenerator::build(), Fragment::copy(), LibraryGenerator::java_file_action(), LibraryGenerator::module_file_action(), operator const cmt_string &(), operator!=(), operator+(), operator+=(), operator=(), operator==(), LibraryGenerator::proto_file_action(), set(), Constituent::show(), and Fragment::wincopy().


The documentation for this class was generated from the following files:
Generated on Mon May 2 10:26:05 2005 for CMT by doxygen 1.3.5