2023-08-15 22:18:49 +02:00

38 lines
758 B
C++

#pragma once
#include <fstream>
#include "buffer.h"
constexpr auto MAX_STRING_SIZE = 21;
struct Pass
{
char label[MAX_STRING_SIZE];
char password[MAX_STRING_SIZE];
Pass() = default;
};
enum class Args
{
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();
Args get_args(int argc, char** argv, char** label);