KiCad PCB EDA Suite
FUTURE_FORMAT_ERROR Struct Reference

Variant of PARSE_ERROR indicating that a syntax or related error was likely caused by a file generated by a newer version of KiCad than this. More...

#include <ki_exception.h>

Inheritance diagram for FUTURE_FORMAT_ERROR:
PARSE_ERROR IO_ERROR

Public Member Functions

 FUTURE_FORMAT_ERROR (const wxString &aRequiredVersion)
 
 FUTURE_FORMAT_ERROR (const PARSE_ERROR &aParseError, const wxString &aRequiredVersion)
 
 ~FUTURE_FORMAT_ERROR () throw ()
 
void init (const wxString &aRequiredVersion)
 
void init (const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber, const wxString &aSource, const char *aInputLine, int aLineNumber, int aByteIndex)
 
void init (const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber)
 
const wxString ParseProblem ()
 
virtual const wxString Problem () const
 what was the problem? More...
 
virtual const wxString Where () const
 where did the Problem() occur? More...
 
virtual const wxString What () const
 A composite of Problem() and Where() More...
 

Public Attributes

wxString requiredVersion
 version or date of KiCad required to open file More...
 
int lineNumber
 at which line number, 1 based index. More...
 
int byteIndex
 at which byte offset within the line, 1 based index More...
 
std::string inputLine
 problem line of input [say, from a LINE_READER]. More...
 

Protected Attributes

wxString parseProblem
 
wxString problem
 
wxString where
 

Detailed Description

Variant of PARSE_ERROR indicating that a syntax or related error was likely caused by a file generated by a newer version of KiCad than this.

This can be used to generate more informative error messages.

Definition at line 174 of file ki_exception.h.

Constructor & Destructor Documentation

◆ FUTURE_FORMAT_ERROR() [1/2]

FUTURE_FORMAT_ERROR::FUTURE_FORMAT_ERROR ( const wxString &  aRequiredVersion)

Definition at line 109 of file exceptions.cpp.

109  :
110  PARSE_ERROR()
111 {
112  init( aRequiredVersion );
113 
114  lineNumber = 0;
115  byteIndex = 0;
116 }
void init(const wxString &aRequiredVersion)
Definition: exceptions.cpp:97
int lineNumber
at which line number, 1 based index.
Definition: ki_exception.h:120
int byteIndex
at which byte offset within the line, 1 based index
Definition: ki_exception.h:121

References PARSE_ERROR::byteIndex, init(), and PARSE_ERROR::lineNumber.

◆ FUTURE_FORMAT_ERROR() [2/2]

FUTURE_FORMAT_ERROR::FUTURE_FORMAT_ERROR ( const PARSE_ERROR aParseError,
const wxString &  aRequiredVersion 
)

Definition at line 119 of file exceptions.cpp.

120  :
121  PARSE_ERROR()
122 {
123  init( aRequiredVersion );
124 
125  if( !aParseError.Problem().IsEmpty() )
126  problem += wxS( "\n\n" ) + _( "Full error text:" ) + wxS( "\n" ) + aParseError.Problem();
127 
128  lineNumber = aParseError.lineNumber;
129  byteIndex = aParseError.byteIndex;
130  inputLine = aParseError.inputLine;
131 }
void init(const wxString &aRequiredVersion)
Definition: exceptions.cpp:97
virtual const wxString Problem() const
what was the problem?
Definition: exceptions.cpp:46
int lineNumber
at which line number, 1 based index.
Definition: ki_exception.h:120
#define _(s)
int byteIndex
at which byte offset within the line, 1 based index
Definition: ki_exception.h:121
std::string inputLine
problem line of input [say, from a LINE_READER].
Definition: ki_exception.h:127
wxString problem
Definition: ki_exception.h:106

References _, PARSE_ERROR::byteIndex, init(), PARSE_ERROR::inputLine, PARSE_ERROR::lineNumber, IO_ERROR::Problem(), and IO_ERROR::problem.

