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

match.h

00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Radko Mihal                                     *
00003  *   rmihal@pobox.sk                                                       *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.              *
00019  ***************************************************************************/
00020 #ifndef EXTENDED_REGULAR_EXPRESSIONMATCH_H
00021 #define EXTENDED_REGULAR_EXPRESSIONMATCH_H
00022 
00023 namespace extended_regular_expression {
00024 
00025 
00026 class match
00027 {
00028         unsigned long   m_pos;
00029         unsigned long   m_size;
00030         bool                    m_is_valid;
00031 public:
00032     match() : m_pos(0), m_size(0), m_is_valid(false) {};
00033     match( unsigned long pos, unsigned long size ) :
00034                 m_pos(pos), 
00035                 m_size(size), 
00036                 m_is_valid(true) {};
00037     ~match() {};
00038         
00039         unsigned long get_pos() const
00040         {
00041                 return m_pos;
00042         }
00043         
00044         unsigned long get_size() const
00045         {
00046                 return m_size;
00047         }
00048         
00049         void set_pos( unsigned long pos )
00050         {
00051                 m_pos = pos;
00052         }
00053         
00054         void set_size( unsigned long size )
00055         {
00056                 m_size = size;
00057         }
00058 
00059         match& operator = ( const match& m )
00060         {
00061                 m_pos = m.get_pos();
00062                 m_size = m.get_size();
00063         }
00064         
00065         bool is_valid()
00066         {
00067                 return m_is_valid;
00068         }
00069 };
00070 
00071 };
00072 
00073 #endif

Generated on Sun Jul 2 18:39:43 2006 for grammar2parser.kdevelop by  doxygen 1.4.1