digiKam
cameranamehelper.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-08-01
7  * Description : camera name helper class
8  *
9  * Copyright (C) 2009-2012 by Andi Clemens <andi dot clemens at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_CAMERA_NAME_HELPER_H
25 #define DIGIKAM_CAMERA_NAME_HELPER_H
26 
27 // Qt includes
28 
29 #include <QString>
30 
31 // Local includes
32 
33 #include "digikam_export.h"
34 
35 namespace Digikam
36 {
37 
38 class DIGIKAM_GUI_EXPORT CameraNameHelper
39 {
40 
41 public:
42 
43  static QString cameraName(const QString& name);
44 
45  static QString cameraNameAutoDetected(const QString& name);
46 
47  static QString createCameraName(const QString& vendor,
48  const QString& product = QString(),
49  const QString& mode = QString(),
50  bool autoDetected = false);
51 
52  static bool sameDevices(const QString& deviceA, const QString& deviceB);
53 
54 private:
55 
56  enum Token
57  {
58  VendorAndProduct = 1,
59  Mode
60  };
61 
62 private:
63 
64  static QString extractCameraNameToken(const QString& cameraName, Token tokenID);
65  static QString parseAndFormatCameraName(const QString& cameraName, bool parseMode, bool autoDetected);
66 };
67 
68 } // namespace Digikam
69 
70 #endif // DIGIKAM_CAMERA_NAME_HELPER_H
Definition: cameranamehelper.h:39
Definition: datefolderview.cpp:43