39 lines
751 B
C++
39 lines
751 B
C++
#pragma once
|
|
#include <fstream>
|
|
|
|
constexpr auto MAX_STRING_SIZE = 21;
|
|
|
|
class Buffer;
|
|
|
|
struct Pass
|
|
{
|
|
char label[MAX_STRING_SIZE];
|
|
char password[MAX_STRING_SIZE];
|
|
|
|
Pass() = default;
|
|
};
|
|
|
|
enum class Arg
|
|
{
|
|
Get, // get password for label
|
|
Generate, // generate password for label
|
|
List, // list all labels
|
|
Delete, // delete password for label
|
|
Print_all_p, // print all passwords
|
|
Input, // input password for label
|
|
Change, // change main password
|
|
Show, // show password for label
|
|
Error // error
|
|
};
|
|
|
|
Pass* find_password(Buffer* buff, char* label);
|
|
|
|
void generate_password(char* password);
|
|
|
|
bool save_buffer_to_file(Buffer* buffer);
|
|
|
|
bool load_buffer_from_file(Buffer* buffer);
|
|
|
|
void print_usage();
|
|
|
|
Arg get_args(int argc, char** argv, char** label); |