LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 (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 save ()
 
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

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)
 

Protected Member Functions

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

Protected Attributes

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

Constructor & Destructor Documentation

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 
)

+ Here is the call graph for this function:

LibraryBaseElement ( const FilePath elementDirectory,
bool  dirnameMustBeUuid,
const QString &  shortElementName,
const QString &  longElementName,
bool  readOnly 
)

+ Here is the call graph for this function:

~LibraryBaseElement ( )
virtualnoexcept

+ Here is the call graph for this function:

Member Function Documentation

const FilePath& getFilePath ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const QString& getShortElementName ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const QString& getLongElementName ( ) const
inlinenoexcept
bool isOpenedReadOnly ( ) const
inlinenoexcept
const Uuid& getUuid ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const Version& getVersion ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const QString& getAuthor ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const QDateTime& getCreated ( ) const
inlinenoexcept
bool isDeprecated ( ) const
inlinenoexcept
const LocalizedNameMap& getNames ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const LocalizedDescriptionMap& getDescriptions ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const LocalizedKeywordsMap& getKeywords ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

QStringList getAllAvailableLocales ( ) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void setVersion ( const Version version)
inlinenoexcept

+ Here is the caller graph for this function:

void setAuthor ( const QString &  author)
inlinenoexcept

+ Here is the caller graph for this function:

void setDeprecated ( bool  deprecated)
inlinenoexcept

+ Here is the caller graph for this function:

void setNames ( const LocalizedNameMap names)
inlinenoexcept

+ Here is the caller graph for this function:

void setDescriptions ( const LocalizedDescriptionMap descriptions)
inlinenoexcept

+ Here is the caller graph for this function:

void setKeywords ( const LocalizedKeywordsMap keywords)
inlinenoexcept

+ Here is the caller graph for this function:

LibraryElementCheckMessageList runChecks ( ) const
virtual

Reimplemented in Component, Symbol, Package, and LibraryElement.

+ Here is the call graph for this function:

void save ( )
virtual

Reimplemented in Library.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void saveTo ( const FilePath destination)
virtual

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void saveIntoParentDirectory ( const FilePath parentDir)
virtual

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void moveTo ( const FilePath destination)
virtual

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void moveIntoParentDirectory ( const FilePath parentDir)
virtual

+ Here is the call graph for this function:

LibraryBaseElement& operator= ( const LibraryBaseElement rhs)
delete
static bool isValidElementDirectory ( const FilePath dir)
inlinestaticnoexcept
void cleanupAfterLoadingElementFromFile ( )
protectedvirtualnoexcept

+ Here is the caller graph for this function:

void copyTo ( const FilePath destination,
bool  removeSource 
)
protectedvirtual

Reimplemented in Library.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize ( SExpression root) const
overrideprotectedvirtual

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.

Implements SerializableObject.

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:

Member Data Documentation

FilePath mDirectory
mutableprotected
bool mDirectoryIsTemporary
mutableprotected
bool mOpenedReadOnly
protected
bool mDirectoryNameMustBeUuid
protected
QString mShortElementName
protected

e.g. "lib", "cmpcat", "sym"

QString mLongElementName
protected

e.g. "library", "component_category", "symbol"

SExpression mLoadingFileDocument
protected
Uuid mUuid
protected
Version mVersion
protected
QString mAuthor
protected
QDateTime mCreated
protected
bool mIsDeprecated
protected
LocalizedNameMap mNames
protected
LocalizedDescriptionMap mDescriptions
protected
LocalizedKeywordsMap mKeywords
protected

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