digiKam
uniquemodifier.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2009-11-27
7  * Description : A modifier for appending a suffix number to a renaming option.
8  * This guarantees a unique string for duplicate values.
9  *
10  * Copyright (C) 2009-2012 by Andi Clemens <andi dot clemens at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_UNIQUE_MODIFIER_H
26 #define DIGIKAM_UNIQUE_MODIFIER_H
27 
28 // Qt includes
29 
30 #include <QStringList>
31 
32 // Local includes
33 
34 #include "modifier.h"
35 #include "parseresults.h"
36 
37 namespace Digikam
38 {
39 
40 class UniqueModifier : public Modifier
41 {
42  Q_OBJECT
43 
44 public:
45 
46  explicit UniqueModifier();
47  QString parseOperation(ParseSettings& settings, const QRegularExpressionMatch& match) override;
48  void reset() override;
49 
50 private:
51 
52  QMap<ParseResults::ResultsKey, QStringList> cache;
53 
54 private:
55 
56  // Disable
57  explicit UniqueModifier(QObject*) = delete;
58  UniqueModifier(const UniqueModifier&) = delete;
59  UniqueModifier& operator=(const UniqueModifier&) = delete;
60 };
61 
62 } // namespace Digikam
63 
64 #endif // DIGIKAM_UNIQUE_MODIFIER_H
Definition: modifier.h:35
Definition: parsesettings.h:43
Definition: uniquemodifier.h:41
UniqueModifier()
Definition: uniquemodifier.cpp:42
void reset() override
Definition: uniquemodifier.cpp:81
QString parseOperation(ParseSettings &settings, const QRegularExpressionMatch &match) override
Definition: uniquemodifier.cpp:57
Definition: datefolderview.cpp:43