]> vaikene.ee Git - evaf/blobdiff - src/apps/PswGen/Storage/istorage.h
Added 'suffix' option, which can be used to generate different password versions...
[evaf] / src / apps / PswGen / Storage / istorage.h
index 48226d0ec7a6d66b18c2d1ab7171e991b01c7968..e9abef95850f773a72f147630d5f45aa6cf7768b 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Interface for password storage modules
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2012 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
@@ -43,14 +43,16 @@ public:
         : QSharedData()
         , mModified(false)
         , mName(name)
+        , mSuffix()
         , mLength(0)
         , mFlags(0)
     {}
 
-    Data(QString const & name, int l, uint f = 0)
+    Data(QString const & name, QString const & suffix, int l, uint f = 0)
         : QSharedData()
         , mModified(false)
         , mName(name)
+        , mSuffix(suffix)
         , mLength(l)
         , mFlags(f)
     {}
@@ -58,6 +60,16 @@ public:
     /// Name of the password
     inline QString const & name() const { return mName; }
 
+    /// Optional suffix added to the name
+    inline QString const & suffix() const { return mSuffix; }
+    void setSuffix(QString const & suffix)
+    {
+        if (suffix != mSuffix) {
+            mSuffix = suffix;
+            mModified = true;
+        }
+    }
+
     /// Length of the generated password
     inline int length() const { return mLength; }
     inline void setLength(int value)
@@ -89,6 +101,7 @@ private:
 
     bool mModified;
     QString mName;
+    QString mSuffix;
     int mLength;
     uint mFlags;