LibrePCB Developers Documentation
LibraryBaseElement Class Reference

The LibraryBaseElement class. More...

#include <librarybaseelement.h>

+ Inheritance diagram for LibraryBaseElement:
+ Collaboration diagram for LibraryBaseElement:

Public Member Functions

 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
 

Static Public Member Functions

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
 Serialize into librepcb::SExpression node. More...
 
void serializeMessageApprovals (SExpression &root) const
 
void removeObsoleteMessageApprovals ()
 

Static Protected Member Functions

static Version readFileFormat (const TransactionalDirectory &directory, const QString &fileName)
 

Protected Attributes

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 LibraryBaseElement class.

Constructor & Destructor Documentation

◆ LibraryBaseElement() [1/4]

LibraryBaseElement ( )
delete

◆ LibraryBaseElement() [2/4]

LibraryBaseElement ( const LibraryBaseElement other)
delete

◆ LibraryBaseElement() [3/4]

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() [4/4]

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

◆ ~LibraryBaseElement()

~LibraryBaseElement ( )
virtualnoexcept

Member Function Documentation

◆ getDirectory() [1/2]

const TransactionalDirectory & getDirectory ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getDirectory() [2/2]

TransactionalDirectory & getDirectory ( )
inlinenoexcept

◆ getUuid()

const Uuid & getUuid ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getVersion()

const Version & getVersion ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getAuthor()

const QString & getAuthor ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getCreated()

const QDateTime & getCreated ( ) const
inlinenoexcept

◆ isDeprecated()

bool isDeprecated ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getNames()

const LocalizedNameMap & getNames ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getDescriptions()

const LocalizedDescriptionMap & getDescriptions ( ) const
inlinenoexcept

◆ getKeywords()

const LocalizedKeywordsMap & getKeywords ( ) const
inlinenoexcept

◆ getAllAvailableLocales()

QStringList getAllAvailableLocales ( ) const
noexcept
+ Here is the call graph for this function:

◆ getMessageApprovals()

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

◆ setVersion()

void setVersion ( const Version version)
inlinenoexcept
+ Here is the caller graph for this function:

◆ setAuthor()

void setAuthor ( const QString &  author)
inlinenoexcept
+ Here is the caller graph for this function:

◆ setDeprecated()

void setDeprecated ( bool  deprecated)
inlinenoexcept
+ Here is the caller graph for this function:

◆ setNames()

void setNames ( const LocalizedNameMap names)
inlinenoexcept
+ Here is the caller graph for this function:

◆ setDescriptions()

void setDescriptions ( const LocalizedDescriptionMap descriptions)
inlinenoexcept
+ Here is the caller graph for this function:

◆ setKeywords()

void setKeywords ( const LocalizedKeywordsMap keywords)
inlinenoexcept
+ Here is the caller graph for this function:

◆ setMessageApprovals()

void setMessageApprovals ( const QSet< SExpression > &  approvals)
inlinenoexcept

◆ runChecks()

RuleCheckMessageList runChecks ( ) const
virtual

Reimplemented in Component, Device, LibraryElement, Package, and Symbol.

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

◆ save()

void save ( )
virtual

Reimplemented in Library.

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

◆ saveTo()

void saveTo ( TransactionalDirectory dest)
virtual
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveTo()

void moveTo ( TransactionalDirectory dest)
virtual

Reimplemented in Library.

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

◆ saveIntoParentDirectory()

void saveIntoParentDirectory ( TransactionalDirectory dest)
virtual
+ Here is the call graph for this function:

◆ moveIntoParentDirectory()

void moveIntoParentDirectory ( TransactionalDirectory dest)
virtual
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

LibraryBaseElement & operator= ( const LibraryBaseElement rhs)
delete

◆ isValidElementDirectory() [1/2]

static bool isValidElementDirectory ( const FilePath dir)
inlinestaticnoexcept

◆ isValidElementDirectory() [2/2]

static bool isValidElementDirectory ( const TransactionalDirectory dir,
const QString &  path 
)
inlinestaticnoexcept

◆ serialize()

void serialize ( SExpression root) const
protectedvirtual

Serialize into librepcb::SExpression node.

Parameters
rootRoot node to serialize into.

Reimplemented in LibraryCategory, Component, Device, Library, LibraryElement, Package, and Symbol.

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

◆ serializeMessageApprovals()

void serializeMessageApprovals ( SExpression root) const
protected
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeObsoleteMessageApprovals()

void removeObsoleteMessageApprovals ( )
protected
+ Here is the call graph for this function:

◆ readFileFormat()

Version readFileFormat ( const TransactionalDirectory directory,
const QString &  fileName 
)
staticprotected
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ mShortElementName

const QString mShortElementName
protected

e.g. "lib", "cmpcat"

◆ mLongElementName

const QString mLongElementName
protected

e.g. "library", "component_category"

◆ mDirectory

std::unique_ptr<TransactionalDirectory> mDirectory
protected

◆ mUuid

Uuid mUuid
protected

◆ mVersion

Version mVersion
protected

◆ mAuthor

QString mAuthor
protected

◆ mCreated

QDateTime mCreated
protected

◆ mIsDeprecated

bool mIsDeprecated
protected

◆ mNames

LocalizedNameMap mNames
protected

◆ mDescriptions

LocalizedDescriptionMap mDescriptions
protected

◆ mKeywords

LocalizedKeywordsMap mKeywords
protected

◆ mMessageApprovals

QSet<SExpression> mMessageApprovals
protected

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