◆ ~FUTURE_FORMAT_ERROR()

FUTURE_FORMAT_ERROR::~FUTURE_FORMAT_ERROR ( )
throw (
)
inline

Definition at line 180 of file ki_exception.h.

180 {}

Member Function Documentation

◆ init() [1/3]

void IO_ERROR::init ( const wxString &  aProblem,
const char *  aThrowersFile,
const char *  aThrowersFunction,
int  aThrowersLineNumber 
)
inherited

Definition at line 53 of file exceptions.cpp.

55 {
56  problem = aProblem;
57 
58  // The throwers filename is a full filename, depending on Kicad source location.
59  // a short filename will be printed (it is better for user, the full filename has no meaning).
60  wxString srcname = aThrowersFile;
61 
62  where.Printf( _( "from %s : %s() line %d" ),
63  srcname.AfterLast( '/' ),
64  wxString( aThrowersFunction ),
65  aThrowersLineNumber );
66 }
#define _(s)
wxString where
Definition: ki_exception.h:107
wxString problem
Definition: ki_exception.h:106

References _, IO_ERROR::problem, and IO_ERROR::where.

Referenced by IO_ERROR::IO_ERROR().

◆ init() [2/3]

void PARSE_ERROR::init ( const wxString &  aProblem,
const char *  aThrowersFile,
const char *  aThrowersFunction,
int  aThrowersLineNumber,
const wxString &  aSource,
const char *  aInputLine,
int  aLineNumber,
int  aByteIndex 
)
inherited

Definition at line 69 of file exceptions.cpp.

73 {
74  parseProblem = aProblem;
75 
76  problem.Printf( _( "%s in '%s', line %d, offset %d." ),
77  aProblem,
78  aSource,
79  aLineNumber,
80  aByteIndex );
81 
82  inputLine = aInputLine;
83  lineNumber = aLineNumber;
84  byteIndex = aByteIndex;
85 
86  // The throwers filename is a full filename, depending on Kicad source location.
87  // a short filename will be printed (it is better for user, the full filename has no meaning).
88  wxString srcname = aThrowersFile;
89 
90  where.Printf( _( "from %s : %s() line:%d" ),
91  srcname.AfterLast( '/' ),
92  wxString( aThrowersFunction ),
93  aThrowersLineNumber );
94 }
wxString parseProblem
Definition: ki_exception.h:160
int lineNumber
at which line number, 1 based index.
Definition: ki_exception.h:120
#define _(s)
int byteIndex
at which byte offset within the line, 1 based index
Definition: ki_exception.h:121
wxString where
Definition: ki_exception.h:107
std::string inputLine
problem line of input [say, from a LINE_READER].
Definition: ki_exception.h:127
wxString problem
Definition: ki_exception.h:106

References _, PARSE_ERROR::byteIndex, PARSE_ERROR::inputLine, PARSE_ERROR::lineNumber, PARSE_ERROR::parseProblem, IO_ERROR::problem, and IO_ERROR::where.

Referenced by PARSE_ERROR::PARSE_ERROR().

◆ init() [3/3]

void FUTURE_FORMAT_ERROR::init ( const wxString &  aRequiredVersion)

Definition at line 97 of file exceptions.cpp.

98 {
99  requiredVersion = aRequiredVersion;
100 
101  problem.Printf( _( "KiCad was unable to open this file because it was created with a more "
102  "recent version than the one you are running.\n\n"
103  "To open it you will need to upgrade KiCad to a version dated %s or "
104  "later." ),
105  aRequiredVersion );
106 }
#define _(s)
wxString requiredVersion
version or date of KiCad required to open file
Definition: ki_exception.h:176
wxString problem
Definition: ki_exception.h:106

References _, IO_ERROR::problem, and requiredVersion.

Referenced by FUTURE_FORMAT_ERROR().

