23#ifndef SCH_IO_KICAD_LEGACY_H_
24#define SCH_IO_KICAD_LEGACY_H_
105 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
111 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
118 const wxString& aLibraryPath,
119 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
121 const wxString& aLibraryPath,
122 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
124 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
126 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
127 void DeleteSymbol(
const wxString& aLibraryPath,
const wxString& aSymbolName,
128 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
130 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
132 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
134 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
141 int minorVersion = 0 );
171 void cacheLib(
const wxString& aLibraryFileName,
const std::map<std::string, UTF8>* aProperties );
172 bool writeDocFile(
const std::map<std::string, UTF8>* aProperties );
173 bool isBuffering(
const std::map<std::string, UTF8>* aProperties );
196 void init(
SCHEMATIC* aSchematic,
const std::map<std::string, UTF8>* aProperties =
nullptr );
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Define a library symbol object.
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Holds all the data relating to one schematic.
Object to handle a bitmap image that can be inserted in a schematic.
Base class for a bus or wire entry.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
A cache assistant for KiCad legacy symbol libraries.
A SCH_IO derivation for loading schematic files created before the new s-expression file format.
wxString m_error
For throwing exceptions or errors on partial schematic loads.
SCH_SHEET * m_currentSheet
The sheet currently being loaded.
void loadFile(const wxString &aFileName, SCH_SCREEN *aScreen)
const IO_BASE::IO_FILE_DESC GetLibraryDesc() const override
Get the descriptor for the library container that this IO plugin operates on.
void saveBusAlias(std::shared_ptr< BUS_ALIAS > aAlias)
const IO_BASE::IO_FILE_DESC GetSchematicFileDesc() const override
Returns schematic file description for the SCH_IO.
void SaveSchematicFile(const wxString &aFileName, SCH_SHEET *aScreen, SCHEMATIC *aSchematic, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aSchematic to a storage file in a format that this SCH_IO implementation knows about,...
void saveText(SCH_TEXT *aText)
void saveJunction(SCH_JUNCTION *aJunction)
virtual ~SCH_IO_KICAD_LEGACY()
void loadPageSettings(LINE_READER &aReader, SCH_SCREEN *aScreen)
OUTPUTFORMATTER * m_out
The formatter for saving SCH_SCREEN objects.
bool isBuffering(const std::map< std::string, UTF8 > *aProperties)
void Format(SCH_SHEET *aSheet)
void loadHierarchy(SCH_SHEET *aSheet)
void saveBusEntry(SCH_BUS_ENTRY_BASE *aBusEntry)
SCH_SYMBOL * loadSymbol(LINE_READER &aReader)
LIB_SYMBOL * LoadSymbol(const wxString &aLibraryPath, const wxString &aAliasName, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this...
std::stack< wxString > m_currentPath
Stack to maintain nested sheet paths.
int GetModifyHash() const override
Return the modification hash from the library cache.
wxString m_path
Root project path for loading child sheets.
void LoadContent(LINE_READER &aReader, SCH_SCREEN *aScreen, int version=EESCHEMA_VERSION)
void loadHeader(LINE_READER &aReader, SCH_SCREEN *aScreen)
SCH_TEXT * loadText(LINE_READER &aReader)
const wxString & GetError() const override
Return an error string to the caller.
void init(SCHEMATIC *aSchematic, const std::map< std::string, UTF8 > *aProperties=nullptr)
initialize PLUGIN like a constructor would.
static const char * PropBuffering
The property used internally by the plugin to enable cache buffering which prevents the library file ...
static void FormatPart(LIB_SYMBOL *aSymbol, OUTPUTFORMATTER &aFormatter)
SCH_NO_CONNECT * loadNoConnect(LINE_READER &aReader)
int m_version
Version of file being loaded.
bool CanReadSchematicFile(const wxString &aFileName) const override
Checks if this SCH_IO can read the specified schematic file.
void saveLine(SCH_LINE *aLine)
SCH_BUS_ENTRY_BASE * loadBusEntry(LINE_READER &aReader)
SCH_SHEET * LoadSchematicFile(const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load information from some input file format that this SCH_IO implementation knows about,...
void saveSymbol(SCH_SYMBOL *aSymbol)
void saveField(SCH_FIELD *aField)
SCH_SHEET * loadSheet(LINE_READER &aReader)
SCH_LINE * loadWire(LINE_READER &aReader)
void saveNoConnect(SCH_NO_CONNECT *aNoConnect)
unsigned m_lineCount
for progress reporting
void DeleteSymbol(const wxString &aLibraryPath, const wxString &aSymbolName, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Delete the entire LIB_SYMBOL associated with aAliasName from the library aLibraryPath.
void SaveLibrary(const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override
std::shared_ptr< BUS_ALIAS > loadBusAlias(LINE_READER &aReader, SCH_SCREEN *aScreen)
SCH_IO_KICAD_LEGACY_LIB_CACHE * m_cache
unsigned m_lastProgressLine
SCH_BITMAP * loadBitmap(LINE_READER &aReader)
void EnumerateSymbolLib(wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath.
static LIB_SYMBOL * ParsePart(LINE_READER &aReader, int majorVersion=0, int minorVersion=0)
void cacheLib(const wxString &aLibraryFileName, const std::map< std::string, UTF8 > *aProperties)
SCH_SHEET * m_rootSheet
The root sheet of the schematic being loaded.
static const char * PropNoDocFile
The property used internally by the plugin to disable writing the library documentation (....
SCH_JUNCTION * loadJunction(LINE_READER &aReader)
void saveBitmap(const SCH_BITMAP &aBitmap)
void saveSheet(SCH_SHEET *aSheet)
bool IsLibraryWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
void CreateLibrary(const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Create a new empty library at aLibraryPath empty.
bool CanReadLibrary(const wxString &aFileName) const override
Checks if this IO object can read the specified library file/directory.
bool DeleteLibrary(const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Delete an existing library and returns true, or if library does not exist returns false,...
void SaveSymbol(const wxString &aLibraryPath, const LIB_SYMBOL *aSymbol, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aSymbol to an existing library located at aLibraryPath.
bool writeDocFile(const std::map< std::string, UTF8 > *aProperties)
LINE_READER * m_lineReader
for progress reporting
Base class that schematic file and library loading and saving plugins should derive from.
Segment description base class to describe items which have 2 end points (track, wire,...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Object used to load, save, search, and otherwise manipulate symbol library files.
static const std::string LegacySchematicFileExtension
static const std::string LegacySymbolLibFileExtension
Container that describes file type info.
Definition of file extensions used in Kicad.