digiKam
Digikam::DefaultVersionNamingScheme Class Reference
+ Inheritance diagram for Digikam::DefaultVersionNamingScheme:

Public Member Functions

virtual QString baseName (const QString &currentPath, const QString &filename, QVariant *counter, QVariant *intermediateCounter) override
 
 DefaultVersionNamingScheme ()=default
 
virtual QString directory (const QString &currentPath, const QString &filename) override
 
virtual QVariant incrementedCounter (const QVariant &counter) override
 
virtual QVariant initialCounter () override
 
virtual QString intermediateDirectory (const QString &currentPath, const QString &fileName) override
 
virtual QString intermediateFileName (const QString &currentPath, const QString &filename, const QVariant &version, const QVariant &counter) override
 
virtual QString versionFileName (const QString &currentPath, const QString &filename, const QVariant &counter) override
 
virtual ~DefaultVersionNamingScheme ()=default
 

Constructor & Destructor Documentation

◆ DefaultVersionNamingScheme()

Digikam::DefaultVersionNamingScheme::DefaultVersionNamingScheme ( )
default

◆ ~DefaultVersionNamingScheme()

virtual Digikam::DefaultVersionNamingScheme::~DefaultVersionNamingScheme ( )
virtualdefault

Member Function Documentation

◆ baseName()

QString Digikam::DefaultVersionNamingScheme::baseName ( const QString &  path,
const QString &  filename,
QVariant *  counter,
QVariant *  intermediateCounter 
)
overridevirtual

Analyzes the given file name. Returns the basename in the sense of stripping the file name of all added version information: A scheme that appends a number, like "MyFile-1.jpg", shall return "MyFile". Path is the directory, filename the file name, so path + filename is the file path. If counter is given, and the given file name has a version number, write it to counter. If intermediateCounter is given, and the given file name has an intermediate counter number, write it to counter. If not available, do not touch the given counters. See initialCounter() for the valid counter formats.

Implements Digikam::VersionNamingScheme.

Referenced by intermediateFileName(), and versionFileName().

◆ directory()

QString Digikam::DefaultVersionNamingScheme::directory ( const QString &  path,
const QString &  filename 
)
overridevirtual

For a loaded file in directory path and with file name filename, returns the directory in which a new version (a new intermediate version, resp.) shall be stored.

Implements Digikam::VersionNamingScheme.

◆ incrementedCounter()

QVariant Digikam::DefaultVersionNamingScheme::incrementedCounter ( const QVariant &  counter)
overridevirtual

Returns the given counter "incremented", that is, changed in a steady, repeatable fashion. You shall never return the given counter.

Implements Digikam::VersionNamingScheme.

◆ initialCounter()

QVariant Digikam::DefaultVersionNamingScheme::initialCounter ( )
overridevirtual

Returns an initial counter value for version and intermediate number counters. There are two places where you shall generate counters You will receive the given QVariant in incrementedCounter(), versionFileName() and baseName(), and you shall read a counter value from a generated file name in baseName().

Implements Digikam::VersionNamingScheme.

◆ intermediateDirectory()

QString Digikam::DefaultVersionNamingScheme::intermediateDirectory ( const QString &  currentPath,
const QString &  fileName 
)
overridevirtual

◆ intermediateFileName()

QString Digikam::DefaultVersionNamingScheme::intermediateFileName ( const QString &  path,
const QString &  filename,
const QVariant &  version,
const QVariant &  counter 
)
overridevirtual

Creates a version file name for an intermediate file in given directory, as previously returned by directory(), given baseName, as previously returned by baseName, version and intermediate number counter. Do not append a file suffix. You do not need to check if the file exists.

Implements Digikam::VersionNamingScheme.

References baseName().

◆ versionFileName()

QString Digikam::DefaultVersionNamingScheme::versionFileName ( const QString &  path,
const QString &  baseName,
const QVariant &  counter 
)
overridevirtual

Creates a version file name for a file in given directory, as previously returned by directory(), given baseName, as previously returned by baseName, and version counter. Do not append a file suffix. You do not need to check if the file exists.

Implements Digikam::VersionNamingScheme.

References baseName().


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