LibrePCB Developers Documentation
Loading...
Searching...
No Matches
CategoryTreeBuilder< ElementType > Class Template Referencefinal

Helper class to extract a category tree from librepcb::WorkspaceLibraryDb. More...

#include <categorytreebuilder.h>

+ Collaboration diagram for CategoryTreeBuilder< ElementType >:

Public Member Functions

 CategoryTreeBuilder ()=delete
 
 CategoryTreeBuilder (const CategoryTreeBuilder &other)=delete
 
 CategoryTreeBuilder (const WorkspaceLibraryDb &db, const QStringList &localeOrder, bool nulloptIsRootCategory) noexcept
 
 ~CategoryTreeBuilder () noexcept
 
QStringList buildTree (const std::optional< Uuid > &category, bool *success=nullptr) const
 Build the parents tree for a specific category.
 
CategoryTreeBuilderoperator= (const CategoryTreeBuilder &rhs)=delete
 

Private Member Functions

bool getParentNames (const std::optional< Uuid > &category, QStringList &names, QSet< FilePath > &filePaths) const
 

Private Attributes

const WorkspaceLibraryDbmDb
 
const QStringList & mLocaleOrder
 
const bool mNulloptIsRootCategory
 

Detailed Description

template<typename ElementType>
class librepcb::editor::CategoryTreeBuilder< ElementType >

Helper class to extract a category tree from librepcb::WorkspaceLibraryDb.

Constructor & Destructor Documentation

◆ CategoryTreeBuilder() [1/3]

template<typename ElementType >
CategoryTreeBuilder ( )
delete

◆ CategoryTreeBuilder() [2/3]

template<typename ElementType >
CategoryTreeBuilder ( const CategoryTreeBuilder< ElementType > &  other)
delete

◆ CategoryTreeBuilder() [3/3]

template<typename ElementType >
CategoryTreeBuilder ( const WorkspaceLibraryDb db,
const QStringList &  localeOrder,
bool  nulloptIsRootCategory 
)
noexcept

◆ ~CategoryTreeBuilder()

template<typename ElementType >
~CategoryTreeBuilder ( )
noexcept

Member Function Documentation

◆ buildTree()

template<typename ElementType >
QStringList buildTree ( const std::optional< Uuid > &  category,
bool *  success = nullptr 
) const

Build the parents tree for a specific category.

Parameters
categoryThe category to get the tree from. If std::nullopt, it is assumed to represent the root category.
successIf not sullptr, this is set to whether the tree was successfully built or not.
Returns
All category names. The top level category comes first (root category if nulloptIsRootCategory=true passed to the constructor), then down the tree, with the passed category as the last element. In case of invalid categories, the returned list is either empty or contains error messages.
Exceptions
Incase of database errors.
+ Here is the caller graph for this function:

◆ operator=()

template<typename ElementType >
CategoryTreeBuilder & operator= ( const CategoryTreeBuilder< ElementType > &  rhs)
delete

◆ getParentNames()

template<typename ElementType >
bool getParentNames ( const std::optional< Uuid > &  category,
QStringList &  names,
QSet< FilePath > &  filePaths 
) const
private
+ Here is the call graph for this function:

Member Data Documentation

◆ mDb

template<typename ElementType >
const WorkspaceLibraryDb& mDb
private

◆ mLocaleOrder

template<typename ElementType >
const QStringList& mLocaleOrder
private

◆ mNulloptIsRootCategory

template<typename ElementType >
const bool mNulloptIsRootCategory
private

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