-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (30 loc) · 1.24 KB
/
main.cpp
File metadata and controls
40 lines (30 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* @file main.cpp
* @brief Main entry point for the Secure Password Generator application.
*
* This file contains the main function that drives the Secure Password Generator
* application. It handles user input, invokes methods from the PasswordManager class,
* and outputs the generated secure password to the console.
*
* Usage: Compile and run this program with command-line options to generate
* secure passwords based on user-defined criteria.
*/
#include "include.h"
#include "password_manager.h"
std::unique_ptr<PasswordManager> password_manager = std::make_unique<PasswordManager>( );
int main( int argc, char* argv[ ] ) {
int length = 0;
bool useUppercase = false;
bool useLowercase = false;
bool useNumbers = false;
bool useSymbols = false;
STATUS_CODE statusCode;
std::string securePass = "";
password_manager->parseArguments( argc, argv, length, useUppercase, useLowercase, useNumbers, useSymbols );
statusCode = password_manager->generateSecurePassword( length, useUppercase, useLowercase, useNumbers, useSymbols );
if ( statusCode == STATUS_CODE::STATUS_SUCCESS ) {
securePass = password_manager->getSecurePassword( );
std::cout << "The secure password generated is: " << securePass << std::endl;
}
return 0;
}