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

cmt_string_node Class Reference

Inheritance diagram for cmt_string_node:

Inheritance graph
[legend]
Collaboration diagram for cmt_string_node:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 cmt_string_node (const cmt_string &s)
const cmt_regexp::iterator match (const cmt_string &text, int pos) const
void dump () const

Private Attributes

cmt_string _s

Constructor & Destructor Documentation

cmt_string_node::cmt_string_node const cmt_string s  ) 
 

Definition at line 353 of file cmt_regexp.cxx.

References _s.

00354 {
00355   _s = s;
00356 }


Member Function Documentation

void cmt_string_node::dump  )  const [virtual]
 

Reimplemented from cmt_regexp_node.

Definition at line 378 of file cmt_regexp.cxx.

References _s, and tab().

00379 {
00380   tab (); cout << "string (" << this << ") s=[" << _s << "]" << endl;
00381 }

const cmt_regexp::iterator cmt_string_node::match const cmt_string text,
int  pos
const [virtual]
 

Reimplemented from cmt_regexp_node.

Definition at line 358 of file cmt_regexp.cxx.

References _s, cmt_regexp::iterator::null(), cmt_string::size(), and cmt_string::substr().

00360 {
00361   if ((pos < 0) || (pos > text.size ())) 
00362     {
00363       return (cmt_regexp::iterator::null ());
00364     }
00365 
00366   int length = _s.size ();
00367   
00368   cmt_string s = text.substr (pos, length);
00369   
00370   if ((length == 0) || (s == _s))
00371     {
00372       return (cmt_regexp::iterator (pos, length));
00373     }
00374   
00375   return (cmt_regexp::iterator::null ());
00376 }


Member Data Documentation

cmt_string cmt_string_node::_s [private]
 

Definition at line 78 of file cmt_regexp.cxx.

Referenced by cmt_string_node(), dump(), and match().


The documentation for this class was generated from the following file:
Generated on Mon May 2 10:25:31 2005 for CMT by doxygen 1.3.5