LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TransactionalDirectory Class Referencefinal

Helper class to access a subdirectory of TransactionalFileSystem. More...

#include <transactionaldirectory.h>

+ Inheritance diagram for TransactionalDirectory:
+ Collaboration diagram for TransactionalDirectory:

Public Member Functions

 TransactionalDirectory (QObject *parent=nullptr)
 
 TransactionalDirectory (std::shared_ptr< TransactionalFileSystem > fs, const QString &dir="", QObject *parent=nullptr) noexcept
 
 TransactionalDirectory (TransactionalDirectory &other, const QString &subdir="", QObject *parent=nullptr) noexcept
 
virtual ~TransactionalDirectory () noexcept
 
std::shared_ptr< const
TransactionalFileSystem
getFileSystem () const noexcept
 
std::shared_ptr
< TransactionalFileSystem
getFileSystem () noexcept
 
const QString & getPath () const noexcept
 
bool isWritable () const noexcept
 
bool isRestoredFromAutosave () const noexcept
 
virtual FilePath getAbsPath (const QString &path="") const noexceptoverride
 
virtual QStringList getDirs (const QString &path="") const noexceptoverride
 
virtual QStringList getFiles (const QString &path="") const noexceptoverride
 
virtual bool fileExists (const QString &path) const noexceptoverride
 
virtual QByteArray read (const QString &path) const override
 
virtual void write (const QString &path, const QByteArray &content) override
 
virtual void removeFile (const QString &path) override
 
virtual void removeDirRecursively (const QString &path="") override
 
void saveTo (TransactionalDirectory &dest)
 
void moveTo (TransactionalDirectory &dest)
 
- Public Member Functions inherited from FileSystem
 FileSystem (QObject *parent=nullptr) noexcept
 
virtual ~FileSystem () noexcept
 

Static Private Member Functions

static void copyDirRecursively (TransactionalFileSystem &srcFs, const QString &srcDir, TransactionalFileSystem &dstFs, const QString &dstDir)
 

Private Attributes

std::shared_ptr
< TransactionalFileSystem
mFileSystem
 
QString mPath
 

Detailed Description

Helper class to access a subdirectory of TransactionalFileSystem.

Wraps a subdirectory of a librepcb::TransactionalFileSystem instance to allow accessing it like it was the root directory of a file system. In addition, it allows to copy or move whole directories between different transactional file systems.

Constructor & Destructor Documentation

TransactionalDirectory ( QObject *  parent = nullptr)
TransactionalDirectory ( std::shared_ptr< TransactionalFileSystem fs,
const QString &  dir = "",
QObject *  parent = nullptr 
)
explicitnoexcept
TransactionalDirectory ( TransactionalDirectory other,
const QString &  subdir = "",
QObject *  parent = nullptr 
)
noexcept
~TransactionalDirectory ( )
virtualnoexcept

Member Function Documentation

std::shared_ptr<const TransactionalFileSystem> getFileSystem ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

std::shared_ptr<TransactionalFileSystem> getFileSystem ( )
inlinenoexcept
const QString& getPath ( ) const
inlinenoexcept
bool isWritable ( ) const
noexcept

+ Here is the caller graph for this function:

bool isRestoredFromAutosave ( ) const
noexcept
FilePath getAbsPath ( const QString &  path = "") const
overridevirtualnoexcept

Implements FileSystem.

+ Here is the caller graph for this function:

QStringList getDirs ( const QString &  path = "") const
overridevirtualnoexcept

Implements FileSystem.

QStringList getFiles ( const QString &  path = "") const
overridevirtualnoexcept

Implements FileSystem.

+ Here is the caller graph for this function:

bool fileExists ( const QString &  path) const
overridevirtualnoexcept

Implements FileSystem.

+ Here is the caller graph for this function:

QByteArray read ( const QString &  path) const
overridevirtual

Implements FileSystem.

+ Here is the caller graph for this function:

void write ( const QString &  path,
const QByteArray &  content 
)
overridevirtual

Implements FileSystem.

+ Here is the caller graph for this function:

void removeFile ( const QString &  path)
overridevirtual

Implements FileSystem.

void removeDirRecursively ( const QString &  path = "")
overridevirtual

Implements FileSystem.

void saveTo ( TransactionalDirectory dest)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void moveTo ( TransactionalDirectory dest)

+ Here is the call graph for this function:

void copyDirRecursively ( TransactionalFileSystem srcFs,
const QString &  srcDir,
TransactionalFileSystem dstFs,
const QString &  dstDir 
)
staticprivate

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::shared_ptr<TransactionalFileSystem> mFileSystem
private
QString mPath
private

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