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, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef FILTER_READER_H_
22#define FILTER_READER_H_
23
24#include <richio.h>
25#include <wx/string.h>
26
27
33{
34public:
38 FILTER_READER( LINE_READER& aReader );
39
41
42 char* ReadLine() override;
43
44 const wxString& GetSource() const override
45 {
46 return reader.GetSource();
47 }
48
49 unsigned LineNumber() const override
50 {
51 return reader.LineNumber();
52 }
53
54private:
56};
57
58
65{
66public:
71
73
74 char* ReadLine() override;
75
76 const wxString& GetSource() const override
77 {
78 return reader.GetSource();
79 }
80
81 unsigned LineNumber() const override
82 {
83 return reader.LineNumber();
84 }
85
86private:
88};
89
90#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:100
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.