LibrePCB Developers Documentation
Library Class Referencefinal

The Library class represents a library directory. More...

#include <library.h>

+ Inheritance diagram for Library:
+ Collaboration diagram for Library:

Public Member Functions

 Library ()=delete
 
 Library (const Library &other)=delete
 
 Library (const Uuid &uuid, const Version &version, const QString &author, const ElementName &name_en_US, const QString &description_en_US, const QString &keywords_en_US)
 
 ~Library () noexcept
 
template<typename ElementType >
QString getElementsDirectoryName () const noexcept
 
const QUrl & getUrl () const noexcept
 
const QSet< Uuid > & getDependencies () const noexcept
 
const QByteArray & getIcon () const noexcept
 
QPixmap getIconAsPixmap () const noexcept
 
const SimpleStringgetManufacturer () const noexcept
 
void setUrl (const QUrl &url) noexcept
 
void setDependencies (const QSet< Uuid > &deps) noexcept
 
void setIcon (const QByteArray &png) noexcept
 
void setManufacturer (const SimpleString &value) noexcept
 
virtual void save () override
 
virtual void moveTo (TransactionalDirectory &dest) override
 
template<typename ElementType >
QStringList searchForElements () const noexcept
 
Libraryoperator= (const Library &rhs)=delete
 
- Public Member Functions inherited from LibraryBaseElement
 LibraryBaseElement ()=delete
 
 LibraryBaseElement (const LibraryBaseElement &other)=delete
 
 LibraryBaseElement (const QString &shortElementName, const QString &longElementName, const Uuid &uuid, const Version &version, const QString &author, const ElementName &name_en_US, const QString &description_en_US, const QString &keywords_en_US)
 
 LibraryBaseElement (const QString &shortElementName, const QString &longElementName, bool dirnameMustBeUuid, std::unique_ptr< TransactionalDirectory > directory, const SExpression &root)
 
virtual ~LibraryBaseElement () noexcept
 
const TransactionalDirectorygetDirectory () const noexcept
 
TransactionalDirectorygetDirectory () noexcept
 
const UuidgetUuid () const noexcept
 
const VersiongetVersion () const noexcept
 
const QString & getAuthor () const noexcept
 
const QDateTime & getCreated () const noexcept
 
bool isDeprecated () const noexcept
 
const LocalizedNameMapgetNames () const noexcept
 
const LocalizedDescriptionMapgetDescriptions () const noexcept
 
const LocalizedKeywordsMapgetKeywords () const noexcept
 
QStringList getAllAvailableLocales () const noexcept
 
const QSet< SExpression > & getMessageApprovals () const noexcept
 
void setVersion (const Version &version) noexcept
 
void setAuthor (const QString &author) noexcept
 
void setDeprecated (bool deprecated) noexcept
 
void setNames (const LocalizedNameMap &names) noexcept
 
void setDescriptions (const LocalizedDescriptionMap &descriptions) noexcept
 
void setKeywords (const LocalizedKeywordsMap &keywords) noexcept
 
void setMessageApprovals (const QSet< SExpression > &approvals) noexcept
 
virtual RuleCheckMessageList runChecks () const
 
virtual void saveTo (TransactionalDirectory &dest)
 
virtual void saveIntoParentDirectory (TransactionalDirectory &dest)
 
virtual void moveIntoParentDirectory (TransactionalDirectory &dest)
 
LibraryBaseElementoperator= (const LibraryBaseElement &rhs)=delete
 

Static Public Member Functions

static std::unique_ptr< Libraryopen (std::unique_ptr< TransactionalDirectory > directory, bool abortBeforeMigration=false)
 
static QString getShortElementName () noexcept
 
static QString getLongElementName () noexcept
 
- Static Public Member Functions inherited from LibraryBaseElement
template<typename ElementType >
static bool isValidElementDirectory (const FilePath &dir) noexcept
 
template<typename ElementType >
static bool isValidElementDirectory (const TransactionalDirectory &dir, const QString &path) noexcept
 

Protected Member Functions

virtual void serialize (SExpression &root) const override
 Serialize into librepcb::SExpression node. More...
 
