Loading AdaptationParallel/include/statsgen.h +12 −4 Changes for AdaptationParallel/include/statsgen.h: 12 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -102,6 +102,13 @@ public: */ void showHelp(); /** * @brief Initialise the name of the database * @param : new value for "filename" */ void setFilename(std::string); /** * @brief Modify the attribute "hiderare", defining if * user wants to see statistics below 1% Loading Loading @@ -159,12 +166,10 @@ public: /** * @brief Calculate all statistics for a database which the * name is given by argument * @param : database's name * @brief Calculate all statistics for a database * @return 0 if error, 1 if success */ int generate_stats(const std::string &); int generate_stats(); /** * @brief Print all calculated statistics Loading @@ -174,6 +179,9 @@ public: private: std::string filename; // Filters int hiderare = 0; // Hide low statistics Loading AdaptationParallel/src/main.cpp +2 −2 Changes for AdaptationParallel/src/main.cpp: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -105,8 +105,8 @@ int main(int argc,char* argv[]) { } if (test.generate_stats(filename)) { test.setFilename(filename); if (test.generate_stats()) { test.print_stats(); } Loading AdaptationParallel/src/statsgen.cpp +12 −4 Changes for AdaptationParallel/src/statsgen.cpp: 12 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -25,6 +25,9 @@ using namespace std; void Statsgen::showHelp() { wcout << "\nUsage: database.txt [options]\n" << endl; wcout << "To be sure the database's format can be read, please use this command before:" << endl; wcout << "\ticonv -f ISO-8859-1 -t UTF-8 databaseInput.txt -o databaseOutput.txt\n" << endl; wcout << "Options:" << endl; wcout << "\t--help, -h\t\t:\tShow this help message" << endl; wcout << "\t--withcount, -w\t\t:\tMendatory if the input database has the following format : [number of occurence] [password]\n" << endl; Loading @@ -44,6 +47,12 @@ void Statsgen::showHelp() { } void Statsgen::setFilename(std::string name) { filename = name; } void Statsgen::setHiderare(int val) { hiderare = val; } Loading Loading @@ -108,7 +117,8 @@ void Statsgen::setSecurityRules() { } int Statsgen::generate_stats(const string & filename) { int Statsgen::generate_stats() { int nbline = nbline_file(filename); int rc; Loading Loading @@ -217,8 +227,6 @@ int Statsgen::generate_stats(const string & filename) { } void Statsgen::print_stats() { int count; float perc = (float) 100 * (total_filter / total_counter); Loading @@ -235,7 +243,7 @@ void Statsgen::print_stats() { wcout << "\tMinimum of upper characters in a password: " << minUpper << endl; float perce = (float) 100 * (nbSecurePassword / total_counter); wcout << "\n\t\t-->" << nbSecurePassword << " passwords\t(" << perce << " %) repect the security rules\n" << endl; wcout << "\n\t\t--> " << nbSecurePassword << " passwords\t(" << perce << " %) respect the security rules\n" << endl; wcout << "\nmin - max\n" << endl; Loading Loading
AdaptationParallel/include/statsgen.h +12 −4 Changes for AdaptationParallel/include/statsgen.h: 12 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -102,6 +102,13 @@ public: */ void showHelp(); /** * @brief Initialise the name of the database * @param : new value for "filename" */ void setFilename(std::string); /** * @brief Modify the attribute "hiderare", defining if * user wants to see statistics below 1% Loading Loading @@ -159,12 +166,10 @@ public: /** * @brief Calculate all statistics for a database which the * name is given by argument * @param : database's name * @brief Calculate all statistics for a database * @return 0 if error, 1 if success */ int generate_stats(const std::string &); int generate_stats(); /** * @brief Print all calculated statistics Loading @@ -174,6 +179,9 @@ public: private: std::string filename; // Filters int hiderare = 0; // Hide low statistics Loading
AdaptationParallel/src/main.cpp +2 −2 Changes for AdaptationParallel/src/main.cpp: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -105,8 +105,8 @@ int main(int argc,char* argv[]) { } if (test.generate_stats(filename)) { test.setFilename(filename); if (test.generate_stats()) { test.print_stats(); } Loading
AdaptationParallel/src/statsgen.cpp +12 −4 Changes for AdaptationParallel/src/statsgen.cpp: 12 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -25,6 +25,9 @@ using namespace std; void Statsgen::showHelp() { wcout << "\nUsage: database.txt [options]\n" << endl; wcout << "To be sure the database's format can be read, please use this command before:" << endl; wcout << "\ticonv -f ISO-8859-1 -t UTF-8 databaseInput.txt -o databaseOutput.txt\n" << endl; wcout << "Options:" << endl; wcout << "\t--help, -h\t\t:\tShow this help message" << endl; wcout << "\t--withcount, -w\t\t:\tMendatory if the input database has the following format : [number of occurence] [password]\n" << endl; Loading @@ -44,6 +47,12 @@ void Statsgen::showHelp() { } void Statsgen::setFilename(std::string name) { filename = name; } void Statsgen::setHiderare(int val) { hiderare = val; } Loading Loading @@ -108,7 +117,8 @@ void Statsgen::setSecurityRules() { } int Statsgen::generate_stats(const string & filename) { int Statsgen::generate_stats() { int nbline = nbline_file(filename); int rc; Loading Loading @@ -217,8 +227,6 @@ int Statsgen::generate_stats(const string & filename) { } void Statsgen::print_stats() { int count; float perc = (float) 100 * (total_filter / total_counter); Loading @@ -235,7 +243,7 @@ void Statsgen::print_stats() { wcout << "\tMinimum of upper characters in a password: " << minUpper << endl; float perce = (float) 100 * (nbSecurePassword / total_counter); wcout << "\n\t\t-->" << nbSecurePassword << " passwords\t(" << perce << " %) repect the security rules\n" << endl; wcout << "\n\t\t--> " << nbSecurePassword << " passwords\t(" << perce << " %) respect the security rules\n" << endl; wcout << "\nmin - max\n" << endl; Loading