KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_parser_tool.cpp File Reference
#include <qa_utils/utility_registry.h>
#include <chrono>
#include <fstream>
#include <iostream>
#include <string>
#include <wx/cmdline.h>
#include <wx/msgout.h>
#include <fmt/format.h>
#include <board.h>
#include <board_item.h>
#include <common.h>
#include <core/profile.h>
#include <pcb_io/allegro/pcb_io_allegro.h>
#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.h>
#include <qa_utils/stdstream_line_reader.h>

Go to the source code of this file.

Classes

class  BOARD_PARSER
 Generic board parser - this makes no assumption about what the source data might be. More...
 
class  FILE_PARSER
 Provide the BOARD_PARSER interface wrapping a normal PCB_IO file-based plugin lookup. More...
 
class  STREAM_PARSER
 In order to support fuzz testing, we need to be able to parse from stdin. More...
 
class  SEXPR_STREAM_PARSER
 
class  ALLEGRO_BRD_STREAM_PARSER
 
class  PCB_PARSE_RUNNER
 Runs a BOARD_PARSER against a filename or stream and reports results. More...
 

Typedefs

using PARSE_DURATION = std::chrono::microseconds
 

Enumerations

enum  PARSER_RET_CODES { PARSE_FAILED = KI_TEST::RET_CODES::TOOL_SPECIFIC }
 

Functions

static PCB_IO_MGR::PCB_FILE_T FindPluginTypeFromParams (const wxString &aExplicitPlugin, const wxString &aPath)
 
int pcb_parser_main_func (int argc, char **argv)
 

Variables

static const wxCmdLineEntryDesc g_cmdLineDesc []
 
static const std::map< std::string, PCB_IO_MGR::PCB_FILE_TpluginTypeMap
 Map from command line keys to plugin types.
 
static bool registered
 

Typedef Documentation

◆ PARSE_DURATION

using PARSE_DURATION = std::chrono::microseconds

Definition at line 47 of file pcb_parser_tool.cpp.

Enumeration Type Documentation

◆ PARSER_RET_CODES

Enumerator
PARSE_FAILED 

Definition at line 290 of file pcb_parser_tool.cpp.

Function Documentation

◆ FindPluginTypeFromParams()

static PCB_IO_MGR::PCB_FILE_T FindPluginTypeFromParams ( const wxString & aExplicitPlugin,
const wxString & aPath )
static

◆ pcb_parser_main_func()

Variable Documentation

◆ g_cmdLineDesc

const wxCmdLineEntryDesc g_cmdLineDesc[]
static

Definition at line 241 of file pcb_parser_tool.cpp.

◆ pluginTypeMap

const std::map<std::string, PCB_IO_MGR::PCB_FILE_T> pluginTypeMap
static
Initial value:
= {
{ "kicad", PCB_IO_MGR::KICAD_SEXP },
{ "legacy", PCB_IO_MGR::LEGACY },
{ "allegro", PCB_IO_MGR::ALLEGRO },
{ "eagle", PCB_IO_MGR::EAGLE },
{ "easyeda", PCB_IO_MGR::EASYEDA },
{ "easyedapro", PCB_IO_MGR::EASYEDAPRO },
{ "fabmaster", PCB_IO_MGR::FABMASTER },
{ "geda", PCB_IO_MGR::GEDA_PCB },
{ "pads", PCB_IO_MGR::PADS },
{ "pcad", PCB_IO_MGR::PCAD },
{ "solidworks", PCB_IO_MGR::SOLIDWORKS_PCB },
}
@ KICAD_SEXP
S-expression Pcbnew file format.
Definition pcb_io_mgr.h:58
@ GEDA_PCB
Geda PCB file formats.
Definition pcb_io_mgr.h:69
@ ALTIUM_DESIGNER
Definition pcb_io_mgr.h:63
@ LEGACY
Legacy Pcbnew file formats prior to s-expression.
Definition pcb_io_mgr.h:59
@ CADSTAR_PCB_ARCHIVE
Definition pcb_io_mgr.h:64

Map from command line keys to plugin types.

Definition at line 299 of file pcb_parser_tool.cpp.

Referenced by FindPluginTypeFromParams(), and pcb_parser_main_func().

◆ registered

bool registered
static
Initial value:
= UTILITY_REGISTRY::Register( { "pcb_parser",
"Parse a PCB file",
static bool Register(const KI_TEST::UTILITY_PROGRAM &aProgInfo)
Register a utility program factory function against an ID string.
int pcb_parser_main_func(int argc, char **argv)

Definition at line 445 of file pcb_parser_tool.cpp.