ACF $AcfVersion:0$
Public Types | Public Member Functions | List of all members
ifile::CTempFileManagerComp Class Reference

Component implementation of ITempFileManager interface. More...

#include <CTempFileManagerComp.h>

Inheritance diagram for ifile::CTempFileManagerComp:
icomp::CComponentBase ifile::ITempFileManager icomp::IComponent istd::IPolymorphic istd::IPolymorphic

Public Types

typedef icomp::CComponentBase BaseClass
 

Public Member Functions

virtual QByteArray BeginSession (const QString &subPath=QString(), const QByteArray &proposedSessionId=QByteArray()) override
 Start a new session for managing temporary files.
 
virtual QByteArray AddFileItem (const QByteArray &sessionId, const QString &filePath, const QByteArray &proposedSessionId=QByteArray()) override
 Add a new file to the session.
 
virtual QString GetPath (const QByteArray &sessionId, const QByteArray &id) const override
 Get the generated path of the file or folder by its ID.
 
virtual bool RemoveFileItem (const QByteArray &sessionId, const QByteArray &id) override
 Remove the file or folder given by its ID.
 
virtual void FinishSession (const QByteArray &sessionId) override
 Finish the given session.
 
virtual void ResetAllSessions () override
 Remove all running sessions.
 
- Public Member Functions inherited from icomp::CComponentBase
 CComponentBase ()
 Create component and assign it to specific context.
 
virtual const icomp::IComponentGetParentComponent (bool ownerOnly=false) const override
 Get parent of this component.
 
virtual void * GetInterface (const istd::CClassInfo &interfaceType, const QByteArray &subId="") override
 Get access to specified component interface.
 
virtual IComponentContextSharedPtr GetComponentContext () const override
 Get access to component context describing all application-specified component information loaded from components registry.
 
virtual void SetComponentContext (const IComponentContextSharedPtr &contextPtr, const icomp::IComponent *parentPtr, bool isParentOwner) override
 Set component context of this component.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Additional Inherited Members

- Protected Member Functions inherited from icomp::CComponentBase
bool IsComponentActive () const
 Check if component is active.
 
virtual void OnComponentCreated ()
 
virtual void OnComponentDestroyed ()
 
virtual const icomp::IRealComponentStaticInfoGetComponentStaticInfo () const =0
 Get access to static info of this component.
 
- Static Protected Member Functions inherited from icomp::CComponentBase
static const icomp::IRealComponentStaticInfoInitStaticInfo (IComponent *componentPtr)
 
static QByteArray GetComponentId (const icomp::IComponentContext *componentContextPtr, const QByteArray &contextId=QByteArray())
 

Detailed Description

Component implementation of ITempFileManager interface.

Definition at line 21 of file CTempFileManagerComp.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 24 of file CTempFileManagerComp.h.

Member Function Documentation

◆ AddFileItem()

virtual QByteArray ifile::CTempFileManagerComp::AddFileItem ( const QByteArray &  sessionId,
const QString &  fileName,
const QByteArray &  proposedSessionId = QByteArray() 
)
overridevirtual

Add a new file to the session.

The generated file path will be inside of the session's base folder.

Implements ifile::ITempFileManager.

◆ BeginSession()

virtual QByteArray ifile::CTempFileManagerComp::BeginSession ( const QString &  subPath = QString(),
const QByteArray &  proposedSessionId = QByteArray() 
)
overridevirtual

Start a new session for managing temporary files.

A new folder with the name subPath will be created inside of the root directory for the temp files (e.g. system temp). After a session was created, you can generate file paths for temporary files using returned session-ID.

Parameters
subPathPath to the subfolder for the session files inside of the temp directory used for this session.
proposedSessionIdThe used-ID for the new session. If this value is empty, an unique ID will be generated automatically.
Returns
Created session-ID or an empty value if the creation of the new session was failed.
Note
If a session with the same name or the same session-ID already exists, no new session will be created and the existing session-ID will be returned.

Implements ifile::ITempFileManager.

◆ FinishSession()

virtual void ifile::CTempFileManagerComp::FinishSession ( const QByteArray &  sessionId)
overridevirtual

Finish the given session.

All files contained in the session folder and the folder itself will be removed.

Implements ifile::ITempFileManager.

◆ GetPath()

virtual QString ifile::CTempFileManagerComp::GetPath ( const QByteArray &  sessionId,
const QByteArray &  id 
) const
overridevirtual

Get the generated path of the file or folder by its ID.

Implements ifile::ITempFileManager.

◆ RemoveFileItem()

virtual bool ifile::CTempFileManagerComp::RemoveFileItem ( const QByteArray &  sessionId,
const QByteArray &  id 
)
overridevirtual

Remove the file or folder given by its ID.

Implements ifile::ITempFileManager.

◆ ResetAllSessions()

virtual void ifile::CTempFileManagerComp::ResetAllSessions ( )
overridevirtual

Remove all running sessions.

Implements ifile::ITempFileManager.


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