LibrePCB Developers Documentation
LibraryElement Class Reference

The LibraryElement class extends the LibraryBaseElement class with some attributes and methods which are used for all library classes except categories. More...

#include <libraryelement.h>

+ Inheritance diagram for LibraryElement:
+ Collaboration diagram for LibraryElement:

Public Member Functions

 LibraryElement ()=delete
 
 LibraryElement (const LibraryElement &other)=delete
 
 LibraryElement (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)
 
 LibraryElement (const QString &shortElementName, const QString &longElementName, bool dirnameMustBeUuid, std::unique_ptr< TransactionalDirectory > directory, const SExpression &root)
 
virtual ~LibraryElement () noexcept
 
const QString & getGeneratedBy () const noexcept
 
const QSet< Uuid > & getCategories () const noexcept
 
const ResourceListgetResources () const noexcept
 
void setGeneratedBy (const QString &gen) noexcept
 
void setCategories (const QSet< Uuid > &uuids) noexcept
 
void setResources (const ResourceList &resources) noexcept
 
virtual RuleCheckMessageList runChecks () const override
 
LibraryElementoperator= (const LibraryElement &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 save ()
 
virtual void saveTo (TransactionalDirectory &dest)
 
virtual void moveTo (TransactionalDirectory &dest)
 
virtual void saveIntoParentDirectory (TransactionalDirectory &dest)
 
virtual void moveIntoParentDirectory (TransactionalDirectory &dest)
 
LibraryBaseElementoperator= (const LibraryBaseElement &rhs)=delete
 

Protected Member Functions

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

Protected Attributes

QString mGeneratedBy
 If not empty, the element is generated. More...
 
QSet< UuidmCategories
 
ResourceList mResources
 
- 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
 

Additional Inherited Members

- 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
 
- Static Protected Member Functions inherited from LibraryBaseElement
static Version readFileFormat (const TransactionalDirectory &directory, const QString &fileName)
 

Detailed Description

The LibraryElement class extends the LibraryBaseElement class with some attributes and methods which are used for all library classes except categories.

Constructor & Destructor Documentation

◆ LibraryElement() [1/4]

LibraryElement ( )
delete

◆ LibraryElement() [2/4]

LibraryElement ( const LibraryElement other)
delete

◆ LibraryElement() [3/4]

LibraryElement ( 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 
)

◆ LibraryElement() [4/4]

LibraryElement ( const QString &  shortElementName,
const QString &  longElementName,
bool  dirnameMustBeUuid,
std::unique_ptr< TransactionalDirectory directory,
const SExpression root 
)
+ Here is the call graph for this function:

◆ ~LibraryElement()

~LibraryElement ( )
virtualnoexcept

Member Function Documentation

◆ getGeneratedBy()

const QString & getGeneratedBy ( ) const
inlinenoexcept

◆ getCategories()

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

◆ getResources()

const ResourceList & getResources ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ setGeneratedBy()

void setGeneratedBy ( const QString &  gen)
inlinenoexcept

◆ setCategories()

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

◆ setResources()

void setResources ( const ResourceList resources)
inlinenoexcept
+ Here is the caller graph for this function:

◆ runChecks()

RuleCheckMessageList runChecks ( ) const
overridevirtual

Reimplemented from LibraryBaseElement.

Reimplemented in Component, Device, Package, and Symbol.

+ Here is the call graph for this function:

◆ operator=()

LibraryElement & operator= ( const LibraryElement rhs)
delete

◆ serialize()

void serialize ( SExpression root) const
overrideprotectedvirtual

Serialize into librepcb::SExpression node.

Parameters
rootRoot node to serialize into.

Reimplemented from LibraryBaseElement.

Reimplemented in Component, Device, Package, and Symbol.

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

Member Data Documentation

◆ mGeneratedBy

QString mGeneratedBy
protected

If not empty, the element is generated.

◆ mCategories

QSet<Uuid> mCategories
protected

◆ mResources

ResourceList mResources
protected

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