- Protected Member Functions inherited from LibraryBaseElement
void serializeMessageApprovals (SExpression &root) const
 
void removeObsoleteMessageApprovals ()
 

Private Member Functions

 Library (std::unique_ptr< TransactionalDirectory > directory, const SExpression &root)
 

Private Attributes

QUrl mUrl
 
QSet< UuidmDependencies
 
QByteArray mIcon
 
SimpleString mManufacturer
 

Additional Inherited Members

- Static Protected Member Functions inherited from LibraryBaseElement
static Version readFileFormat (const TransactionalDirectory &directory, const QString &fileName)
 
- Protected Attributes inherited from LibraryBaseElement
const QString mShortElementName
 e.g. "lib", "cmpcat" More...
 
const QString mLongElementName
 e.g. "library", "component_category" More...
 
std::unique_ptr< TransactionalDirectorymDirectory
 
Uuid mUuid
 
Version mVersion
 
QString mAuthor
 
QDateTime mCreated
 
bool mIsDeprecated
 
LocalizedNameMap mNames
 
LocalizedDescriptionMap mDescriptions
 
LocalizedKeywordsMap mKeywords
 
QSet< SExpressionmMessageApprovals
 

Detailed Description

The Library class represents a library directory.

Constructor & Destructor Documentation

◆ Library() [1/4]

Library ( )
delete
+ Here is the caller graph for this function:

◆ Library() [2/4]

Library ( const Library other)
delete

◆ Library() [3/4]

Library ( const Uuid uuid,
const Version version,
const QString &  author,
const ElementName name_en_US,
const QString &  description_en_US,
const QString &  keywords_en_US 
)

◆ ~Library()

~Library ( )
noexcept

◆ Library() [4/4]

Library ( std::unique_ptr< TransactionalDirectory directory,
const SExpression root 
)
private
+ Here is the call graph for this function:

Member Function Documentation

◆ getElementsDirectoryName()

template QString getElementsDirectoryName< Device > ( ) const
noexcept
+ Here is the caller graph for this function:

◆ getUrl()

const QUrl& getUrl ( ) const
inlinenoexcept

◆ getDependencies()

const QSet<Uuid>& getDependencies ( ) const
inlinenoexcept

◆ getIcon()

const QByteArray& getIcon ( ) const
inlinenoexcept
+ Here is the call graph for this function:

◆ getIconAsPixmap()

QPixmap getIconAsPixmap ( ) const
noexcept
+ Here is the caller graph for this function:

◆ getManufacturer()

const SimpleString& getManufacturer ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ setUrl()

void setUrl ( const QUrl &  url)
inlinenoexcept
+ Here is the caller graph for this function:

◆ setDependencies()

void setDependencies ( const QSet< Uuid > &  deps)
inlinenoexcept
+ Here is the caller graph for this function:

◆ setIcon()

void setIcon ( const QByteArray &  png)
inlinenoexcept
+ Here is the caller graph for this function:

◆ setManufacturer()

void setManufacturer ( const SimpleString value)
inlinenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

void save ( )
overridevirtual

Reimplemented from LibraryBaseElement.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveTo()

void moveTo ( TransactionalDirectory dest)
overridevirtual

Reimplemented from LibraryBaseElement.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ searchForElements()

template QStringList searchForElements< Device > ( ) const
noexcept
+ Here is the caller graph for this function:

◆ operator=()

Library& operator= ( const Library rhs)
delete
+ Here is the caller graph for this function:

◆ open()

std::unique_ptr< Library > open ( std::unique_ptr< TransactionalDirectory directory,
bool  abortBeforeMigration = false 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShortElementName()

static QString getShortElementName ( )
inlinestaticnoexcept
+ Here is the caller graph for this function:

◆ getLongElementName()

static QString getLongElementName ( )
inlinestaticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

void serialize ( SExpression root) const
overrideprotectedvirtual

Serialize into librepcb::SExpression node.

Parameters
rootRoot node to serialize into.

Reimplemented from LibraryBaseElement.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ mUrl

QUrl mUrl
private

◆ mDependencies

QSet<Uuid> mDependencies
private

◆ mIcon

QByteArray mIcon
private

◆ mManufacturer

SimpleString mManufacturer
private

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