◆ ParseProblem()

const wxString PARSE_ERROR::ParseProblem ( )
inlineinherited

Definition at line 150 of file ki_exception.h.

150 { return parseProblem; }
wxString parseProblem
Definition: ki_exception.h:160

References PARSE_ERROR::parseProblem.

Referenced by PANEL_SETUP_RULES::OnCompile().

◆ Problem()

◆ What()

const wxString IO_ERROR::What ( ) const
virtualinherited

A composite of Problem() and Where()

Definition at line 30 of file exceptions.cpp.

31 {
32 #ifdef DEBUG
33  return wxString( "IO_ERROR: " ) + Problem() + "\n\n" + Where();
34 #else
35  return Problem();
36 #endif
37 }
virtual const wxString Problem() const
what was the problem?
Definition: exceptions.cpp:46
virtual const wxString Where() const
where did the Problem() occur?
Definition: exceptions.cpp:40

References IO_ERROR::Problem(), and IO_ERROR::Where().

Referenced by SYMBOL_TREE_MODEL_ADAPTER::AddLibrary(), PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_EDIT_FRAME::addLibTableEntry(), PCB_CONTROL::AppendBoard(), PL_EDIT_TOOL::Copy(), SCH_EDIT_FRAME::CreateArchiveLibrary(), DIALOG_PLOT_SCHEMATIC::createDXFFiles(), DIALOG_PLOT_SCHEMATIC::createHPGLFiles(), PCB_BASE_EDIT_FRAME::createNewLibrary(), DIALOG_PLOT_SCHEMATIC::createPDFFile(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), DIALOG_PLOT_SCHEMATIC::createPSFiles(), DIALOG_PLOT_SCHEMATIC::createSVGFiles(), FOOTPRINT_EDIT_FRAME::DeleteFootprintFromLibrary(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), DS_DATA_MODEL_FILEIO::DS_DATA_MODEL_FILEIO(), DS_DATA_MODEL_STRINGIO::DS_DATA_MODEL_STRINGIO(), PCB_EDIT_FRAME::Export_IDF3(), FOOTPRINT_EDIT_FRAME::ExportFootprint(), PCB_EDIT_FRAME::ExportFootprintsToLibrary(), PCB_EDIT_FRAME::ExportSpecctraFile(), SYMBOL_EDIT_FRAME::ExportSymbol(), PCB_EDIT_FRAME::FetchNetlistFromSchematic(), GPCB_PLUGIN::FootprintEnumerate(), LEGACY_PLUGIN::FootprintEnumerate(), EAGLE_PLUGIN::FootprintEnumerate(), PCB_IO::FootprintEnumerate(), FOOTPRINT_INFO_GENERATOR::GenerateHtml(), SYMBOL_LIBRARY_MANAGER::GetAlias(), SYMBOL_LIBRARY_MANAGER::GetBufferedSymbol(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), SYMBOL_LIBRARY_MANAGER::GetLibrary(), SYMBOL_LIBRARY_MANAGER::getOriginalSymbols(), SCH_EDIT_FRAME::importFile(), FOOTPRINT_EDIT_FRAME::ImportFootprint(), PCB_EDIT_FRAME::ImportSpecctraSession(), SYMBOL_EDIT_FRAME::ImportSymbol(), InvokePcbLibTableEditor(), InvokeSchEditSymbolLibTable(), PNS_LOG_FILE::Load(), FP_CACHE::Load(), GPCB_FPL_CACHE::Load(), SYMBOL_LIBS::LoadAllLibraries(), DS_DATA_MODEL::LoadDrawingSheet(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), SCH_EDIT_FRAME::LoadSheetFromFile(), SYMBOL_EDIT_FRAME::LoadSymbolFromCurrentLib(), main(), DIALOG_BOARD_SETUP::OnAuxiliaryAction(), APP_SINGLE_TOP::OnInit(), APP_TEST::OnInit(), CV::IFACE::OnKifaceStart(), PCB::IFACE::OnKifaceStart(), SCH::IFACE::OnKifaceStart(), APP_SINGLE_TOP::OnRun(), APP_TEST::OnRun(), APP_KICAD::OnRun(), DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::OpenProjectFiles(), SYMBOL_GRID_TRICKS::paste_text(), FP_GRID_TRICKS::paste_text(), PROJECT::PcbFootprintLibs(), KIWAY::Player(), DIALOG_CHOOSE_SYMBOL::PopulateFootprintSelector(), PANEL_REGULATOR::ReadDataFile(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::ReadNetlistFromFile(), CVPCB_MAINFRAME::ReadSchematicNetlist(), SYMBOL_EDIT_FRAME::replaceLibTableEntry(), PCB_EDIT_FRAME::RunEeschema(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), FOOTPRINT_EDIT_FRAME::SaveLibraryAs(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), SCH_EDIT_FRAME::saveSchematicFile(), SCH_BASE_FRAME::saveSymbolLibTables(), SchGetLibSymbol(), DS_DATA_MODEL::SetPageLayout(), DIALOG_CHOOSE_SYMBOL::ShowFootprintFor(), KICAD_MANAGER_CONTROL::ShowPlayer(), DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow(), DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG::TransferDataFromWindow(), DIALOG_EDIT_SYMBOLS_LIBID::TransferDataFromWindow(), SCH_SCREEN::UpdateSymbolLinks(), PANEL_SYM_LIB_TABLE::verifyTables(), SYMBOL_ASYNC_LOADER::worker(), NETLIST_EXPORTER_KICAD::WriteNetlist(), and SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary().

◆ Where()

const wxString IO_ERROR::Where ( ) const
virtualinherited

where did the Problem() occur?

Definition at line 40 of file exceptions.cpp.

41 {
42  return where;
43 }
wxString where
Definition: ki_exception.h:107

References IO_ERROR::where.

Referenced by PCB_EDIT_FRAME::FetchNetlistFromSchematic(), and IO_ERROR::What().

Member Data Documentation

◆ byteIndex

int PARSE_ERROR::byteIndex
inherited

at which byte offset within the line, 1 based index

Definition at line 121 of file ki_exception.h.

Referenced by FUTURE_FORMAT_ERROR(), PARSE_ERROR::init(), and PANEL_SETUP_RULES::OnCompile().

◆ inputLine

std::string PARSE_ERROR::inputLine
inherited

problem line of input [say, from a LINE_READER].

this is brought up in original byte format rather than wxString form, in case there was a problem with the encoding, in which case converting to wxString is not reliable in this context.

Definition at line 127 of file ki_exception.h.

Referenced by FUTURE_FORMAT_ERROR(), and PARSE_ERROR::init().

◆ lineNumber

int PARSE_ERROR::lineNumber
inherited

at which line number, 1 based index.

Definition at line 120 of file ki_exception.h.

Referenced by FUTURE_FORMAT_ERROR(), PARSE_ERROR::init(), and PANEL_SETUP_RULES::OnCompile().

◆ parseProblem

wxString PARSE_ERROR::parseProblem
protectedinherited

Definition at line 160 of file ki_exception.h.

Referenced by PARSE_ERROR::init(), and PARSE_ERROR::ParseProblem().

◆ problem

wxString IO_ERROR::problem
protectedinherited

◆ requiredVersion

wxString FUTURE_FORMAT_ERROR::requiredVersion

version or date of KiCad required to open file

Definition at line 176 of file ki_exception.h.

Referenced by init().

◆ where

wxString IO_ERROR::where
protectedinherited

Definition at line 107 of file ki_exception.h.

Referenced by IO_ERROR::init(), PARSE_ERROR::init(), and IO_ERROR::Where().


The documentation for this struct was generated from the following files: