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

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
 

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

◆ 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

◆ getNames()

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

◆ getDescriptions()

const LocalizedDescriptionMap& getDescriptions ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getKeywords()

const LocalizedKeywordsMap& getKeywords ( ) const
inlinenoexcept
+ Here is the call graph for this function:

◆ getAllAvailableLocales()

QStringList getAllAvailableLocales ( ) const
noexcept
+ Here is the call graph for this function:
+ 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 call graph for this function:
+ Here is the caller graph for this function:

◆ runChecks()

LibraryElementCheckMessageList runChecks ( ) const
virtual

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

+ 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:
+ Here is the caller 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
+ Here is the caller graph for this function:

◆ isValidElementDirectory() [1/2]

static bool isValidElementDirectory ( const FilePath dir)
inlinestaticnoexcept

◆ isValidElementDirectory() [2/2]

static bool isValidElementDirectory ( const TransactionalDirectory dir,
const QString &  path 
)
inlinestaticnoexcept
+ Here is the call graph for this function:

◆ serialize()

void serialize ( SExpression root) const
protectedvirtual

Serialize into librepcb::SExpression node.

Parameters
rootRoot node to serialize into.

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

+ Here is the call graph for this function:
+ Here is the caller 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

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