Add LoginInfoPointer Struct

This commit is contained in:
Nikola Petrov
2023-08-27 20:18:47 +02:00
parent a900289dbf
commit 934c68e6c2
5 changed files with 38 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
#pragma once
struct Pass;
struct LoginInfoPointer;
class Buffer;
class Cryptography;
#include <string>
@@ -22,9 +22,11 @@ void print_args();
Arg get_args(int argc, char** argv, char** label);
const char* arg_get(Buffer& decrypted_buffer, const char* label);
LoginInfoPointer arg_get(Buffer& decrypted_buffer, const char* label);
const char* arg_generate(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char* label, Cryptography& crypto);
LoginInfoPointer arg_generate(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char* label, Cryptography& crypto);
LoginInfoPointer arg_input(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char* label, Cryptography& crypto);
void arg_list(Buffer& decrypted_buffer);
@@ -32,8 +34,6 @@ void arg_delete(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char*
void arg_print_all_p(Buffer& decrypted_buffer, std::string& user_pass);
const char* arg_input(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char* label, Cryptography& crypto);
void arg_change(Buffer& decrypted_buffer, Buffer& encrypted_buffer, std::string& user_pass, Cryptography& crypto);
void arg_show(Buffer& decrypted_buffer, const char* label);

View File

@@ -9,6 +9,14 @@ struct LoginInfo
uint32_t password;
};
struct LoginInfoPointer
{
const char* label;
const char* password;
LoginInfoPointer() : label(nullptr), password(nullptr) {}
};
struct Index
{
uint32_t count;
@@ -21,7 +29,7 @@ void delete_logininfo_from_buffer(Buffer& buffer, int index_of_pass);
void add_logininfo_to_buffer(Buffer& buffer, const char* label, const char* password);
const char* get_logininfo_pointer_from_buffer(Buffer& buffer, int index_of_pass);
LoginInfoPointer get_logininfo_pointer_from_buffer(Buffer& buffer, int index_of_pass);
void generate_password(std::string& password, int len);