32#include <wx/filename.h>
43 std::vector<LIB_SYMBOL*> originals;
44 plugin->EnumerateSymbolLib( originals, fn.GetFullPath() );
51 auto copy = std::make_unique<LIB_SYMBOL>( *symbol );
53 if( symbol->IsDerived() )
59 auto newParent = std::make_unique<LIB_SYMBOL>( *symbol->GetParent().lock() );
60 parent = newParent.get();
61 buf.
CreateBuffer( std::move( newParent ), std::make_unique<SCH_SCREEN>() );
64 copy->SetParent( parent );
66 else if( buf.
GetSymbol( symbol->GetName() ) )
74 BOOST_REQUIRE_EQUAL( buf.
GetBuffers().size(), 8 );
76 std::shared_ptr<SYMBOL_BUFFER> base = buf.
GetBuffer( wxS(
"74LS02" ) );
81 BOOST_REQUIRE_EQUAL( buf.
GetBuffers().size(), 3 );
82 BOOST_CHECK( buf.
GetSymbol( wxS(
"74469" ) ) );
83 BOOST_CHECK( buf.
GetSymbol( wxS(
"74LS00" ) ) );
84 BOOST_CHECK( buf.
GetSymbol( wxS(
"7400" ) ) );
Store a working copy of a library.
bool CreateBuffer(std::unique_ptr< LIB_SYMBOL > aCopy, std::unique_ptr< SCH_SCREEN > aScreen, bool aNew=false)
Create a new buffer to store a symbol. LIB_BUFFER takes ownership of aCopy.
bool DeleteBuffer(const SYMBOL_BUFFER &aSymbolBuf)
Delete the given symbol buffer from the library buffer.
const std::deque< std::shared_ptr< SYMBOL_BUFFER > > & GetBuffers() const
Return all buffered symbols.
std::shared_ptr< SYMBOL_BUFFER > GetBuffer(const wxString &aAlias) const
Return a symbol buffer with LIB_SYMBOL holding a symbolic alias.
LIB_SYMBOL * GetSymbol(const wxString &aAlias) const
Return the working copy of a LIB_SYMBOL root object with specified alias.
Define a library symbol object.
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()