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

CmtMountFilterParser Class Reference

try to remove this current CMTPATH entry from path. More...

Inheritance diagram for CmtMountFilterParser:

[legend]
Collaboration diagram for CmtMountFilterParser:

[legend]
List of all members.

Public Methods

? CmtMountFilterParser ()
void? reset ()
bool? is_done () const
const cmt_string &? get_current_dir () const
void? set_prefix (const cmt_string &prefix)
void? filter (const cmt_string &line)

Private Attributes

bool? m_done
cmt_string? m_prefix
cmt_string? m_current_dir

Detailed Description

try to remove this current CMTPATH entry from path.

This has a meaning when the specified path already contains an absolute path.

Definition at line 671 of file cmt_parser.cxx.


Constructor & Destructor Documentation

CmtMountFilterParser::CmtMountFilterParser (? ? )? [inline]
?

Definition at line 675 of file cmt_parser.cxx.

References reset().

00676   {
00677     reset ();
00678   }

Member Function Documentation

void CmtMountFilterParser::filter (? const cmt_string &? ? line )? [inline, virtual]
?

Reimplemented from Awk.

Definition at line 702 of file cmt_parser.cxx.

References cmt_string::find(), m_current_dir, m_done, m_prefix, cmt_string::npos, cmt_string::replace(), cmt_vector< cmt_string >::size(), CmtSystem::split(), and Awk::stop().

00703   {
00704     //cout << "line=" << line << endl;
00705 
00706     if (m_done) 
00707       {
00708         stop ();
00709         return;
00710       }
00711 
00712     CmtSystem::cmt_string_vector words;
00713 
00714     CmtSystem::split (line, " \t", words);
00715 
00716     int requested = 2;
00717 
00718     if (m_prefix != "")
00719       {
00720         requested++;
00721       }
00722 
00723     if (words.size () < requested) return;
00724 
00725     int n = 0;
00726 
00727     if (m_prefix != "")
00728       {
00729         if (words[n] != m_prefix) return;
00730         n++;
00731       }
00732 
00733     cmt_string& path_name = words[n];
00734     cmt_string& replacement = words[n+1];
00735     
00736     if (m_current_dir.find (path_name) != cmt_string::npos)
00737       {
00738         m_current_dir.replace (path_name, replacement);
00739         m_done = true;
00740         stop ();
00741       }
00742   }

const cmt_string& CmtMountFilterParser::get_current_dir (? ? )? const [inline]
?

Definition at line 692 of file cmt_parser.cxx.

Referenced by Cmt::configure_current_dir().

00693   {
00694     return (m_current_dir);
00695   }

bool CmtMountFilterParser::is_done (? ? )? const [inline]
?

Definition at line 687 of file cmt_parser.cxx.

00688   {
00689     return (m_done);
00690   }

void CmtMountFilterParser::reset (? ? )? [inline]
?

Definition at line 680 of file cmt_parser.cxx.

References m_current_dir, m_done, m_prefix, and CmtSystem::pwd().

Referenced by CmtMountFilterParser().

00681   {
00682     m_current_dir = CmtSystem::pwd ();
00683     m_done = false;
00684     m_prefix = "";
00685   }

void CmtMountFilterParser::set_prefix (? const cmt_string &? ? prefix )? [inline]
?

Definition at line 697 of file cmt_parser.cxx.

References m_prefix.

Referenced by Cmt::configure_current_dir().

00698   {
00699     m_prefix = prefix;
00700   }

Member Data Documentation

cmt_string CmtMountFilterParser::m_current_dir [private]
?

Definition at line 747 of file cmt_parser.cxx.

Referenced by filter(), and reset().

bool CmtMountFilterParser::m_done [private]
?

Definition at line 745 of file cmt_parser.cxx.

Referenced by filter(), and reset().

cmt_string CmtMountFilterParser::m_prefix [private]
?

Definition at line 746 of file cmt_parser.cxx.

Referenced by filter(), reset(), and set_prefix().


The documentation for this class was generated from the following file:
Generated on Thu Jul 1 15:26:43 2004 for CMT by 1.2.18