X-Git-Url: https://vaikene.ee/gitweb/pswgen09.html?a=blobdiff_plain;f=src%2Fapps%2FPswGen%2FGenerator%2Fmodule.h;fp=src%2Fapps%2FPswGen%2FGenerator%2Fgenerator.h;h=a1be474308b283ebf564d29acd66c0dc2692469f;hb=3352f7acc232104985807b9f470cb12bcb2b47c2;hp=3c3096fcd5a8f8d8ad438416df17bd7ac5789812;hpb=1d2a1e80abac012e9755cd23b264e3e099ccc3f5;p=evaf
diff --git a/src/apps/PswGen/Generator/generator.h b/src/apps/PswGen/Generator/module.h
similarity index 77%
rename from src/apps/PswGen/Generator/generator.h
rename to src/apps/PswGen/Generator/module.h
index 3c3096f..a1be474 100644
--- a/src/apps/PswGen/Generator/generator.h
+++ b/src/apps/PswGen/Generator/module.h
@@ -1,5 +1,5 @@
/**
- * @file PswGen/Generator/generator.h
+ * @file PswGen/Generator/module.h
* @brief Implementation of the iGenerator interface
* @author Enar Vaikene
*
@@ -17,14 +17,15 @@
* Agreement provided with the Software.
*/
-#ifndef __PSWGEN_GENERATOR_GENERATOR_H
-# define __PSWGEN_GENERATOR_GENERATOR_H
+#ifndef __PSWGEN_GENERATOR_MODULE_H
+# define __PSWGEN_GENERATOR_MODULE_H
#include "igenerator.h"
#include
#include
+#include
namespace eVaf {
namespace PswGen {
@@ -34,68 +35,66 @@ namespace Generator {
/// Internal implementation of the Generator module
namespace Internal {
+ class GeneratorImpl;
+} // namespace eVaf::PswGen::Generator::Internal
/**
- * iGenerator interface implementation.
- *
- * Implements the iGenerator interface using MD5 cryptographic hashes.
+ * Module implementing the iGenerator interface.
*/
-
-class GeneratorImpl : public iGenerator
+class Module : public Plugins::iPlugin
{
Q_OBJECT
public:
- GeneratorImpl();
+ Module();
- virtual ~GeneratorImpl();
+ virtual ~Module();
- bool init();
+ virtual bool init(QString const & args);
- void done();
+ virtual void done();
- virtual QString generatePassword(char const * const name, char const * const masterPassword, int length = iGenerator::DEFAULT_LENGTH, uint flags = 0);
+ virtual bool isReady() const { return true; }
- virtual int maxLength() const { return 24; }
+
+private: // Members
+
+ /// iGenerator interface instance
+ Internal::GeneratorImpl * mGenerator;
};
-} // namespace eVaf::PswGen::Generator::Internal
+
+namespace Internal {
/**
- * Module implementing the iGenerator interface.
+ * iGenerator interface implementation.
+ *
+ * Implements the iGenerator interface using MD5 cryptographic hashes.
*/
-class Module : public Plugins::iPlugin
+
+class GeneratorImpl : public iGenerator
{
Q_OBJECT
public:
- Module();
-
- virtual ~Module();
-
- virtual bool init(const QString & args);
-
- virtual void done();
-
- virtual bool isReady() const { return mReady; }
-
+ GeneratorImpl();
-private: // Members
+ virtual ~GeneratorImpl();
- /// Flag indicating that the module is ready
- bool mReady;
+ virtual QString generatePassword(QString const & name, QString const & masterPassword, int length, uint flags = 0) const;
- /// iGenerator interface instance
- Internal::GeneratorImpl * mGenerator;
+ virtual int maxLength() const { return 24; }
};
+} // namespace eVaf::PswGen::Generator::Internal
+
} // namespace eVaf::PswGen::Generator
} // namespace eVaf::PswGen
} // namespace eVaf
-#endif // generator.h
+#endif // module.h