7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-11 14:50:11 +00:00

Embedded files parser in own header

This drags in dsnlexer.h to everything that uses EMBEDDED_FILES, but the
parser is actually only used in two files. It's not the only thing to
drag it in, though.

Currently, touching dsnlexer.h rebuilds nearly 800 files, when it
actually is needed by about 50 at most.
This commit is contained in:
John Beard 2024-10-03 22:31:24 +01:00
parent bc9b908de5
commit 436671edc3
5 changed files with 40 additions and 20 deletions

View File

@ -17,6 +17,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "embedded_files.h"
#include "embedded_files_parser.h"
#include <wx/base64.h>
#include <wx/debug.h>
#include <wx/file.h>
@ -31,7 +34,6 @@
#include <zstd.h>
#include <embedded_files.h>
#include <kiid.h>
#include <mmh3_hash.h>
#include <paths.h>

View File

@ -37,6 +37,7 @@
#include <base_units.h>
#include <bitmap_base.h>
#include <embedded_files_parser.h>
#include <lib_id.h>
#include <sch_pin.h>
#include <math/util.h> // KiROUND

View File

@ -17,15 +17,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EMBEDDED_FILES_H
#define EMBEDDED_FILES_H
#pragma once
#include <map>
#include <wx/string.h>
#include <wx/filename.h>
#include <embedded_files_lexer.h>
#include <mmh3_hash.h>
#include <picosha2.h>
#include <richio.h>
@ -242,18 +240,3 @@ protected:
// Otherwise, font files embedded in the element will be
// removed on save
};
class EMBEDDED_FILES_PARSER : public EMBEDDED_FILES_LEXER
{
public:
EMBEDDED_FILES_PARSER( LINE_READER* aReader ) :
EMBEDDED_FILES_LEXER( aReader )
{
}
void ParseEmbedded( EMBEDDED_FILES* aFiles );
};
#endif // EMBEDDED_FILES_H

View File

@ -0,0 +1,34 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <embedded_files.h>
#include <embedded_files_lexer.h>
class EMBEDDED_FILES_PARSER : public EMBEDDED_FILES_LEXER
{
public:
EMBEDDED_FILES_PARSER( LINE_READER* aReader ) :
EMBEDDED_FILES_LEXER( aReader )
{
}
void ParseEmbedded( EMBEDDED_FILES* aFiles );
};

View File

@ -37,7 +37,7 @@
#include <board.h>
#include <board_design_settings.h>
#include <embedded_files.h>
#include <embedded_files_parser.h>
#include <font/fontconfig.h>
#include <magic_enum.hpp>
#include <pcb_dimension.h>