KiCad PCB EDA Suite
filter_reader.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2007-2010 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
5  * Copyright (C) 2007-2020 KiCad Developers, see change_log.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef FILTER_READER_H_
26 #define FILTER_READER_H_
27 
28 #include <wx/wx.h>
29 #include <richio.h>
30 
31 
36 class FILTER_READER : public LINE_READER
37 {
38 public:
42  FILTER_READER( LINE_READER& aReader );
43 
45 
46  char* ReadLine() override;
47 
48  const wxString& GetSource() const override
49  {
50  return reader.GetSource();
51  }
52 
53  unsigned LineNumber() const override
54  {
55  return reader.LineNumber();
56  }
57 
58 private:
60 };
61 
62 
69 {
70 public:
75 
77 
78  char* ReadLine() override;
79 
80  const wxString& GetSource() const override
81  {
82  return reader.GetSource();
83  }
84 
85  unsigned LineNumber() const override
86  {
87  return reader.LineNumber();
88  }
89 
90 private:
92 };
93 
94 #endif // FILTER_READER_H_
LINE_READER & reader
Definition: filter_reader.h:59
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:80
virtual const wxString & GetSource() const
Returns the name of the source of the lines in an abstract sense.
Definition: richio.h:109
Read lines of text from another LINE_READER but only returns non-comment lines and non-blank lines wi...
Definition: filter_reader.h:68
char * ReadLine() override
Read a line of text into the buffer and increments the line number counter.
unsigned LineNumber() const override
Return the line number of the last line read from this LINE_READER.
Definition: filter_reader.h:85
virtual unsigned LineNumber() const
Return the line number of the last line read from this LINE_READER.
Definition: richio.h:135
WHITESPACE_FILTER_READER(LINE_READER &aReader)
Doe not take ownership over aReader, so will not destroy it.
char * ReadLine() override
Read a line of text into the buffer and increments the line number counter.
const wxString & GetSource() const override
Returns the name of the source of the lines in an abstract sense.
Definition: filter_reader.h:80
unsigned LineNumber() const override
Return the line number of the last line read from this LINE_READER.
Definition: filter_reader.h:53
const wxString & GetSource() const override
Returns the name of the source of the lines in an abstract sense.
Definition: filter_reader.h:48
Read lines of text from another LINE_READER but only returns non-comment lines and non-blank lines fr...
Definition: filter_reader.h:36
FILTER_READER(LINE_READER &aReader)
Does not take ownership over aReader so will not destroy it.