LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 (const FilePath &libDir, bool readOnly)
 
 ~Library () noexcept
 
template<typename ElementType >
FilePath getElementsDirectory () const noexcept
 
const QUrl & getUrl () const noexcept
 
const QSet< Uuid > & getDependencies () const noexcept
 
FilePath getIconFilePath () const noexcept
 
const QByteArray & getIcon () const noexcept
 
QPixmap getIconAsPixmap () const noexcept
 
void setUrl (const QUrl &url) noexcept
 
void setDependencies (const QSet< Uuid > &deps) noexcept
 
void setIcon (const QByteArray &png) noexcept
 
virtual void save () override
 
template<typename ElementType >
QList< FilePathsearchForElements () const noexcept
 
Libraryoperator= (const Library &rhs)=delete
 
- Public Member Functions inherited from LibraryBaseElement
 LibraryBaseElement ()=delete
 
 LibraryBaseElement (const LibraryBaseElement &other)=delete
 
 LibraryBaseElement (bool dirnameMustBeUuid, 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 FilePath &elementDirectory, bool dirnameMustBeUuid, const QString &shortElementName, const QString &longElementName, bool readOnly)
 
virtual ~LibraryBaseElement () noexcept
 
const FilePathgetFilePath () const noexcept
 
const QString & getShortElementName () const noexcept
 
const QString & getLongElementName () const noexcept
 
bool isOpenedReadOnly () const 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
 
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
 
virtual
LibraryElementCheckMessageList 
runChecks () const
 
virtual void saveTo (const FilePath &destination)
 
virtual void saveIntoParentDirectory (const FilePath &parentDir)
 
virtual void moveTo (const FilePath &destination)
 
virtual void moveIntoParentDirectory (const FilePath &parentDir)
 
LibraryBaseElementoperator= (const LibraryBaseElement &rhs)=delete
 
- Public Member Functions inherited from SerializableObject
 SerializableObject () noexcept
 
virtual ~SerializableObject () noexcept
 
SExpression serializeToDomElement (const QString &name) const
 Serialize the object to a new S-Expression node. More...
 

Static Public Member Functions

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
 
- Static Public Member Functions inherited from SerializableObject
template<typename T >
static void serializeObjectContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainerUuidSorted (SExpression &root, const T &container, const QString &itemName)
 

Private Member Functions

virtual void copyTo (const FilePath &destination, bool removeSource) override
 
virtual void serialize (SExpression &root) const override
 Serialize the object into an existing S-Expression node. More...
 

Private Attributes

QUrl mUrl
 
QSet< UuidmDependencies
 
QByteArray mIcon
 

Additional Inherited Members

- Protected Member Functions inherited from LibraryBaseElement
virtual void cleanupAfterLoadingElementFromFile () noexcept
 
- Protected Attributes inherited from LibraryBaseElement
FilePath mDirectory
 
bool mDirectoryIsTemporary
 
bool mOpenedReadOnly
 
bool mDirectoryNameMustBeUuid
 
QString mShortElementName
 e.g. "lib", "cmpcat", "sym" More...
 
QString mLongElementName
 e.g. "library", "component_category", "symbol" More...
 
SExpression mLoadingFileDocument
 
Uuid mUuid
 
Version mVersion
 
QString mAuthor
 
QDateTime mCreated
 
bool mIsDeprecated
 
LocalizedNameMap mNames
 
LocalizedDescriptionMap mDescriptions
 
LocalizedKeywordsMap mKeywords
 

Detailed Description

The Library class represents a library directory.

Author
ubruhin
Date
2016-08-03

Constructor & Destructor Documentation

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 ( const FilePath libDir,
bool  readOnly 
)

+ Here is the call graph for this function:

~Library ( )
noexcept

Member Function Documentation

template FilePath getElementsDirectory< Device > ( ) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const QUrl& getUrl ( ) const
inlinenoexcept
const QSet<Uuid>& getDependencies ( ) const
inlinenoexcept
FilePath getIconFilePath ( ) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const QByteArray& getIcon ( ) const
inlinenoexcept
QPixmap getIconAsPixmap ( ) const
noexcept
void setUrl ( const QUrl &  url)
inlinenoexcept

+ Here is the caller graph for this function:

void setDependencies ( const QSet< Uuid > &  deps)
inlinenoexcept

+ Here is the caller graph for this function:

void setIcon ( const QByteArray &  png)
inlinenoexcept

+ Here is the caller graph for this function:

void save ( )
overridevirtual

Reimplemented from LibraryBaseElement.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template QList< FilePath > searchForElements< Device > ( ) const
noexcept

+ Here is the call graph for this function:

Library& operator= ( const Library rhs)
delete
static QString getShortElementName ( )
inlinestaticnoexcept
static QString getLongElementName ( )
inlinestaticnoexcept
void copyTo ( const FilePath destination,
bool  removeSource 
)
overrideprivatevirtual

Reimplemented from LibraryBaseElement.

+ Here is the call graph for this function:

void serialize ( SExpression root) const
overrideprivatevirtual

Serialize the object into an existing S-Expression node.

This method inserts/appends all attributes and childs of the object to an existing S-Expression node. The content which already exists in the given S-Expression node will not be removed.

Note
The generated S-Expression node has always the format of the application's major version (it's not possible to generate DOMs of older versions).
Parameters
rootThe target DOM root node
Exceptions
ExceptionThis method throws an exception if an error occurs.

Reimplemented from LibraryBaseElement.

+ Here is the call graph for this function:

Member Data Documentation

QUrl mUrl
private
QSet<Uuid> mDependencies
private
QByteArray mIcon
private

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