KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.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 <richio.h>
29#include <wx/string.h>
30
31
37{
38public:
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
58private:
60};
61
62
69{
70public:
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
90private:
92};
93
94#endif // FILTER_READER_H_
LINE_READER & reader
const wxString & GetSource() const override
Returns the name of the source of the lines in an abstract sense.
char * ReadLine() override
Read a line of text into the buffer and increments the line number counter.
FILTER_READER(LINE_READER &aReader)
Does not take ownership over aReader so will not destroy it.
unsigned LineNumber() const override
Return the line number of the last line read from this LINE_READER.
LINE_READER(unsigned aMaxLineLength=LINE_READER_LINE_DEFAULT_MAX)
Build a line reader and fixes the length of the maximum supported line length to aMaxLineLength.
Definition richio.cpp:141
WHITESPACE_FILTER_READER(LINE_READER &aReader)
Do not take ownership over aReader, so will not destroy it.
const wxString & GetSource() const override
Returns the name of the source of the lines in an abstract sense.
unsigned LineNumber() const override
Return the line number of the last line read from this LINE_READER.
char * ReadLine() override
Read a line of text into the buffer and increments the line number counter.