22#ifndef DESIGN_BLOCK_LIBRARY_ADAPTER_H
23#define DESIGN_BLOCK_LIBRARY_ADAPTER_H
44 static wxString GlobalPathEnvVariableName();
48 std::optional<LIB_STATUS>
LoadOne(
const wxString& nickname );
51 std::vector<DESIGN_BLOCK*> GetDesignBlocks(
const wxString& aNickname );
54 std::vector<wxString> GetDesignBlockNames(
const wxString& aNickname );
69 DESIGN_BLOCK* LoadDesignBlock(
const wxString& aNickname,
const wxString& aDesignBlockName,
70 bool aKeepUUID =
false );
75 bool DesignBlockExists(
const wxString& aNickname,
const wxString& aDesignBlockName );
84 const DESIGN_BLOCK* GetEnumeratedDesignBlock(
const wxString& aNickname,
const wxString& aDesignBlockName );
109 SAVE_T SaveDesignBlock(
const wxString& aNickname,
const DESIGN_BLOCK* aDesignBlock,
110 bool aOverwrite =
true );
121 void DeleteDesignBlock(
const wxString& aNickname,
const wxString& aDesignBlockName );
130 bool IsDesignBlockLibWritable(
const wxString& aNickname );
147 bool aKeepUUID =
false );
SAVE_T
The set of return values from DesignBlockSave() below.
std::shared_mutex & globalLibsMutex() override
static LEAK_AT_EXIT< std::shared_mutex > GlobalLibraryMutex
std::map< wxString, LIB_DATA > & globalLibs() const override
static LEAK_AT_EXIT< std::map< wxString, LIB_DATA > > GlobalLibraries
std::map< wxString, LIB_DATA > & globalLibs() override
LIBRARY_TABLE_TYPE Type() const override
The type of library table this adapter works with.
DESIGN_BLOCK_LIBRARY_ADAPTER(LIBRARY_MANAGER &aManager)
std::shared_mutex & globalLibsMutex() const override
A wrapper for static data that should not be destroyed at program exit.
virtual std::optional< LIB_STATUS > LoadOne(LIB_DATA *aLib)=0
virtual void enumerateLibrary(LIB_DATA *aLib, const wxString &aUri)=0
Override in derived class to perform library-specific enumeration.
LIBRARY_MANAGER_ADAPTER(LIBRARY_MANAGER &aManager)
Constructs a type-specific adapter into the library manager.
virtual LIBRARY_RESULT< IO_BASE * > createPlugin(const LIBRARY_TABLE_ROW *row)=0
Creates a concrete plugin for the given row.
virtual IO_BASE * plugin(const LIB_DATA *aRow)=0
A logical library item identifier and consists of various portions much like a URI.
Container for project specific data.
Utilities for intentionally "leaking" memory at program exit.
tl::expected< ResultType, LIBRARY_ERROR > LIBRARY_RESULT
Storage for an actual loaded library (including library content owned by the plugin)